You can harden security by generating larger secret keys or adding a prefix.
Key Length: In v9.0.0+, the default length is 32 bytes. You can specify a custom length (e.g., 16 bytes for v8.x compatibility).
Prefixes: You can prefix secret keys, but the total length must remain a power of 2. Because prefixes are converted to base 32, the maximum prefix length is 10 bytes. Valid prefix sizes are 1, 2, 5, 10, 20, 40, 80....
// Custom length
$secretKey = $google2fa->generateSecretKey(32);
$secretKey = $google2fa->generateSecretKey(16);
// Using a prefix
$prefix = strpad($userId, 10, 'X');
$secretKey = $google2fa->generateSecretKey(16, $prefix);