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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.