PHP Bcrypt检索密码 [英] PHP Bcrypt Retrieve Password

查看:100
本文介绍了PHP Bcrypt检索密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当有人在网站上注册后,我使用bcrypt加密他们的密码,该密码存储在数据库的密码列中.现在,如果他们忘记了密码,我想通过电子邮件向他们发送密码,以便他们可以登录和更改密码.如何逆转bcrypt加密以找回原始密码?

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?

推荐答案

Bcrypt是单向哈希.您无法解密.您可以做的就是向他们发送一个重置链接,单击该链接将允许他们设置新密码.

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.

这篇关于PHP Bcrypt检索密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆