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)
This commit is contained in:
Matthijs
2023-11-17 13:53:13 +01:00
committed by GitHub
parent ab93dd41ce
commit d996779182
+1 -1
View File
@@ -51,7 +51,7 @@ class TwoFactorAuth
/**
* Create a new secret
*/
public function createSecret(int $bits = 80, bool $requirecryptosecure = true): string
public function createSecret(int $bits = 160, bool $requirecryptosecure = true): string
{
$secret = '';
$bytes = (int)ceil($bits / 5); // We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32)