PHP:How to send the original password to the user when he clicks forgot password which is encrypted by using md5?

后端 未结 5 1700
野的像风
野的像风 2020-11-29 09:04

I am using md5 to encrypt the passwords in my project.

When user clicks on forgot password and submits his email,I have to send His password to him.

But the

5条回答
  •  感动是毒
    2020-11-29 09:15

    Just adding this as a sidenote:

    While you cannot "unhash" the MD5 hash, you can look it up in a Rainbow table. That might allow you to send the original plaintext password to the user. I am not suggesting to do that though, because it's just a waste of resources compared to just creating a new password and sending that to the user instead.

    From http://en.wikipedia.org/wiki/Rainbow_table:

    A rainbow table is a lookup table offering a time-memory tradeoff used in recovering the plaintext password from a password hash generated by a hash function, often a cryptographic hash function. A common application is to make attacks against hashed passwords feasible. A salt is often employed with hashed passwords to make this attack more difficult, often infeasible.

    Also see the comments below for additional notes.

提交回复
热议问题