<?php
$passwords = [
'Password123LOLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabfjhys' => '3e!-uh5Cxkk!6btWU5?R',
'Password123LOLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaruobbk' => '1ed+&$U( n=^K.`R"x(L',
'Password123LOL!aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapnbggv' => 'ZD7<t,=B&_l?#u:K$!f*',
'Password123LOL!aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdiappm' => 'K6G_hA21;kKX$ 4?!z6.',
];
$i = 1000;
foreach ($passwords as $long => $short) {
$s = random_bytes(16);
$h1 = hash_pbkdf2('sha1', $long, $s, $i);
$h2 = hash_pbkdf2('sha1', $short, $s, $i);
var_dump(hash_equals($h1, $h2));
}
preferences:
38.39 ms | 407 KiB | 5 Q