A one-time password (OTP), also known as a one-time PIN, is a temporary passcode valid for only a single use or short time window during authentication, typically generated by a device or software application to verify a user's identity on a computer system, network, or digital service.[1] Unlike static passwords, OTPs are designed to mitigate risks such as replay attacks and eavesdropping, where an intercepted credential cannot be reused effectively.[2] They are commonly employed as a second factor in multi-factor authentication (MFA), requiring possession of a token alongside something the user knows, like a primary password.[3]OTPs originated in the late 1980s as a response to vulnerabilities in traditional password systems transmitted over insecure channels, with early implementations focusing on challenge-response mechanisms to generate unique codes.[4] The S/KEY system, introduced in the early 1990s, popularized the concept by using a one-way hash function to produce a sequence of disposable passwords from a secret seed, countering passive network attacks.[2] Subsequent standardization efforts by the Internet Engineering Task Force (IETF) led to widely adopted algorithms, including the HMAC-based one-time password (HOTP) in 2005, which relies on a shared counter to synchronize code generation between the user's device and the verifier.[5]Building on HOTP, the time-based one-time password (TOTP) algorithm, specified in 2011, became the de facto standard for modern OTPs by using the current timestamp instead of a counter, allowing codes to refresh every 30–60 seconds without needing perfect synchronization.[6] TOTP is implemented in both hardware tokens, such as key fobs that display rotating digits, and software applications on smartphones, often initialized via a QR code containing the shared secret.[3] These systems are integral to secure access for online banking, remote logins, and enterprise networks, though they face challenges like device loss or phishing attempts targeting the OTP delivery channel.[1]
Fundamentals
Definition and Purpose
A one-time password (OTP) is a dynamically generated numeric or alphanumeric code that is valid for only a single authentication attempt or a brief time window, serving as a temporary substitute for traditional static passwords.[7] Unlike fixed credentials, OTPs are automatically produced and expire quickly, ensuring they cannot be reused effectively by unauthorized parties.[8]Key characteristics of OTPs include their single-use validity, which renders them useless after one successful verification, and a short lifespan typically ranging from 30 to 60 seconds for time-based variants, minimizing the opportunity for interception and exploitation.[9] Additionally, OTPs operate independently of long-term shared secrets in their final form, as the code itself is transient and derived from dynamic factors such as time or events, reducing reliance on persistent user knowledge.[10] These features make OTPs particularly suitable for integration into multi-factor authentication (MFA) systems, where they act as a second verification layer alongside something the user knows, like a static password.[11]The primary purpose of OTPs is to bolster security in authentication processes by mitigating common threats associated with static passwords, such as replay attacks where intercepted credentials are reused maliciously.[12] Static passwords, being reusable and unchanging, are highly vulnerable to interception via phishing, keylogging, or network eavesdropping, enabling credential stuffing attacks across multiple services; in contrast, OTPs introduce a time-bound or event-bound element that invalidates captured codes, thereby preventing unauthorized access even if the initial static password is compromised.[13] By adding this dynamic layer, OTPs significantly enhance protection in scenarios like online banking, remote access, and secure logins, reducing the overall risk of account takeovers without requiring users to manage additional long-term secrets.[14]
Historical Development
The concept of one-time passwords (OTPs) emerged in the early 1980s as a response to vulnerabilities in static password systems, particularly the risk of eavesdropping and replay attacks over insecure communication channels. In 1981, computer scientist Leslie Lamport proposed a foundational scheme in his paper "Password Authentication with Insecure Communication," which utilized a chain of one-way hash functions to generate disposable passwords, ensuring that intercepted credentials could not be reused.[15] This theoretical framework laid the groundwork for practical implementations aimed at securing remote access to computer systems. Building on this, the 1983 film WarGames, which depicted a teenager hacking into a military supercomputer, heightened public and governmental awareness of computer security risks; President Ronald Reagan reportedly screened the movie and subsequently directed inquiries into U.S. cybersecurity vulnerabilities, influencing early policy directives in 1984 that accelerated the development of robust authentication technologies.[16]By the mid-1980s, commercial hardware solutions began to materialize, marking the first practical deployment of OTPs. In 1986, Security Dynamics Technologies introduced the RSA SecurID token, a key fob-like device that generated time-synchronized 6-digit codes using a proprietary algorithm and a unique seed value shared with the authentication server, enabling two-factor authentication for network access.[17] Toward the end of the decade, researchers at Bellcore (now Telcordia Technologies) developed S/KEY, a software-based OTP system employing Lamport's hash chain method to produce short, memorable passphrases from a user's secret seed, specifically designed to counter password sniffing on untrusted networks like dumb terminals.[18] These innovations addressed the limitations of reusable passwords, with S/KEY formalized in RFC 1760 in 1995, though its core development occurred in the late 1980s. Early paper-based OTP lists, consisting of pre-generated disposable codes printed for manual entry, also saw limited use in secure communications during this period, offering a low-tech alternative for environments without digital infrastructure.[19]The 1990s witnessed widespread adoption of OTPs, particularly in the banking sector, as online transactions proliferated and financial institutions sought to mitigate fraud risks associated with emerging internet banking. Hardware tokens like RSA SecurID became standard for high-security environments, with more than 16 million authenticators sold by the end of 2003[20] and commanding more than 70% of the two-factor authentication market; banks integrated these for remote access to protect against unauthorized transactions.[17] This era's growth was driven by increasing cyber threats, including the 1994 Citibank hacking incident that highlighted the need for dynamic credentials. Into the 2000s, a shift toward software-based OTPs occurred, spurred by cost efficiencies and the rise of mobile technology; SMS-delivered OTPs gained traction for consumer applications, while standards like HOTP (HMAC-based One-Time Password) were published as RFC 4226 in 2005 by the IETF's OATH initiative, formalizing event-based generation methods derived from earlier hash techniques.[21]Regulatory pressures further propelled OTP evolution post-2000, with the Payment Card Industry Data Security Standard (PCI DSS), introduced in 2004, mandating multi-factor authentication—including OTPs—for protecting cardholder data environments to prevent breaches.[22] By the 2010s, integration with mobile devices transformed delivery, as smartphones enabled app-based generators like Google Authenticator (launched in 2010), reducing reliance on physical hardware and expanding OTP use in everyday online services while enhancing convenience through push notifications and biometric pairing.[17] This progression from cumbersome paper lists and dedicated tokens to ubiquitous software solutions reflected broader advancements in computing accessibility and security needs.
Generation Methods
Time-Synchronized Methods
Time-synchronized methods for generating one-time passwords (OTPs) rely on a shared clock between the authenticator device and the verifying server to produce temporary codes that change at regular intervals. In this approach, both parties maintain synchronized time references, allowing the OTP to be computed independently without requiring direct communication for each generation. The mechanism typically divides the current Unix time by a fixed time step—commonly 30 seconds—to create a moving factor that advances automatically, ensuring each OTP is valid only for a brief window before expiration.[6]The canonical algorithm for time-synchronized OTPs is the Time-based One-Time Password (TOTP), defined as an extension of the HMAC-based One-Time Password (HOTP) framework. TOTP computes the OTP using a pseudorandom function, specifically HMAC-SHA1, applied to a shared secret key K and the current time counter T, followed by dynamic truncation to produce a fixed-length code, usually 6 or 8 decimal digits. The time counter is derived as T = \left\lfloor \frac{\text{Current Unix time} - T_0}{X} \right\rfloor, where T_0 is a reference timestamp (often Unix epoch, January 1, 1970) and X is the time step size, defaulting to 30 seconds; the final OTP is then \text{TOTP}(K, T) = \text{DynamicTruncate}(\text{HMAC-SHA1}(K, T)). This process ensures reproducibility on both sides provided clocks remain aligned within an acceptable tolerance, typically allowing verification against the current interval and one or two adjacent ones to accommodate minor discrepancies.[6]Key components include the pre-shared secret key K, which must be securely provisioned and kept confidential; the synchronized clocks on the token and verifier; and the HMAC-based pseudorandom function to generate unpredictable outputs from the time input. Clock synchronization is critical, as both endpoints must use UTC time and maintain accuracy to within seconds, often enforced through network time protocols like NTP on servers and quartz crystals or GPS on hardware tokens. Without this, validation fails, prompting mechanisms like adjustable drift windows in verifiers.[6]These methods offer simplicity and ease of use, as OTP generation requires no additional user input or event triggering beyond entering the code, making them suitable for frequent authentications. However, they are susceptible to issues like clock drift—where gradual desynchronization occurs due to hardware inaccuracies—potentially leading to authentication failures unless mitigated by tolerant verification windows.[23][6] Unlike event-based methods, time-synchronized approaches eliminate the need for counter synchronization but introduce dependency on reliable timekeeping.[6]
Event-Based Methods
Event-based methods generate one-time passwords (OTPs) by advancing a cryptographic state tied to discrete authentication events, typically using an incrementing counter or a decreasing hash chain. Each subsequent OTP is derived from the prior state through one-way hash functions, ensuring uniqueness and resistance to reversal without the shared secret. This approach produces OTPs on demand for each event, such as a button press or login attempt, without dependency on external timing mechanisms.[5]The HMAC-based One-Time Password (HOTP) algorithm exemplifies this method, as defined in RFC 4226 by the Initiative for Open Authentication (OATH). HOTP employs a shared symmetric secret key K and a 64-bit event counter C maintained by both the authenticator and verifier. The OTP is calculated as follows:\text{HOTP}(K, C) = \text{Truncate}\left( \text{HMAC-SHA-1}(K, C) \right)Here, HMAC-SHA-1 computes a 20-byte hash using the Secure Hash Algorithm (SHA-1), which is then truncated—via dynamic offset extraction and modulo operation—to yield a 6- or 8-digit decimal value suitable for user entry.[5]In operation, the client device increments its counter C upon generating an OTP and transmits it to the server for validation. The server, starting from its stored counter, computes HOTP values for its current C and a limited window of subsequent values (commonly 100 ahead) to detect matches, accommodating minor desynchronization from failed attempts or transmission delays. A successful match prompts the server to update its counter to the client's value plus one, preventing reuse. Resynchronization occurs implicitly through this window; if the client's counter exceeds the window, authentication fails, often requiring administrative intervention or a secondary process to realign counters without exposing the secret.[5][24]Event-based methods like HOTP offer the advantage of eliminating the need for clock synchronization, enabling reliable operation in disconnected or variable-time environments. However, they demand robust counter synchronization and state tracking to mitigate risks such as OTP reuse from stale counters or desynchronization from network issues, potentially complicating large-scale deployments.[5][25]These algorithms are frequently deployed in hardware tokens, which advance the counter via user-initiated events for portable, offline-capable authentication.[26]
Challenge-Response Methods
Challenge-response methods for one-time passwords involve an interactive process where a server issues a unique challenge, typically a random nonce or value, to the client, which then generates a response based on a shared secret key and the challenge to prove authentication without transmitting the secret itself. This approach ensures that each authentication attempt produces a distinct one-time password (OTP), preventing reuse of intercepted values. The mechanism is particularly suited for scenarios requiring real-time verification, such as secure login or transaction signing.[27]The core computation often employs a cryptographic hash-based message authentication code (HMAC) or similar function. For instance, in the OATH Challenge-Response Algorithm (OCRA), the OTP is derived as follows:\text{OCRA} = \text{Truncate}(\text{HMAC-SHA-1}(K, \text{DataInput}))where K is the shared secret key, and \text{DataInput} concatenates elements including the challenge Q, a suite parameter specifying the mode, optional counter C, PIN hash P, session information S, and timestamp T. The truncation typically yields 4 to 10 decimal digits for the OTP. This HMAC-based method ensures the response is unpredictable without the key, even if the challenge is known.[27]Variants of challenge-response OTPs include mutual authentication protocols, where both the client and server exchange challenges to verify each other simultaneously, enhancing bilateral trust. Such extensions appear in systems like Kerberos, where OTP pre-authentication uses a four-pass exchange: the key distribution center (KDC) sends a challenge in a KRB-ERROR message, the client responds with an encrypted nonce using the OTP, and the KDC validates it before issuing tickets. A two-pass variant exists for pre-configured setups, reducing round trips by embedding the response in the initial request. These adaptations support diverse environments without relying on static passwords.[27][28]These methods offer strong protection against eavesdropping and replay attacks, as the response is tied uniquely to the ephemeral challenge and cannot be repurposed from captured traffic. They also enable flexible integration with hardware tokens, where the device receives the challenge via a display or interface and computes the response internally. However, they necessitate synchronous, online communication between parties, which can introduce latency and dependency on network availability, potentially complicating offline or low-bandwidth scenarios.[27][28][1]
Delivery Mechanisms
Hardware-Based Delivery
Hardware-based delivery of one-time passwords (OTPs) involves dedicated physical devices that generate and present OTPs for manual entry by the user during authentication. These devices, often resembling key fobs, smart cards, or USB tokens, incorporate secure embedded chips to compute OTPs independently of external networks, ensuring offline capability and resistance to remote attacks.[29][30]Common types include key fobs, such as the RSA SecurID SID700 series, which are compact, keychain-attachable devices with an LCD screen for displaying codes; smart cards, like the Thales SafeNet OTP Display Card, formatted as credit-card-sized tokens with integrated displays; and USB tokens, exemplified by the YubiKey 5 series, which connect via USB or NFC interfaces.[31][29][32] Each type leverages a tamper-resistant embedded chip—often a secure element or microcontroller—to execute OTP generation algorithms, typically producing 6- to 8-digit numeric codes.[31][33][34]The core functionality relies on cryptographic algorithms run within the device's secure hardware. For instance, RSA SecurID tokens use a proprietary time-synchronized algorithm based on a factory-encoded random seed and internal clock to generate pseudorandom tokencodes that change every 60 seconds. YubiKeys support Yubico OTP, a proprietary protocol that encrypts a combination of public ID, usage counter, session counter, timestamp, and random number using AES-128 to produce a 44-character modhex string for server validation via decryption. YubiKeys also support the standard OATH-HOTP (RFC 4226) protocol.[34] Similarly, SafeNet OTP smart cards adhere to OATH standards (e.g., TOTP per RFC 6238 or HOTP), displaying time- or event-based codes on an LCD without requiring battery replacement for years.[33][29] These chips ensure the generation process is isolated, preventing extraction of secrets even under physical probing.[35]In usage, the device synchronizes with the authentication server via a pre-shared secret seed (for time-based methods) or a counter (for event-based), allowing independent computation of matching OTPs.[6] Users activate the token by pressing a button on key fobs or smart cards to illuminate the LCD and reveal the current code, which is then entered alongside a PIN or username; for USB tokens like YubiKey, insertion into a port followed by a touch gesture emulates keyboard input of the OTP directly into the login field.[33][30] Some models, such as certain RSA variants, support challenge-response modes where the server provides a dynamic challenge via the login prompt, prompting the token to compute a customized response.[36]These hardware tokens offer advantages in security, including tamper-resistant construction that protects against side-channel attacks and physical disassembly, making them suitable for high-security environments.[35] However, they carry risks of loss or theft, necessitating administrative revocation and replacement processes, and incur higher costs—typically $20 to $50 per unit—compared to non-physical alternatives.[33][32]
Software-Based Delivery
Software-based delivery of one-time passwords (OTPs) relies on applications installed on user devices, such as smartphones or computers, to generate authentication codes without requiring dedicated hardware. Common examples include mobile apps like Google Authenticator and Authy, as well as desktop clients such as Authy's Windows and macOS versions. These tools enable users to produce OTPs locally, supporting seamless integration with various online services for multi-factor authentication.[37][38]Setup typically involves scanning a QR code from the authenticating service, which encodes the shared secret key used for code generation. The app then computes OTPs offline using standardized algorithms: Time-based One-Time Password (TOTP) leverages the device's system clock to calculate a time step—usually 30 seconds—and applies the HMAC-SHA-1 function with the secret key to derive a 6- to 8-digit code. In contrast, HMAC-based One-Time Password (HOTP) uses an incrementing counter value, synchronized with the server, to generate codes via the same HMAC process followed by dynamic truncation. This local computation ensures codes are available even without internet access.[37][6][5]These applications incorporate features like multi-account management, where users can store secrets for numerous services in one interface, and security enhancements such as biometric locks (e.g., fingerprint or face ID) to prevent unauthorized access. Backup and transfer capabilities vary: Authy provides encrypted cloud backups secured by a user-defined password, facilitating recovery on new devices without service re-enrollment, while Google Authenticator offers optional cloud synchronization for Android users to export and import accounts. Both support TOTP and HOTP protocols, ensuring broad compatibility.[37][39]The primary advantages of software-based OTP delivery include high convenience, as codes generate instantly on existing devices, and no associated costs beyond the app itself, which is typically free. However, vulnerabilities arise from device compromise; malware on an infected smartphone or computer can capture screen displays of OTPs or access stored secrets, allowing real-time interception during authentication attempts. Such risks underscore the importance of robust device security practices.[40][41][42]These software tools are commonly employed in consumer multi-factor authentication setups to enhance account security for web services.[11]
Network-Based Delivery
Network-based delivery of one-time passwords (OTPs) involves the remote transmission of these temporary codes from an authentication server to a user's registered device over communication networks, typically following an initial authentication step such as entering a username and password. This method relies on out-of-band channels separate from the primary authentication pathway to enhance security by requiring possession of a second factor. The server generates the OTP—often using time-synchronized or event-based algorithms—and dispatches it via protocols suited to the chosen network medium, ensuring the code remains valid only briefly to accommodate transmission delays.[1]Common methods include short message service (SMS), email, and push notifications. In SMS delivery, the server sends a numeric or alphanumeric OTP as a text message to the user's mobile phone number, a process widely adopted due to the ubiquity of cellular networks. For example, financial institutions frequently use SMS to deliver OTPs for transaction approvals, where users receive a six-digit code valid for 30 to 60 seconds. Email delivery operates similarly, transmitting the OTP to a pre-registered email address, often employed in scenarios where mobile access is unavailable or for account recovery. Push notifications, conversely, involve sending an alert to a dedicated mobile application on the user's device, prompting either code display or direct approval without manual entry; services like banking apps utilize this for seamless user verification.[43][1][44]The process begins with the user initiating authentication, after which the verifier (server) authenticates the primary factor and generates the OTP. It then routes the code through the network provider—cellular carriers for SMS, internet service providers for email and push—to the destination device, where the user retrieves and submits it to complete verification. Time synchronization in the underlying OTP algorithm ensures validity during transit, typically allowing a window of 30 seconds or a few attempts. This remote approach provides broad accessibility, as it leverages existing user devices without requiring specialized hardware, making it suitable for large-scale deployments in sectors like finance and e-commerce.[1][43]Despite these advantages, network-based delivery introduces risks due to the exposure of transmission channels. SMS is particularly vulnerable to interception via signaling system 7 (SS7) protocol flaws or SIM-swapping attacks, where attackers hijack the phone number to receive codes. Email transmissions can be compromised if the inbox is accessed illicitly, while push notifications may fall prey to phishing prompts that trick users into approving unauthorized requests. These vulnerabilities have prompted guidelines restricting SMS OTPs to lower assurance levels in sensitive contexts. Overall, while convenient for user adoption—given that over 99% of U.S. adults own mobile phones—the method's security hinges on robust network protections and user awareness.[1][43]
Offline Delivery
Offline delivery methods for one-time passwords rely on physical, non-digital media to provide authentication without requiring networkconnectivity or electronic devices. The primary approaches include printed lists of pre-generated codes and laminated cards featuring sequential one-time passwords, often distributed securely to users in advance. These lists are typically created using cryptographic techniques to ensure uniqueness and resistance to prediction, with each code intended for single use.[1]In the authentication process, the user selects the next unused code from the list—sometimes by scratching off a protective layer on cards—while the verifying server maintains a synchronized record of consumed codes to validate submissions and prevent reuse. Users are advised to dispose of used codes only after successful verification to maintain security. Early implementations, such as the S/KEY system, referenced hash chain origins to generate these lists offline from a shared seed, allowing users to print and carry them for authentication from untrusted locations.[1][45]Historically, printed OTP lists emerged in the 1990s for remote access in unsecured environments, and in modern applications, they serve as emergency access mechanisms in air-gapped systems or low-security backup scenarios, such as recovery codes for account restoration. For instance, some banking institutions provide transaction authentication number (TAN) lists as printed sheets for authorizing transfers without digital tools. These methods are confined to limited-use cases due to their static nature.[45][46]The advantages of offline delivery include simplicity, as no hardware, software, or connectivity is required, making it accessible in remote or disrupted environments. However, significant drawbacks exist: physical lists are vulnerable to theft, loss, or duplication, enabling exhaustive attacks where an adversary could systematically try all codes; additionally, once depleted, the list must be replenished, limiting scalability. NIST guidelines emphasize secure generation and storage to mitigate these risks, but recommend them only for supplemental or low-assurance authentication.[1][47]
Security Considerations
Vulnerabilities and Attacks
One-time password (OTP) systems are susceptible to man-in-the-middle (MITM) attacks, where an adversary intercepts communication between the user and the authentication server to capture the OTP in transit, particularly in unencrypted channels like SMS.[48]Phishing attacks target OTPs by tricking users into entering the code on a fraudulent site, with studies indicating that SMS-based OTPs are highly vulnerable, as 84% of organizations reported phishing incidents in 2022 that could compromise such mechanisms.[49] SIM swapping exploits occur when attackers convince mobile carriers to port a victim's phone number to a new SIM card under their control, enabling them to receive SMS-delivered OTPs and bypass authentication.[50]OTP-specific vulnerabilities include shoulder surfing, where an attacker observes the OTP display on a user's device or hardware token in close proximity, such as in public settings, to steal the code directly.[51] Time desynchronization in time-synchronized OTPs, like TOTP, can be exploited if clocks drift significantly, allowing attackers to predict or brute-force codes within tolerance windows, though implementations often mitigate this with limited retry policies.[52] In the 2020s, notable breaches highlighted these risks; for instance, the 2022 Twilio incident involved social engineering attacks on employees that exposed phone numbers of Authy users, facilitating SIM swaps and subsequent OTP interception for thousands of accounts.[53] In 2024, Twilio disclosed another Authy breach where an unauthenticated API endpoint exposed approximately 33 million user phone numbers, further enabling potential SIM swapping attacks against OTP users.[54]Adversary-in-the-middle (AitM) attacks represent an evolving threat to OTP-integrated flows, such as OAuth, where attackers use proxy servers to intercept and relay authentication sessions in real-time, capturing OTPs and session tokens without alerting the user, thereby bypassing traditional multi-factor protections.[55] Empirical research shows SMS OTP phishing success rates as high as 71% in controlled user studies due to user susceptibility and lack of encryption, underscoring the need for non-phishable alternatives.[48]
Mitigation Strategies
To mitigate vulnerabilities in one-time password (OTP) systems, such as interception risks associated with SMS delivery like SIM swapping, organizations are advised to prioritize authenticator applications over SMS-based OTPs, as these generate codes locally on the user's device without relying on vulnerable cellular networks. Implementing rate limiting on OTP requests and submissions—typically restricting attempts to 3-5 per minute per user or IP address—prevents brute-force and enumeration attacks by slowing down unauthorized access efforts.[3] Combining OTPs with biometrics, such as fingerprint or facial recognition, enhances multi-factor authentication (MFA) by adding an inherent factor that is difficult to replicate remotely, thereby reducing reliance on the possession factor alone.[56]Advanced strategies include device binding, where the OTP generation or verification process is cryptographically tied to a specific user device using hardware identifiers or public-private key pairs, ensuring authentication only from registered hardware and further mitigating interception threats.[9] Geolocation checks can be integrated to verify the user's approximate location against expected patterns during OTP validation, flagging or blocking attempts from anomalous regions to detect potential account takeovers.[57] For long-term resilience, transitioning toward passwordless authentication frameworks like FIDO2—using public key cryptography for phishing-resistant logins—positions OTPs as a secure fallback only when primary methods fail, aligning with evolving standards for device-bound credentials.[58]Best practices emphasize configuring short validity windows for OTPs, generally 30-60 seconds, to minimize the exploitation timeframe if a code is compromised, while balancing usability to avoid excessive user friction.[3] User education campaigns should focus on recognizing phishing attempts that trick individuals into revealing OTPs, promoting habits like verifying request origins and avoiding unsolicited code shares through targeted training programs.[59] Server-side logging of OTP-related events, including failed attempts and access patterns, enables real-time anomaly detection—such as unusual request volumes or geographic inconsistencies—allowing proactive alerts and forensic analysis without exposing sensitive data.[60]Emerging research post-2023 explores quantum-resistant hashing algorithms, such as those based on lattice problems or hash-based signatures, to protect long-term shared secrets in OTP systems like HMAC-based protocols from future quantum attacks that could undermine classical hash functions.[61]
Standards and Protocols
HOTP and TOTP
The HMAC-based one-time password (HOTP) algorithm, standardized in RFC 4226, generates OTPs based on an incrementing event counter rather than time. It operates using a shared secret key K and a counter value C, computing the OTP as \text{HOTP}(K, C) = \text{Truncate}(\text{HMAC-SHA-1}(K, C)), where the Truncate function dynamically offsets the 20-byte HMAC output to extract a 4-byte (31-bit) value, which is then taken modulo $10^d to produce a d-digit decimal result, with d typically ranging from 6 to 8 for usability and security balance. This event-based approach ensures each OTP is unique as long as the counter advances monotonically, with the client and server maintaining synchronized counters to validate tokens.Building on HOTP, the time-based one-time password (TOTP) algorithm, defined in RFC 6238, replaces the event counter with a time-based counter to enable periodic OTP generation without requiring counter synchronization. The counter T is calculated as T = \lfloor (T_{\text{current}} - T_0) / X \rfloor, where T_{\text{current}} is the current Unix time, T_0 is a reference timestamp (typically 0, corresponding to January 1, 1970), and X is the time step interval, standardized at 30 seconds for a balance between security and user convenience.[6] The TOTP value is then derived as \text{TOTP}(K, T) = \text{HOTP}(K, T), inheriting HOTP's HMAC-SHA-1 computation and truncation, which allows TOTP to generate a new OTP every interval while tolerating minor time desynchronization (up to ±1 step) on the server side.[6]For interoperability, both HOTP and TOTP mandate a 128-bit (16-byte) shared secret key K derived from a higher-entropy seed, with the counter or time step represented as an 8-byte value in network byte order, ensuring consistent computation across diverse implementations.[6] Key provisioning commonly occurs via QR codes during user enrollment, encoding the secret K, algorithm details, and parameters like digit length and time step into a URI format (e.g., otpauth://totp/) that applications can scan and import directly.[62]Post-2020 errata for these standards address implementation vulnerabilities; for instance, TOTP implementations should use constant-time operations to prevent timing attacks during OTP generation, as recommended in Errata ID 7271 to mitigate side-channel leaks in string formatting.[63] While the original RFCs specify SHA-1 for broad compatibility, subsequent security guidance encourages migration to stronger hashes like SHA-256 in new deployments to resist collision attacks, though this requires coordinated updates to maintain interoperability.[6]These algorithms are widely implemented in software tokens, such as mobile authenticator apps, for seamless cross-platform OTP verification.[6]
Other Relevant Standards
The Open Authentication (OATH) initiative represents an industry collaboration to establish open standards for strong authentication, providing a reference architecture that supports multiple one-time password algorithms for universal adoption across devices and networks.[64] While encompassing core mechanisms like event- and time-based passwords, OATH extends to advanced protocols such as the OATH Challenge-Response Algorithm (OCRA), standardized in RFC 6287, which enables dynamic one-time password generation in response to server challenges, mutual authentication, or transaction data for enhanced security in high-risk environments.[65] OCRA supports various modes, including unidirectional challenge-response for simple authentication or bidirectional for mutual verification, using cryptographic hashing to bind passwords to session-specific elements like timestamps or counters.[65]The FIDO Alliance, formed in 2012, advances authentication standards that reduce password reliance by incorporating OTP-like dynamic responses through asymmetric cryptography, allowing authenticators to sign challenges without transmitting secrets.[66] Its Universal Second Factor (U2F) protocol integrates as a second authentication factor alongside passwords, using hardware tokens or mobile devices to generate unique, one-time signatures for web logins via USB or NFC.[67] Building on this, FIDO2—finalized in 2019—introduces passwordless capabilities through the WebAuthn API for web browsers and the Client to Authenticator Protocol (CTAP), enabling seamless multi-factor or single-factor authentication across platforms.[67]Post-2023 developments in FIDO standards include CTAP 2.2, which enhances cross-device authentication by supporting hybrid transports like Bluetooth Low Energy for scenarios where an authenticator on a mobile device authorizes logins on a separate platform, such as a desktop, without direct physical connection.[68] This framework ensures phishing-resistant, one-time challenge responses while maintaining compatibility with existing FIDO2 ecosystems.ISO/IEC 18031 provides foundational guidelines for random bit generation in information security techniques, critical for producing high-entropy values used in one-time password systems within secure messaging protocols. The standard outlines deterministic and non-deterministic methods to meet cryptographic strength requirements, such as generating unpredictable seeds for OTP derivation, thereby mitigating risks like predictability attacks in authentication exchanges. Updated in subsequent revisions, it ensures compliance for applications requiring robust randomness, including those involving OTP elements for initial key establishment or session tokens.
Applications
Financial Services
One-time passwords (OTPs) play a critical role in financial services, particularly for securing transaction approvals and user logins to banking applications. In the European Union, the Revised Payment Services Directive (PSD2), enforced since September 2019, mandates Strong Customer Authentication (SCA) for electronic payments, requiring at least two independent factors—such as knowledge (e.g., a password) and possession (e.g., an OTP)—to verify user identity and reduce unauthorized access. This regulatory framework has driven widespread adoption of OTPs in banking, ensuring compliance while protecting sensitive operations like account access and fund transfers.[69][70]OTP implementation is prominent in high-risk scenarios, including wire transfers where banks send a temporary code to the user's registered device for authorization before processing large-value payments, and card-not-present (CNP) transactions such as online purchases, where the OTP confirms cardholder legitimacy without physical cardpresentation. Historically, SMS-delivered OTPs have been the standard due to their accessibility, but post-2019 PSD2 guidelines and subsequent clarifications on dynamic linking have prompted a shift toward app-based delivery methods, which offer stronger inheritance and reduce interception risks. For instance, many institutions now integrate TOTP protocols within mobile banking apps to generate codes locally.[71][72][73][74]The benefits of OTPs in financial services include significant fraud mitigation, with multi-factor authentication incorporating OTPs blocking up to 99.9% of automated attacks on accounts, leading to substantial reductions in incidents like unauthorized transfers reported by major banks. However, challenges persist, as the additional step of entering an OTP introduces user friction, potentially causing transaction abandonment rates to rise during time-sensitive processes. In 2025, the expansion of real-time payments systems, such as RTP and FedNow in the US, underscores the need for expedited OTP mechanisms or hybrid approaches to align security with the demand for instantaneous settlements without compromising regulatory standards.[75][76][77][78]
Enterprise Access
In corporate environments, one-time passwords (OTPs) are integral to securing remote and internal access, commonly applied to virtual private network (VPN) logins, Secure Shell (SSH) connections, and administrative portals. These implementations frequently integrate OTPs with Remote Authentication Dial-In User Service (RADIUS) for centralized authentication or Lightweight Directory Access Protocol (LDAP) for directory-based verification, enabling multi-factor authentication (MFA) that verifies user identity beyond static credentials.[79][80]Hardware tokens distributed to employees serve as a primary example, generating time-based or event-based OTPs for portable authentication during VPN or SSH sessions, ensuring users can securely connect from various locations.[81] For high-security applications, such as privileged admin portal access, challenge-response mechanisms employ OTP tokens where the server presents a numeric challenge, and the token derives a unique response using a shared secretkey, preventing replay attacks.OTP deployment in enterprises supports regulatory compliance, including the Sarbanes-Oxley Act (SOX) for financial reporting controls and the Health Insurance Portability and Accountability Act (HIPAA) for protecting electronic protected health information through robust access management.[82][83] These systems scale to accommodate thousands of users, as evidenced by widespread adoption in large organizations where MFA enrollment, often incorporating OTPs, handles high-volume remote authentications without latency issues.[84]The post-2020 remote work surge accelerated OTP integration into enterprise MFA, with adoption rates rising from 35% to 50% between February and March 2020 as companies fortified distributed access.[84] For example, Zoom enhanced its enterprise offerings with OTP-based two-factor authentication for account sign-ins and meeting joins, mitigating risks in virtual environments.[85]
Consumer Services
In consumer services, one-time passwords (OTPs) are commonly employed as a core component of two-factor authentication (2FA) for securing personal online accounts, particularly in account recovery and login processes on major platforms. For instance, Google integrates OTPs into its 2-Step Verification system, where users receive time-based codes via authenticator apps or push notifications to verify identity during sign-ins or password resets for Gmail and other services. Similarly, Microsoft accounts utilize OTPs in two-step verification for login and recovery, sending codes through email, SMS, or the Microsoft Authenticator app to confirm user identity and prevent unauthorized access.[86] These mechanisms ensure that even if a password is compromised, an additional verification step is required, enhancing protection for everyday activities like checking email or accessing cloud storage.Specific examples illustrate OTP deployment in consumer contexts. Email-based OTPs are frequently used for login verification, such as when a user attempts to access their account from a new device, prompting a temporary code sent to the registered email address for entry.[9] In social media applications, push-based OTPs provide a seamless alternative, where platforms like Facebook or Google send approval requests directly to the user's mobile device via notifications, allowing a simple tap to authenticate without manually entering a code.[77] Network delivery methods, such as SMS, may also support these push notifications in areas with limited app integration.[87]The primary benefits of OTPs in consumer services lie in their role as user-friendly multi-factor authentication (MFA), offering a balance of security and convenience by mitigating risks like phishing and password reuse without requiring complex hardware. This approach has seen widespread adoption since the 2010s, with platforms like Google reporting that approximately 70% of its users have enabled MFA features, including OTPs, thereby protecting billions of accounts from automated attacks.[88]Despite these advantages, OTP implementation in consumer services faces challenges related to accessibility, particularly for users without smartphones or those with disabilities. Non-smartphone users may struggle with delivery methods reliant on mobile apps or SMS, often requiring alternative verification options like hardware tokens, which are not universally available and can exclude elderly or low-income individuals from secure access.[89] Additionally, cognitive or visual impairments can complicate code entry or notification interpretation, highlighting the need for more inclusive authentication alternatives to ensure equitable security.[90]
Emerging Trends
Integration with Modern Authentication
One-time passwords (OTPs) increasingly serve as a secondary factor in multi-factor authentication (MFA) frameworks that incorporate biometrics, enhancing security by combining something the user is (biometric trait) with something the user knows (OTP code). For instance, on iOS devices, Face ID can unlock authenticator apps to access time-based OTPs (TOTP), allowing seamless verification during login processes while leveraging device-bound biometrics for initial access.[91] Similarly, FIDO2 hybrids enable devices to support both public-key cryptography for passwordless flows and OTP generation, such as in hardware tokens that provide FIDO2 attestation alongside dynamic OTPs for broader compatibility.[92]A notable trend is the shift toward passkeys, promoted by Apple and Google since 2023, which use cryptographic keys synced across devices for phishing-resistant authentication, often positioning OTPs as a fallback for legacy systems or unavailable passkeys. As of May 2025, Google reported over 800 million accounts using passkeys, reflecting rapid adoption that reduces reliance on OTPs but retains them for recovery scenarios.[93] In hybrid environments, passkeys handle primary verification, with OTPs activated via email or SMS only when biometric or key-based options fail, balancing usability and security.[94][95]Examples of OTP integration include WebAuthn protocols prompting for OTPs as a fallback during authentication ceremonies, where browsers first attempt hardware or biometric authenticators before reverting to TOTP or SMS codes for unsupported scenarios. In blockchain wallets, event-based OTPs (HOTP) add a second layer to smart contract interactions, requiring users to confirm transactions with a counter-generated code alongside wallet signatures, mitigating risks in decentralized environments.[96]Adoption of OTPs in Web3 and IoT authentication has been proposed through blockchain-enhanced schemes, such as those distributing OTP generation via publish/subscribe models for secure device onboarding, particularly in research from 2023–2024. For Web3 applications, OTP-based two-factor authentication in smart contract wallets has been explored to prevent unauthorized transfers, with implementations showing resistance to replay attacks in decentralized finance (DeFi) protocols. In IoT, OTPs integrate with standards like FIDO for interoperability, enabling event-triggered verification in resource-constrained devices, such as sensors authenticating to cloud services amid rising zero-trust IAM trends.[97][98][99]
Future Challenges
One of the primary future challenges for one-time passwords (OTPs) lies in the advancing threat of quantum computing to underlying symmetric cryptographic primitives like HMAC, which powers standards such as HOTP and TOTP. Grover's algorithm enables a quadratic speedup in brute-force key searches, effectively halving the security strength of a 256-bit HMAC key to an equivalent 128-bit resistance against quantum attacks, potentially rendering current OTP implementations vulnerable by the early 2030s as cryptographically relevant quantum computers emerge.[100][101]To counter this, innovations in post-quantum cryptography are underway, with the National Institute of Standards and Technology (NIST) finalizing lattice-based algorithms such as ML-DSA (formerly CRYSTALS-Dilithium) in 2024 and selecting HQC for standardization in March 2025, paving the way for quantum-resistant OTP mechanisms by 2026 through integration into hash-based or signature schemes for time-bound authentication.[102][103] Additionally, decentralized OTP systems leveraging blockchain are gaining traction in research, enabling distributed generation and verification of one-time codes without centralized trust points, as demonstrated in protocols that combine OTP with blockchain-ledger immutability for enhanced tamper resistance in multi-party environments.[104]AI-driven automation exacerbates phishing risks for OTPs, allowing attackers to generate hyper-personalized campaigns at scale that intercept or coerce delivery channels like SMS or email, with projections indicating AI phishing as the dominant enterprise threat through 2030 due to its ability to mimic legitimate interactions in real time.[105][106]Broader privacy issues in OTP delivery demand stricter adherence to regulations like the EU's GDPR, which mandates explicit consent and data minimization for processing personal information in authentication flows, complicating cross-jurisdictional implementations amid rising fines for non-compliance.[107] Scalability challenges further intensify for IoT ecosystems, where billions of resource-constrained devices by 2030 require lightweight OTP protocols that avoid computational overhead, yet current centralized models struggle with authentication latency and key management across heterogeneous networks.[108][109]Emerging solutions include AI-resistant behavioral OTP variants, which fuse traditional codes with continuous biometric analysis of user patterns like keystroke dynamics to detect anomalies without relying on static delivery, offering phishing resilience in high-volume scenarios.[110] Global standards for cross-border authentication, such as the EU's eIDAS 2.0 framework, are evolving to support digital identity wallets that facilitate secure interoperability while addressing regulatory divergences in regions like Asia and the EU, with phased implementation targeted for 2026–2027.[111]