PHP,PHPMYADMIN和MYSQL中可用的密码哈希功能

发布于 2025-01-22 07:48:45 字数 449 浏览 4 评论 0原文

我想在PHP中使用哈希密码,然后将结果发送到MySQL。

我可能会不时地使用phpmyadmin中的可用哈希功能来更新/重置密码。

我过去曾经为此使用md5。作为PHP,PHPMyAdmin和MySQL的可用性。 但是,由于安全问题,MD5不再是一种选择。 我研究了sha1,这也不是一个选项。 sha2似乎在phpmyadmin中没有可用,因此无法轻松重置密码。 我看到的一种版本的phpmyadmin使用了password_hash,但在另一台服务器上没有可用,因此这是一个问题。另一个问题是,每次运行该功能可能是由于随机盐而运行时,它似乎会产生不同的输出。

我可以从PHP调用密码哈希功能,也可以在PHPMyAdmin和MySQL中使用?

基本上,我应该用什么替换md5

I want to hash passwords in PHP then send the result to MySQL.

From time to time I might want to use the available hashing functions in PHPMyAdmin to update/reset passwords.

I used to use MD5 for this in the past. As its available in PHP, PHPMyAdmin and in MySQL.
However MD5 is no longer an option due to security concerns.
I looked into SHA1 and that is no longer an option either.
SHA2 does not seem to be available in PHPMyAdmin so that wont work for easy password resetting.
One version of PHPMyAdmin I saw used password_hash but it wasn't available on another server so that is one issue. Another issue is it seems to produce a different output each time the function is run probably because of a random salt.

Is there a password hashing function that I can call from PHP, that will also be available in PHPMyAdmin and in MySQL as well?

Basically what should I replace MD5 with?

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

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

发布评论

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

评论(1

忆悲凉 2025-01-29 07:48:45

在所有3个领域都有类似的哈希功能的日子已经一去不复返了。

我喜欢在所有3个领域的MD5均为PHP,PHPMYADMIN和MYSQL。由于password_hash是使用PHP哈希密码的推荐方法,因此我将不得不使用它。

对于phpmyadmin中的重置密码,我可以允许md5 hash,并将应用程序更新为php password> password_hash下次用户登录与WordPress的方式相似。 [如果有人发现这种方法有问题,我想知道]

Gone are the days when there is a similar hashing function in all 3 areas.

I liked how MD5 was available in all 3 areas being PHP, PHPMyAdmin and MySQL. Since password_hash is the recommended way to hash passwords with PHP I will have to use that.

For resetting passwords in PHPMyAdmin I may allow MD5 hash and have the application update it to php password_hash next time the user logs in similar to how Wordpress did it. [If anyone sees a problem with this method I would like to be made aware]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文