Skip to content

Commit d996779

Browse files
authored
Changed default secret bits from 80 to 160 as recommended by RFC4226
https://www.ietf.org/rfc/rfc4226.txt (and TOTP refers to RFC4226, see https://www.ietf.org/rfc/rfc6238.txt)
1 parent ab93dd4 commit d996779

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/TwoFactorAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
/**
5252
* Create a new secret
5353
*/
54-
public function createSecret(int $bits = 80, bool $requirecryptosecure = true): string
54+
public function createSecret(int $bits = 160, bool $requirecryptosecure = true): string
5555
{
5656
$secret = '';
5757
$bytes = (int)ceil($bits / 5); // We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32)

0 commit comments

Comments
 (0)