PHP Bcrypt Retrieve Password [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-08 03:52:33

问题


So after someone registers on the site, I use bcrypt to encrypt their password which gets stored in the password column of the database. Now if they forgot their password, I want to email them the password so they can login and change it. How do I reverse the bcrypt encryption to get the original password back?


回答1:


Bcrypt is a one-way hash. You cannot decrypt it. What you can do is send them a reset link which, when clicked, will allow them to set a new password.




回答2:


You have not understood the fundamental working of bcrypt. If there would be a simple reverse function, nobody would use bcrypt any longer. Use a password reset procedure instead of sending plaintext passwords.

Please see the Forgot Password Cheat Sheet.



来源:https://stackoverflow.com/questions/13084728/php-bcrypt-retrieve-password

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!