How and Why to Hash Passwords in PHP(phpsec.org)
phpsec.org
How and Why to Hash Passwords in PHP
http://phpsec.org/articles/2005/password-hashing.html
3 comments
yikes, a php security site telling people to use sha1().
don't use sha1 hashes for storing passwords, use bcrypt. http://www.openwall.com/phpass/
or a quick code snippet:
don't use sha1 hashes for storing passwords, use bcrypt. http://www.openwall.com/phpass/
or a quick code snippet:
for ($salt = "", $x = 0; $x++ < 40; $salt .= chr(mt_rand(0,255)))
;
$hashed = crypt($password, '$2a$08$' . hash("whirlpool", $salt));I hope this article is really old...at least then the author can claim ignorance.
phpsec should update this article with a more secure example.
phpsec should update this article with a more secure example.
I'm personally confused by this comment:
So.. if you know it's not recommended, why even include an example of it?