PHP で bcrypt/blowfish を使用しています。コスト パラメータを $10 (1024 ラウンドだと思います) に設定すると、暗号化プロセスに 0.1 秒かかります。$12 に設定すると、0.3 秒かかります。私の質問は次のとおりです。これは 0.3 秒の CPU 時間を占めていますか?つまり、100 人のユーザーがこのプロセスを実行している場合、全員が 30 秒 (0.3 x 100) 待たなければなりませんか? (編集: dual0core/マルチスレッド処理のために短くなる可能性がありますが、10 秒でも許容できません)。
また、このコスト パラメータをオンにしておくのに適した値はどれですか? $16 を推奨する人もいますが、私のサイト (大規模な Web ホストがホスト) では 5 秒以上かかります。
ちなみに、次のコードを使用して所要時間を確認しています。
<?php
// set a password to work with
$var1 = "doodoo1234";
//echo that password onto the screen
echo $var1 . "<br /><br />";
//Start the clock
$time_start = microtime(true);
//Run blowfish function to encrypt the password
$hashedpass = PassHash::blowfishhash($var1);
//stop the clock
$time_end = microtime(true);
//echo the password to the screen
echo $echohashedpass . "<br /><br />";
//Echo the length of the encrypted password to the screen
//(this taught me that blowfish always returns a 60 varchar string)
echo strlen($sajpass). "<br /><br />";
$time = $time_end - $time_start;
echo "that took $time seconds\n";
?>