mirror of
https://github.com/itflow-org/itflow
synced 2026-07-23 08:50:42 +00:00
Replace srand()/rand() with random_int() for cryptographically secure, unbiased key generation. The previous implementation seeded rand() from microtime(), making TOTP secrets predictable if the generation time could be approximated. Also removes modulo bias and dead while(1) wrapper. Output format is unchanged: 32 chars from the base32 alphabet (A-Z, 2-7), so existing TOTP enrollments are unaffected.
8.9 KiB
8.9 KiB