PHP.net says that md5() and sha1() unsuitable for password?

前端 未结 5 1606
春和景丽
春和景丽 2021-01-27 16:09

http://www.php.net/manual/en/faq.passwords.php#faq.passwords.fasthash

I\'m storing user passwords in a MySQL database in hash form. Does this mean that it is unsafe to d

5条回答
  •  后悔当初
    2021-01-27 16:50

    Has been answered many times before. You can use something like SHA-256 http://php.net/manual/en/function.hash.php but you should also salt the password before hashing it and you can iteratively hash the password - so in the unlikely event it is cracked it will only reveal another hash (in other words, cracking the password takes much longer).

提交回复
热议问题