Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where can i save a password?

Status
Not open for further replies.

quaked2023

Technical User
Joined
Jan 22, 2004
Messages
105
Location
MX

Hello: i want to use a password in my program, but the problem is that i don't know how or where to save it, i was thinking that maybe in the registry, or maybe i can encrypt it but i don't know where... Please help me.

Thanks in advance!

-The Only Privacy Left Is The Inside Of Your Head!- QUAKED2023
 
hi

its totally upto u wherever u want to save it, if ur application interacts with any database like Sql or Oracle then u can encrypt it and store in a table else u can create a new registry entry and store u Password there.

HTH
Gazal
 
Even in registry you should seriously consider encription for your password.

Hope I've been helpful,
Bogdan Muresan.
 
Don't use any form of reversible encryption - use something like a MD5 instead.

mmilan.
 
Another option would be to store it in a file of some kind (ini file for example). But make sure that you use a good encryption algorithm.

zemp
 
Just worth pointing out that MD5 isn't generally considered encryption.
 
True - but it would give you a check value that you can compare against and safely store in the database.

A slip of the tongue, if you will...

mmilan
 
hello:

Thanks for all your tips, but can u tell me how to do it... i'm not using any database in my program so i think that the best way to go is to create a registry value or store it in an ini file.... but i don't know how to do it, please tell me how......

Thanks in advance

-The Only Privacy Left Is The Inside Of Your Head!- QUAKED2023
 
Use SaveSetting and GetSetting functions for saving to the Registry - unless you fancy using the API instead (not as friendly, but you can write to anywhere in the registry, not just the VB bit)

mmilan
 
>a check value that you can compare

Sure. I have no problem with MD5 being used for this purpose. I was just trying to ensure accuracy

>can u tell me how to do it

What OS?
 
Actually, I'll just point you at thread222-873783, which contains my code for my two favoured ways of doing MD5 (and also contains a link to Thread222-535644 where I provide an example of doing full strength encryption using Windows' built-in cryptographic API)
 
I use this to store and retreive the last person that signed on to my program but would work with passwords also (its not secure in this format):

'-- READS THE ENTRY
txtUserName = GetSetting("FastOrder", "Section 1", "Key 1")

'-- SAVES THE ENTRY
SaveSetting "FastOrder", "Section 1", "Key 1", txtUserName

Shannan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top