Merge pull request #117 from Mattie112/patch-1

Changed default secret length from 80bits to 160bits as recommended by RFC4226
This commit is contained in:
Rob Janssen
2024-04-17 20:46:47 +02:00
committed by GitHub
+1 -1
View File
@@ -52,7 +52,7 @@ class TwoFactorAuth
/**
* Create a new secret
*/
public function createSecret(int $bits = 80): string
public function createSecret(int $bits = 160): string
{
$secret = '';
$bytes = (int)ceil($bits / 5); // We use 5 bits of each byte (since we have a 32-character 'alphabet' / BASE32)