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条)

报告相同问题?