你如何使用 bcrypt 在 PHP 中散列密码? - How do you use bcrypt for hashing passwords in PHP?

语言: CN / TW / HK

问题:

Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules".我时不时地听到“使用 bcrypt 在 PHP 中存储密码,bcrypt 规则”的建议。

But what is bcrypt ?但什么是bcrypt PHP doesn't offer any such functions, Wikipedia babbles about a file-encryption utility and Web searches just reveal a few implementations of Blowfish in different languages. PHP 不提供任何这样的功能,维基百科喋喋不休地谈论一个文件加密实用程序,而网络搜索只是揭示了一些不同语言的Blowfish实现。 Now Blowfish is also available in PHP via mcrypt , but how does that help with storing passwords?现在 Blowfish 也可以通过mcrypt在 PHP 中使用,但这对存储密码有什么帮助? Blowfish is a general purpose cipher, it works two ways. Blowfish 是一种通用密码,它有两种工作方式。 If it could be encrypted, it can be decrypted.如果可以加密,则可以解密。 Passwords need a one-way hashing function.密码需要一种单向散列函数。

What is the explanation?解释是什么?


解决方案:

参考一: http://stackoom.com/question/K7Uv
参考二: How do you use bcrypt for hashing passwords in PHP?
「其他文章」