Re:How does Google Authenticator work?
by loloquwowndueo on Friday August 27, 2021 @02:48PM
(#28331569)
There’s even a program called oathtool which you can use to generate TOTP and HOTP (counter-based and much more prone to skew) codes. You just need the random seed that’s generated when you create a device. I’m not sure how easy it is to extract from the qrcode that web services generate, though. Some identity providers will show the raw random seed.
[ Parent
| on HN ]
oathtool -w1 --base32 --totp $secret
Add a space before the command depending on your shell. Some shells will keep your secret out of history logs.It's pretty easy to extract! zbarimg -q -raw <png> will do it.
http://manpages.ubuntu.com/manpages/bionic/man1/zbarimg.1.ht...
https://github.com/google/google-authenticator/wiki/Key-Uri-...
That's the format that gets encoded into the QR code. If you can decode the QR code you can get the secret key easily.