哪种密码哈希算法使用&quot'密码 - 哈什:passwort默认值”在PHP中

发布于 2025-02-11 19:44:41 字数 166 浏览 2 评论 0原文

简短问题:

哪种算法使用PHP方法:password_hash(“ xxx”,password_default);

这是MD5或SHA512之类的近距离名称,还是它是具有password_default名称的算法?

对于考试,我需要知道这一点,但是我在万维网上没有找到任何东西

Short Question:

Which algorithm uses the PHP method: password_hash("xxx", PASSWORD_DEFAULT);

Has this a closer name like md5 or sha512 or is this an own algorithm with the name PASSWORD_DEFAULT?

For an exam I need to know this, but I didn't found anything to this on the World Wide Web

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

这样的小城市 2025-02-18 19:44:41

它在

。当前是password_bcrypt(由于PHP 5.5.0)。哈希将包括password_verify()的算法。它允许您实现密码存储,该密码存储将自动更新为新的(和更安全的算法)。

  • 在帐户上创建或密码更改使用password_hash() password_default 创建密码哈希。
  • 在登录时使用password_verify()
  • 成功登录后,使用password_needs_hreashash()进行检查后,并使用用户刚刚提供的密码更新哈希。

It's documented in the PHP manual

It can change with new PHP versions. Currently it is PASSWORD_BCRYPT (since PHP 5.5.0). The hash will include the algorithm for password_verify(). It allows you to implement password storage that will update to newer (and more secure algorithms) automatically.

  • On account create or password change use password_hash() with PASSWORD_DEFAULT to create the password hash.
  • On sign in use password_verify().
  • After successful sign in check with password_needs_rehash() and update the hash using the password the user just provided.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文