Time-Based One-Time Password
A Time-Based One-Time Password (TOTP) is a temporary numeric code used to help verify a user's identity during login. The code is generated from a secret shared between the user's device or app and the service, combined with the current time, so it changes at regular intervals (commonly every 30 seconds). Because each code is short-lived, it provides better protection than a static password even if a code is intercepted.
TOTP is an algorithm that generates a short-lived one-time password (OTP) from a shared secret key and the current time as the source of uniqueness, defined by RFC 6238. In typical deployments, the authenticator (for example a mobile app such as Google Authenticator) and the verifying server hold the same shared secret and independently compute the OTP for the current time step (often a 30-second window), authenticating the user when the values match; servers commonly permit a small tolerance for clock drift depending on configuration. As an authentication mechanism, TOTP represents a possession factor, the holder of the seeded device or app, and is frequently used as a second factor within MFA. Scope note: TOTP addresses authentication (verifying identity) only and does not by itself address authorization; the strength of the shared-secret model and its resistance to phishing differ from cryptographic protocols such as FIDO2/WebAuthn, which are out of scope for this term.
Why it matters
TOTP is one of the most widely deployed second factors in multi-factor authentication because it raises the cost of credential-based attacks without requiring specialized hardware. A static password, once phished or leaked, can be reused indefinitely; a TOTP code is valid only for a short time step (commonly 30 seconds), so an intercepted or reused code typically expires quickly. This short lifespan is the core value: it narrows the window in which a stolen code is useful and adds a possession factor on top of the knowledge factor a password represents.
At the same time, IAM teams should be precise about what TOTP does and does not protect against. Because verification depends on a shared secret held by both the authenticator and the server, TOTP does not provide the cryptographic, origin-bound protection of protocols such as FIDO2/WebAuthn (which are out of scope for this term). A user can still be induced to enter a valid code into a fraudulent site or relay it to an attacker in real time, so TOTP is more resistant to password replay than to real-time phishing and social-engineering attacks. Its shared-secret model also means the seed must be protected during enrollment and at rest on both endpoints.
Understanding these boundaries matters when choosing where TOTP fits in an authentication strategy. In many deployments it is a pragmatic, low-friction improvement over passwords alone, but its assurance level should be weighed against phishing-resistant alternatives depending on the risk profile of the resource being protected.
Who it's relevant to
Inside TOTP
Common questions
Answers to the questions practitioners most commonly ask about TOTP.
