PHP.netで、MD5は役に立たないことを読みました。彼らは、crypt+saltの使用を提案しています。
それで、私は彼らの関数の説明に行き、読んだ
<?php
$password = crypt('mypassword'); // let the salt be automatically generated
/* You should pass the entire results of crypt() as the salt for comparing a
password, to avoid problems when different hashing algorithms are used. (As
it says above, standard DES-based password hashing uses a 2-character salt,
but MD5-based hashing uses 12.) */
if (crypt($user_input, $password) == $password) {
echo "Password verified!";
}
?>
または私の場合は次のようなものです:
$stored_password=fetch_password($user);
if (crypt($_REQUEST['password'],$stored_password)===$stored_password) {
// ok
}
したがって、saltがハッシュ化されたパスワードに保存されており、そのハッシュ化されたパスワードをsaltとして使用していることを確認すると、Crypt + Saltは、出力に対するブルートフォース(ハッシュ化されたパスワードを盗むことができたハッカー)に対してより安全ではないと思います。より安全ですか?
辞書攻撃に対しては、その力は理解できますが、ハッシュ化されたパスワードに対するブルートフォース攻撃の場合、その利点はわかりません。