PDA

View Full Version : MD5 Question


2bz2p
09-29-2008, 04:29 PM
Hi,

So this is just a question off my hip because I havent run this script.


//To create the encrypted password.

$pass_plain = 'password';

$pass_encrypt = md5($pass_plain);

//code to add to database

//Then to check the encrypted password

$user_entered_pass = 'password';

$user_ecrypt_pass = md5 ($user_entered_pass);

//Write a string comparison for the one in the database and match it to the $user_ecrypt_pass.



Would the two hashes match or would the md5 create a new 32 Char hash?

Thanks
2b

lux
09-29-2008, 07:03 PM
Yes, that will work.

2bz2p
09-29-2008, 08:46 PM
Thats what I thought but being away from my computer I couldnt test it.

Thanks
2b