What is a one-time password (OTP)?
A one-time password is a short code that is valid for a single login or action, sent by SMS or email or made by an authenticator app, and used as a second factor.
Also called: OTP, one-time passcode, verification code
How it works
An OTP proves that the user holds a phone, an inbox or a device. It is often one part of multi-factor authentication, or a check before a risky action.
- SMS OTP: the service texts a code to the user's phone number.
- Email OTP: the code or a link goes to the user's email address.
- TOTP: an authenticator app makes a time-based code from a secret shared at setup, so nothing is sent over the network at login.
Weaknesses
OTPs are better than a password alone, but attackers have many ways around them. Because the user types the code into a page, it can be stolen as easily as a password.
- SIM swap: an attacker moves the victim's number to a new SIM and receives the codes. See SIM swap.
- Interception: malware on the phone, or weaknesses in the phone network, can expose SMS codes.
- Phishing relay: a fake login page passes the victim's password and OTP to the real site in real time.
- OTP bots: automated calls that pose as the bank and ask the victim to read out the code.
- SMS pumping: fraudsters trigger many OTP texts to premium numbers they profit from, so the service pays the toll.
Example
A hypothetical customer gets a call that seems to come from their bank. A recorded voice says a payment needs to be stopped and asks for the code just sent by text. The code was triggered by an attacker who has the password, and reading it out completes the takeover.
How teams make OTPs safer
Teams prefer TOTP or, better, a passkey, which cannot be typed into a fake page. Where SMS stays, they rate limit OTP requests per number and region, block premium-rate ranges, explain in the message what the code is for, and check device and network risk before trusting a correct code.
Related terms
- Multi-factor authentication (MFA)Multi-factor authentication (MFA) requires two or more different kinds of proof to log in or approve an action, such as something you know, something you have, and something you are.
- SIM swapA SIM swap is when a fraudster gets a mobile carrier to move a victim's phone number to a SIM they control, so they receive the victim's calls, texts and one-time codes.
- PasskeyA passkey is a login credential based on public-key cryptography that replaces a password. It is stored on the user's device or password manager and unlocked with a biometric or PIN.
- Step-up authenticationStep-up authentication asks a user for an extra proof of identity only when an action or session looks risky, instead of asking every user for the same checks every time.
- Account takeover (ATO)Account takeover is when someone other than the owner gains control of a real user's account, usually with stolen credentials, and uses it to steal money, data or rewards.