Log in

View Full Version : Md5 for passwords?


a12735497073
Apr 20, 2011, 06:42 PM
Why should I store MD5 passwords in the database instead of the real thing? How does the user log in??

nohmar
Apr 20, 2011, 06:45 PM
MD5 is nice because if someone gets a hold of your database, they don't have the actual password. The user logs in by typing the normal password and you can check if the md5 of what they typed in is the same as what's in the database.

Skylude
Apr 20, 2011, 06:58 PM
What Nohmar said is right. The other benefit is that MD5 is extremely difficult to reverse back to the original text.

Skylude
Apr 20, 2011, 07:00 PM
One more thing to note, if you need to at some point get the password back I would look into use SALT and sha1 or some other reversible encryption.

a12735497073
Apr 20, 2011, 07:04 PM
Thanks!