Created
January 16, 2015 01:13
-
-
Save sarciszewski/a3b1cf19caab3f408bf8 to your computer and use it in GitHub Desktop.
PBKDF2 Benchmarking Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$it = [ 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000, 256000, 512000, 1024000, 2048000, 4096000 ]; | |
foreach ($it as $i) { | |
$st = microtime(true); | |
$c = \hash_pbkdf2( | |
'sha256', | |
'example of a simple plaintext message goes here', | |
'something silly', | |
$i, | |
32, | |
true | |
); | |
$en = microtime(true); | |
$elapsed = number_format( $en - $st, 3); | |
echo "{$i}\t{$elapsed}\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment