svn: /phpdoc/en/trunk/reference/password/functions/ password-hash.xml

From: Date: Wed, 10 Sep 2014 15:41:21 +0000
Subject: svn: /phpdoc/en/trunk/reference/password/functions/ password-hash.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-12797@lists.php.net to get a copy of this message
ircmaxell Wed, 10 Sep 2014 15:41:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=334834 Log: Update password_hash documentation to recommend <= 100 ms hash times, including adjusting the cost-finding script. Changed paths: U phpdoc/en/trunk/reference/password/functions/password-hash.xml Modified: phpdoc/en/trunk/reference/password/functions/password-hash.xml =================================================================== --- phpdoc/en/trunk/reference/password/functions/password-hash.xml 2014-09-10 15:32:42 UTC (rev 334833) +++ phpdoc/en/trunk/reference/password/functions/password-hash.xml 2014-09-10 15:41:21 UTC (rev 334834) @@ -216,12 +216,13 @@ /** * This code will benchmark your server to determine how high of a cost you can * afford. You want to set the highest cost that you can without slowing down - * you server too much. 10 is a good baseline, and more is good if your servers - * are fast enough. + * you server too much. 8-10 is a good baseline, and more is good if your servers + * are fast enough. The code below aims for ≤ 50 milliseconds stretching time, + * which is a good baseline for systems handling interactive logins. */ -$timeTarget = 0.2; +$timeTarget = 0.05; // 50 milliseconds -$cost = 9; +$cost = 8; do { $cost++; $start = microtime(true); @@ -236,7 +237,7 @@ &example.outputs.similar; <screen> <![CDATA[ -Appropriate Cost Found: 11 +Appropriate Cost Found: 10 ]]> </screen> </example> @@ -253,9 +254,9 @@ </caution> <note> <para> - It is recommended that you test this function on your servers, and adjust the cost - parameter so that execution of the function takes approximately 0.1 to 0.5 seconds. The script - in the above example will help you choose a good cost value for your hardware. + It is recommended that you test this function on your servers, and adjust the cost parameter + so that execution of the function takes less than 100 milliseconds on interactive systems. + The script in the above example will help you choose a good cost value for your hardware. </para> </note> <note>

« previous php.doc.cvs (#12797) next »