Jump to content

MD5 Question


dual_alliance

Recommended Posts

I have seen many tutorials written, and they have used the MD5 function.  However l don't understand fully how it works.

Does it work by the user enters a password (in register.php) l encrypt it and send it to a MySQL database.  Then when the user logs in (login.php) it converts that password to MD5 and checks to see if it matches with the MD5 password stored in the MySQL database?

Thanks,

dual_alliance
Link to comment
https://forums.phpfreaks.com/topic/14858-md5-question/
Share on other sites

Yep. I prefer to use the SHA() function myself, but it's basically the same thing.

Lets say you enter password as your password. You store is as md5('password') and when you check it, you check
if ((md5($_POST['password']) === (md5($password))) {
  // whatever
}
Where $password is the password you pulled from the db.
Link to comment
https://forums.phpfreaks.com/topic/14858-md5-question/#findComment-59466
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.