Skip to content

Commit

Permalink
update getDerviedk
Browse files Browse the repository at this point in the history
  • Loading branch information
Stricted committed Aug 21, 2015
1 parent fd8be47 commit c182759
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/trait/Login.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ private function getDerviedk ($password) {
// calculate derivedk
if (!function_exists('hash_pbkdf2')) {
$pbkdf2 = new CryptLib\Key\Derivation\PBKDF\PBKDF2(array('hash' => 'sha1'));
$derivedk = bin2hex($pbkdf2->derive(hash('sha256', $password), substr($this->challenge, 0, 16), 1000, 32));
$derivedk = substr($derivedk, 0, 32);
$derivedk = bin2hex($pbkdf2->derive(hash('sha256', $password), substr($this->challenge, 0, 16), 1000, 16));
}
else {
$derivedk = hash_pbkdf2('sha1', hash('sha256', $password), substr($this->challenge, 0, 16), 1000, 32);
Expand Down

0 comments on commit c182759

Please sign in to comment.