How TOTP two-factor codes work and why your code may be rejected
TOTP, or time-based one-time passwords defined in RFC 6238, generates the six-digit codes used by apps like Google Authenticator. A shared secret, typically delivered through a QR code during enrollment, is combined with the current time divided into 30-second intervals and processed with HMAC-SHA1 to produce the code. Because the calculation depends only on the secret and the clock, the same code appears on any device without a network connection. Codes are commonly rejected because of clock drift beyond the server's tolerance, mismatched parameters such as hash algorithm or digit count, or typing errors in a manually entered key. The author also released Code2FA, an open-source browser tool with a clock-checking feature that computes codes locally.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in