Time-based one-time password explained

Time-based one-time password (TOTP) is a computer algorithm that generates a one-time password (OTP) using the current time as a source of uniqueness. As an extension of the HMAC-based one-time password algorithm (HOTP), it has been adopted as Internet Engineering Task Force (IETF) standard .[1]

TOTP is the cornerstone of Initiative for Open Authentication (OATH), and is used in a number of two-factor authentication (2FA) systems.

History

Through the collaboration of several OATH members, a TOTP draft was developed in order to create an industry-backed standard. It complements the event-based one-time standard HOTP, and it offers end user organizations and enterprises more choice in selecting technologies that best fit their application requirements and security guidelines. In 2008, OATH submitted a draft version of the specification to the IETF. This version incorporates all the feedback and commentary that the authors received from the technical community based on the prior versions submitted to the IETF.[2] In May 2011, TOTP officially became RFC 6238.

Algorithm

To establish TOTP authentication, the authenticatee and authenticator must pre-establish both the HOTP parameters and the following TOTP parameters:

Both the authenticator and the authenticatee compute the TOTP value, then the authenticator checks whether the TOTP value supplied by the authenticatee matches the locally generated TOTP value. Some authenticators allow values that should have been generated before or after the current time in order to account for slight clock skews, network latency and user delays.

TOTP uses the HOTP algorithm, replacing the counter with a non-decreasing value based on the current time:

TOTP value(K) = HOTP value(K, C),

calculating counter value

C_T = \left\lfloor\frac\right\rfloor,

where

Security

Unlike passwords, TOTP codes are only valid for a limited time. However, users must enter TOTP codes into an authentication page, which creates the potential for phishing attacks. Due to the short window in which TOTP codes are valid, attackers must proxy the credentials in real time.[3]

TOTP credentials are also based on a shared secret known to both the client and the server, creating multiple locations from which a secret can be stolen.[4] An attacker with access to this shared secret could generate new, valid TOTP codes at will. This can be a particular problem if the attacker breaches a large authentication database.[5]

See also

Notes and References

  1. Web site: RFC 6238 – TOTP: Time-Based One-Time Password Algorithm. May 2011 . July 13, 2011. July 11, 2011. https://web.archive.org/web/20110711124823/http://tools.ietf.org/html/rfc6238. live . m'Raihi . David . Rydell . Johan . Pei . Mingliang . Machani . Salah .
  2. Web site: OATH Submits TOTP: Time-Based One Time Password Specification to IETF. Alexander. Madison. Open Authentication. 22 February 2010. 9 April 2013. https://web.archive.org/web/20130409124046/http://www.openauthentication.org/news/20080408. live.
  3. Web site: Umawing. Jovi. 21 January 2019. 9 August 2020. Has two-factor authentication been defeated? A spotlight on 2FA's latest challenge. Malwarebytes Labs. en-US. 25 September 2020. https://web.archive.org/web/20200925082641/https://blog.malwarebytes.com/cybercrime/2019/01/two-factor-authentication-defeated-spotlight-2fas-latest-challenge/. live.
  4. News: Time-Based One-Time Passwords (TOTP) . 2 May 2022 . www.transmitsecurity.com . 25 June 2020.
  5. News: RSA Agrees to Replace Security Tokens After Admitting Compromise. Zetter. Kim. WIRED. 17 February 2017. en-US. 12 November 2020. https://web.archive.org/web/20201112032021/https://www.wired.com/2011/06/rsa-replaces-securid-tokens/. live.