Perlコーディング初心者質問スレ Part 50
■ このスレッドは過去ログ倉庫に格納されています
0092nobodyさん
2006/06/30(金) 12:01:59ID:???cryptの戻り値(digest)にはsaltの情報も含まれているのであとで確認したいときは
それをsaltとしてそのまま食わせればいいことになっている。
When verifying an existing digest string you should use the digest as the salt (like
"crypt($plain, $digest) eq $digest"). The SALT used to create the digest is visible as part of
the digest. This ensures crypt() will hash the new string with the same salt as the digest.
This allows your code to work with the standard crypt and with more exotic implementations. In
other words, do not assume anything about the returned string itself, or how many bytes in the
digest matter.
■ このスレッドは過去ログ倉庫に格納されています