我使用SHA1功能來存儲我在MySQL數據庫密碼..基本MySQL的SHA1密碼有效入住
$passwordHash = sha1($password);
從谷歌我得到這個 從用戶註冊
sha1(sha1(users_plaintext_password)+random string)
檢查
server computes sha1(users_hashed_password_in_database +
$_SESSION['random_string'])
if $_POST['password'] ==
sha1(users_hashed_password_in_database + $_SESSION['random_string'])
我的問題是如何檢查驗證?這是正確的方法?並且使用一些隨機字符串作爲鹽給我的密碼更多的保護?
http://php.net/faq.passwords – hakre 2013-04-23 19:13:01
[Secure hash and salt爲PHP密碼](http://stackoverflow.com/questions/401656/secure-hash-and-salt-for-php-passwords) – 2013-05-11 11:51:55