AltF Authenticator
RFC 6238 TOTP test vectors
RFC 6238 Appendix B lists 18 reference values: six times, each computed with HMAC-SHA-1, SHA-256 and SHA-512, as 8-digit codes with a 30-second step. The self-test runs all 18 through the same code that makes your live codes and shows pass or fail. Use the table below to check your own TOTP implementation.
- Free, no sign-up
- Secrets stay in your browser
- RFC 6238 self-test built in
- Works on mobile
Seeds and settings
- SHA-1 seed: the 20 ASCII bytes "12345678901234567890".
- SHA-256 seed: the 32 ASCII bytes "12345678901234567890123456789012".
- SHA-512 seed: the 64 ASCII bytes "1234567890123456789012345678901234567890123456789012345678901234".
- T0 = 0, step X = 30 seconds, 8 digits.
Expected codes
- Time 59: SHA-1 94287082, SHA-256 46119246, SHA-512 90693936.
- Time 1111111109: SHA-1 07081804, SHA-256 68084774, SHA-512 25091201.
- Time 1111111111: SHA-1 14050471, SHA-256 67062674, SHA-512 99943326.
- Time 1234567890: SHA-1 89005924, SHA-256 91819424, SHA-512 93441116.
- Time 2000000000: SHA-1 69279037, SHA-256 90698825, SHA-512 38618901.
- Time 20000000000: SHA-1 65353130, SHA-256 77737706, SHA-512 47863826.
Common reasons a test fails
- Using the 20-byte seed for SHA-256 and SHA-512. The RFC's tables use longer seeds for those hashes, as listed above.
- Reading the seeds as Base32. They are ASCII bytes. In Base32 the SHA-1 seed is GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ.
- Writing the counter as 4 bytes or little-endian. It must be 8 bytes, big-endian.
- Overflow at time 20000000000. The counter is 0x27BC86AA, which needs more than 32-bit signed maths in some languages.
- Dropping leading zeros. The code for 1111111109 with SHA-1 is 07081804, not 7081804.
Why run it in the browser?
If the self-test passes on your device, the HMAC, truncation and counter code in this page is working there. It does not tell you that a service is configured correctly, but it removes the generator as a cause when you are debugging.
RFC 6238 TOTP test vectors: questions and answers
Why are the expected codes 8 digits?
The RFC's reference implementation prints 8 digits so more of the truncated value is checked. Taking the last 6 digits gives the 6-digit code.
Which seed does Appendix B use for SHA-256?
A 32-byte ASCII seed, the digits 1234567890 repeated and cut to 32 characters. SHA-512 uses 64 bytes in the same way.
What time step does time 59 use?
floor(59 / 30) = 1, so the counter is 0000000000000001.
Why do my SHA-256 results differ from the table?
The table's SHA-256 and SHA-512 values come from the 32 and 64-byte seeds used in the RFC's reference code. If you use the 20-byte seed for those hashes, your codes will not match.
Authenticator tools and 2FA guides
Guides
AltFTool never receives your secrets or codes. The only network request any tab makes is the clock check, which asks AltFTool's server for the time and carries nothing else.