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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypting Passwords

Status
Not open for further replies.

SSJ

Programmer
Sep 26, 2002
54
PT
I'm needing a simple password encrypting algorythm, something easy to code. I don't need to use JCE, I only need a simple password encoder/decoder algorythm that I'll use either in a JAVA app as well as on a VB app (This is for a standalone app that only runs inside a factory, the DB pass is stored on a .ini file, but I want to store it encrypted just for sure, I don't need any high security level there).
Can anyone maybe point me to some code example, just to get it started?

TIA
 
You should use the JCE, otherwise you aren't really encrypting, you are obfuscating.

If you just want to obfuscate the password, do a base64 encode/decode. Anyone will be able to view the passwords if they know how you encoded them but they will be 'relatively' safe.

Personally, I'd do a MD5 hash on the password and store the hash. Then, when someone logs in, you hash the password that they provided and if the hash matches what you stored previously, the password is 'likely' correct (with very high probability).

The advantage to this technique is there is no reason to keep the passwords secret. Anyone opening the password file won't be able to use the information since it is 'virtually' impossible to find a string that creates the same hash.
 
ok thanks, that will just do for what I'm after, I just need to "obsfuscate" the password like u said no major security issues here. I've used the base64 encode/decode like u said.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top