在PHP 5.2中保存密码时bcrypt的替代方法 [英] Alternative to bcrypt when saving passwords in PHP 5.2
问题描述
我在本地使用 bcrypt
,因为xampp具有PHP 5.3,但在线我的托管帐户仅具有PHP 5.2.我可以使用一个适合5.2的好方法吗?
I'm using bcrypt
locally since xampp has PHP 5.3 but online my hosting account only has PHP 5.2. Is there a good alternative I can use which works for 5.2?
推荐答案
我认为我应该更新和改进此答案,因为在最近几年中我学到了很多有关密码哈希的知识.
I think i should update and improve this answer, because i learned a lot about password hashing in the last years.
PHP 5.5版将提供使用BCrypt的便捷方法,对于PHP 5.3.7及更高版本,存在一个兼容包.请查看此答案.
PHP version 5.5 will provide a convenient way to use BCrypt, for PHP version 5.3.7 and above there exist a compatibility pack. Please have a look at this answer.
对于5.3之前的PHP版本,建议使用 phpass 库,它们支持PHP返回到版本3.
For PHP versions before 5.3 it is recommended to use the phpass library, they support PHP back to version 3.
这篇关于在PHP 5.2中保存密码时bcrypt的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!