2FA code generator (TOTP)
Make the 6 or 8 digit two factor codes an authenticator app shows, from a secret key, an otpauth:// link or a QR code image.
Questions
Is it safe to paste my 2FA secret here?
The secret stays on this page: codes are computed with your browser's WebCrypto HMAC and nothing is sent or saved. Still, anyone who has the secret can make your codes forever, so do not paste it on a shared or public computer, and close the tab when you are done.
How are the codes made?
With TOTP, RFC 6238: the current Unix time divided by the period (usually 30 seconds) is the counter, it is signed with HMAC using your secret (SHA-1 by default, or SHA-256 or SHA-512), and the result is cut down to 6 or 8 digits as in HOTP, RFC 4226. The page is tested against every test vector in RFC 6238.
Why does my code not match?
TOTP depends on the clock. If your device clock is off by more than a few seconds the code will differ, so turn on automatic time. Also check the algorithm, digits and period: most services use SHA-1, 6 digits and 30 seconds.
Does the QR reader upload the image?
No. The QR code is decoded in a background worker with ZXing compiled to WebAssembly, downloaded once from HelpyTools (about 0.9 MB).