3 ms·
On real systems, TOTP secrets are long random strings (the Golang TOTP library, for instance, draws 20 random bytes from urandom). You can't brute-force them.
by tptacek 8y ago
On real systems, TOTP secrets are long random strings (the Golang TOTP library, for instance, draws 20 random bytes from urandom). You can't brute-force them.
There are libraries (looking at you, Ruby) with interfaces that ask callers for secrets, and have demo code passing intelligible strings through. You don't need hashcat to know the problem there. There is no reason at all for a TOTP secret to be anything but 128+ bits of cryptographic randomness.
- floatingatoll 8y agoOperator error is a possible reason for a TOTP secret to be inappropriately brief.
- DoctorOW 8y agoMaybe if you count the webapp programmer as the operator. For something like 2FA the end user doesn't pick the secret.
- ovi256 8y agoThe app programmer is definitely considered as an user (or operator) of cryptography libraries. That's what the "user misuse-resistant" best practice is all about: designing tools robust to wider levels of user expertise.
- floatingatoll 8y agoYep, I do.
- CiPHPerCoder 8y agoI've yet to discover a 2FA implementation where the TOTP secret was human-sourced. A language without a secure RNG (e.g. PHP before 7.0, unless you have the right extensions enabled) might be a source of concern, but that's relatively rare.
- m-p-3 8y agoLast time I've setup TOTP for my Dropbox account, the secret key was 26 characters long.