Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is a One-Time Password?

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.

Illustration for the cybersecurity term One-Time Password
Home / Blog / Cybersecurity Terms / What Is a One-Time Password?
17 November 2026

What Is a One-Time Password?

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.

Two Algorithms, One Idea

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.

The Delivery Method Decides the Risk

MethodMain weaknessAssessment
SMSSIM swapping, SS7 interception, malware reading messagesWeakest; better than nothing
Voice callCall forwarding, voicemail interceptionComparable to SMS
EmailInherits the security of the mailbox being protectedAvoid where the account is the mailbox
Authenticator appPhishable in real time; device compromiseReasonable default
Hardware tokenPhishable in real time; lossGood 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.

The Flaw All One-Time Passwords Share

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.

Implementing It Properly

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.

FAQ – Frequently Asked Questions

What Is the Difference Between HOTP and TOTP?

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.

Is SMS Good Enough as a Second Factor?

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.

Can a One-Time Password Be Phished?

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.

How Many Attempts Should We Allow?

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.

Related Terms

You May Be Interested In These

How Do You Acquire a Memory Dump?

Cybersecurity Terms

17 November 2026

How Do You Acquire a Memory Dump?

Read More
What Is Sweet32?

Cybersecurity Terms

17 November 2026

What Is Sweet32?

Read More
What Is PwnKit?

Cybersecurity Terms

17 November 2026

What Is PwnKit?

Read More