One-Time Password (OTP)

A one-time password (OTP) is a short code that works for a single login or a short time, sent by text or email or generated by an authenticator app or token. It's a common second factor, but it can be phished.

BeginnerCategory: Passwords, authentication and identity

Also called: OTP, one-time passcode, verification code, TOTP, 2FA code

What is a one-time password?

A one-time password is a code, usually six digits, that can be used only once or only for a short window. Because it changes every time, a stolen code quickly becomes useless, which makes it a popular second factor for MFA.

How do one-time passwords work?

  • SMS and email codes: the service generates a code and sends it to you.
  • Authenticator app codes (TOTP): your phone and the service share a secret set up when you scan a QR code. Both use it with the current time to calculate the same code every 30 seconds, as defined in the IETF's TOTP standard. No message needs to be sent.
  • Hardware tokens: small devices that display a new code at the press of a button or on a timer.

Weaknesses

CISA notes that OTP-based MFA can still be phished: a fake login page can ask for the code and pass it to the real site within seconds. SMS codes are the weakest, since they can be intercepted through SIM swapping or tricked out of people by phone.

Best practice for businesses

Prefer authenticator app codes over SMS, never share a code with anyone who contacts you, and move high-risk accounts to phishing-resistant options like passkeys or security keys.

Related terms

Sources

  1. RFC 6238: TOTP: Time-Based One-Time Password Algorithm (IETF)
  2. Implementing Phishing-Resistant MFA (CISA)

Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.