Skip to content

Commit dfc1124

Browse files
authored
Merge pull request #117 from Mattie112/patch-1
Changed default secret length from 80bits to 160bits as recommended by RFC4226
2 parents b909cb3 + d4a5026 commit dfc1124

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
@@ -52,7 +52,7 @@ public function __construct(
5252
/**
5353
* Create a new secret
5454
*/
55-
public function createSecret(int $bits = 80): string
55+
public function createSecret(int $bits = 160): string
5656
{
5757
$secret = '';
5858
$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)