Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A one-time password is a code valid for a single use or a short window. TOTP generates it from a shared secret and the clock; SMS delivery is the weakest variant.

What Is a One-Time Password?
A one-time password is a short numeric code that works once, or for a window of thirty seconds, and then becomes useless. It is the most widely deployed second factor in the world, and also the one that security teams are now trying to move away from. Both facts are worth understanding.
HOTP, defined in RFC 4226, derives a code from a shared secret and a counter. Each use increments the counter on both sides. Because clients and servers drift out of step when a user generates codes without submitting them, servers accept a small look-ahead window.
TOTP, defined in RFC 6238, replaces the counter with the current time divided into intervals, normally thirty seconds. Both sides compute an HMAC over the secret and the interval number, truncate the result, and take six digits. No synchronisation message is ever exchanged; the clock does the work. That is why a code generated by an authenticator app on a flight with no signal still works.
The secret arrives during enrolment, usually in a QR code encoding an otpauth:// URI. From that moment both the server and the device hold the same shared secret, which is the structural difference between this and the key-pair model used by FIDO2: a shared secret exists in two places and can be stolen from either.
| Method | Main weakness | Assessment |
|---|---|---|
| SMS | SIM swapping, SS7 interception, malware reading messages | Weakest; better than nothing |
| Voice call | Call forwarding, voicemail interception | Comparable to SMS |
| Inherits the security of the mailbox being protected | Avoid where the account is the mailbox | |
| Authenticator app | Phishable in real time; device compromise | Reasonable default |
| Hardware token | Phishable in real time; loss | Good where apps are not permitted |
SMS deserves specific comment because it is still the default in UK retail banking and e-commerce. SIM swapping transfers a victim’s number to an attacker’s device through social engineering of the mobile operator, after which every code arrives at the attacker. NIST removed SMS as a recommended out-of-band authenticator from SP 800-63B in 2016, and the NCSC’s guidance treats it as the lowest tier of multi-factor authentication—acceptable where the alternative is a password alone, not acceptable for privileged access.
Whatever the delivery, the code is a value the user types into a page. If the page belongs to an attacker, the code goes to the attacker, who relays it to the real site within its validity window.
This is not theoretical or difficult. Phishing kits such as Evilginx and EvilProxy operate as transparent reverse proxies: the victim sees the genuine site because the proxy is serving the genuine site, enters their password and their code, and the proxy forwards both and keeps the resulting session cookie. The second factor was satisfied correctly by a real user. Phishing-as-a-service platforms sell this capability for a monthly fee.
A one-time password therefore raises the cost of credential stuffing and password spraying substantially—which is real value, and why it is still worth deploying—but it does not resist targeted phishing. Only origin-bound authentication does, which is the argument for passkeys and security keys for anything that matters.
Where you are keeping one-time passwords, keep them as the fallback rather than the primary, and remove SMS from privileged accounts first. Where you are replacing them, the sequence that works is phishing-resistant factors for administrators, then staff, with codes retained only for the systems that cannot yet support anything better. For a wider view of how factors compare, see multi-factor authentication.
At Privia Security, we test authentication flows including real-time relay phishing through our penetration test services.
HOTP derives each code from a counter that increments with every use, so client and server can drift apart and the server accepts a look-ahead window. TOTP derives the code from the current time divided into thirty-second intervals, so no synchronisation messages are needed and codes expire on their own. Almost every authenticator app you will meet uses TOTP.
It is better than a password alone and worse than everything else. SIM swapping, interception, and malware that reads messages all target it, and NIST withdrew its recommendation in 2016. Use it where nothing else is available for consumer accounts, but never for administrative access, and prioritise replacing it on any account with financial or privileged reach.
Yes, routinely. A reverse proxy phishing kit presents the genuine site to the victim, captures the password and the code as they are typed, relays both within the validity window, and keeps the resulting session. The user did everything correctly. Only origin-bound authentication such as FIDO2 or passkeys prevents this, because no value is typed that an attacker can forward.
Few. A six-digit code has a million possibilities, so without rate limiting an attacker can simply guess within the validity window. Lock the attempt after around five failures, count failures across the whole authentication session rather than per code issued, and alert on accounts hitting the limit repeatedly, which is a reliable sign of an automated attempt.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.