dongquming3255 2013-10-08 20:43
浏览 92
已采纳

如何在php中恢复加密密码

when a new user registers to my site it uses the crypt() method and then stores it in DB.

I want to make a "i forgot my password" page where a user can get his password by mail.

My question is simply: how do i convert for example ,this: "$2a$13$Ku2hb./9aA71dPo/E015m.WBs6.RsDC/BL8jbz8dMRrmm0jGNIJRO" to "Some user password"?

  • 写回答

3条回答 默认 最新

  • dqk94069 2013-10-08 20:50
    关注

    The crypt() function uses one-way encryption, which means that there is no decrypt() function.

    Basically you have two options:

    1.Implement your own encrypt method which you can decrypt later -not recommended-

    2.Implement a 'reset password' instead

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 孟德尔随机化结果不一致
  • ¥15 深度学习残差模块模型
  • ¥20 两个不同Subnet的点对点连接
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计