dtio35880438
2014-04-30 23:55
浏览 55
已采纳

登录时检查哈希密码

Next thing bothers me: hashing password makes them practically irreversible. So if I store password in database with any of hash alghorytms, on next login, how will I check is the password in database? Or simplier I wonder how to decrypt hashed password when logging?

图片转代码服务由CSDN问答提供 功能建议

下一件事困扰我:哈希密码使它们几乎不可逆转。 因此,如果我使用任何hash alghorytms将密码存储在数据库中,则在下次登录时,我将如何检查数据库中的密码? 或者更简单我想知道如何在记录时解密哈希密码?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dragonmeng2002 2014-04-30 23:56
    已采纳

    You hash the password the user provides using the same algorithm and compare it against the stored one.

    In PHP 5.5, there are new functions password_hash and password_verify built in for this that use the industy-standard bcrypt algorithm. In PHP 5.4 and PHP 5.3 (v 5.3.7+), the password_compat library provides the same functions.

    打赏 评论

相关推荐 更多相似问题