mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix compatibility with PBKDF2 hashes with iteration counts that are not zero-padded
This commit is contained in:
parent
715e8d781c
commit
72e7532764
2 changed files with 12 additions and 3 deletions
|
|
@ -128,6 +128,13 @@ class PasswordTest extends \Codeception\TestCase\Test
|
|||
$salt = 'rtmIxdEUoWUk';
|
||||
$hash = 'sha512:0016384:rtmIxdEUoWUk:1hrwGP3ScWvxslnqNFqyhM6Ddn4iYrwf';
|
||||
$this->assertEquals($hash, Rhymix\Framework\Password::pbkdf2($password, $salt, 'sha512', 16384, 24));
|
||||
|
||||
$hash = 'sha512:16384:rtmIxdEUoWUk:1hrwGP3ScWvxslnqNFqyhM6Ddn4iYrwf';
|
||||
$this->assertEquals($hash, Rhymix\Framework\Password::pbkdf2($password, $salt, 'sha512', 16384, 24, 5));
|
||||
|
||||
$salt = 'KpnA8ZAxvig32n7p2PnEjx4NN7gPpUQm';
|
||||
$hash = 'sha1:12000:KpnA8ZAxvig32n7p2PnEjx4NN7gPpUQm:TeILMSF8ao/NVJ4wdk7lXDKQre9TUCht';
|
||||
$this->assertEquals($hash, Rhymix\Framework\Password::pbkdf2($password, $salt, 'sha1', 12000, 24, 5));
|
||||
}
|
||||
|
||||
public function testCountEntropyBits()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue