Skip to content

Commit bc0f81d

Browse files
committed
Passwords: BCRYPT changed to default algorithm
1 parent 8647df3 commit bc0f81d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Security/Passwords.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function hash(string $password, array $options = []): string
2828
throw new Nette\InvalidArgumentException("Cost must be in range 4-31, $options[cost] given.");
2929
}
3030

31-
$hash = password_hash($password, PASSWORD_BCRYPT, $options);
31+
$hash = password_hash($password, PASSWORD_DEFAULT, $options);
3232
if ($hash === false || strlen($hash) < 60) {
3333
throw new Nette\InvalidStateException('Hash computed by password_hash is invalid.');
3434
}
@@ -50,6 +50,6 @@ public static function verify(string $password, string $hash): bool
5050
*/
5151
public static function needsRehash(string $hash, array $options = []): bool
5252
{
53-
return password_needs_rehash($hash, PASSWORD_BCRYPT, $options);
53+
return password_needs_rehash($hash, PASSWORD_DEFAULT, $options);
5454
}
5555
}

0 commit comments

Comments
 (0)