用来在php中加密密码的功能? [英] functions used to encrypt password in php?
本文介绍了用来在php中加密密码的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编程一个允许用户注册的PHP站点,我正在使用codeigniter php,并且我想知道加密密码的最佳功能 和该功能有什么区别?
I am programming a PHP site that allows users to register,I'm using codeigniter php and I want to know the best function to encrypt passwords and what difference between this function?
推荐答案
密码几乎永远不会被加密.相反,它们应该是单向散列的.
Passwords should almost never be encrypted. Instead, they should be one-way hashed.
通常,建议使用 bcrypt ,因为它可以防止暴力破解,这是常见的替代方法像md5
或sha1
一样失败.
Generally, bcrypt is recommended, as it's resistant to brute forcing, where common alternatives like md5
or sha1
fail.
这篇关于用来在php中加密密码的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文