Jump to content

Time-based one-time password

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Ahecht (talk | contribs) at 22:48, 2 May 2022 (→‎Software clients: title). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Time-based one-time password (TOTP) is a computer algorithm that generates a one-time password (OTP) that uses 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 RFC 6238.[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.[1]

Algorithm

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

  • T0, the Unix time from which to start counting time steps (default is 0),
  • TX, an interval which will be used to calculate the value of the counter CT (default is 30 seconds).

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, CT),

calculating counter value

where

  • CT is the count of the number of durations TX between T0 and T,
  • T is the current time in seconds since a particular epoch,
  • T0 is the epoch as specified in seconds since the Unix epoch (e.g. if using Unix time, then T0 is 0),
  • TX is the length of one time duration (e.g. 30 seconds).

Unix time is not strictly increasing. When a leap second is inserted into UTC, Unix time repeats one second. But a single leap second does not cause the integer part of Unix time to decrease, and CT is non-decreasing as well so long as TX is a multiple of one second.[original research?]

Sicherheit

Unlike passwords, TOTP codes are single-use, so a compromised credential is 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]

Software clients

TOTP Software Clients
Name License Type Last Update Android iOS Desktop Cloud backup Account Required
Aegis Authenticator Free/Open Source March 2022 Google Play
F-Droid
GitHub
Yes No
andOTP Free/Open Source June 2021 Google Play
F-Droid
GitHub
No No
Authenticator (iOS) Free/Open Source June 2019 App Store No No
Authenticator (Linux) Free/Open Source April 2022 Flathub (Linux) No No
Authy Free/Proprietary February 2022 Google Play App Store Authy.com (MacOS, Windows, Linux) Yes Yes
FreeOTP Free/Open Source August 2014 Google Play
F-Droid
App Store No No
FreeOTP+ Free/Open Source December 2021 Google Play
F-Droid
App Store No No
Google Authenticator Free/Open Source (up to version 5) April 2019 GitHub No No
Free/Proprietary May 2020 Google Play No No
KeeWeb Free/Open Source July 2021 Keeweb.info (Windows, MacOS, Linux, offline web app)
app.keeweb.info (online web app)
No No
LastPass Freemium/Proprietary April 2022 Google Play App Store lastpass.com (Windows, MacOS, Linux) Yes Yes
Ravio OTP Free/Open Source January 2022 App Store Yes No
Microsoft Authenticator Free/Proprietary May 2022 Google Play App Store Yes For cloud backup only
WinAuth Free/Open Source October 2017 GitHub No No

See also

References

  1. ^ a b "RFC 6238 – TOTP: Time-Based One-Time Password Algorithm". Archived from the original on July 11, 2011. Retrieved July 13, 2011.
  2. ^ Alexander, Madison. "OATH Submits TOTP: Time-Based One Time Password Specification to IETF". Open Authentication. Archived from the original on 23 January 2013. Retrieved 22 February 2010.
  3. ^ Umawing, Jovi (21 January 2019). "Has two-factor authentication been defeated? A spotlight on 2FA's latest challenge". Malwarebytes Labs. Archived from the original on 25 September 2020. Retrieved 9 August 2020.
  4. ^ "Time-Based One-Time Passwords (TOTP)". www.transmitsecurity.com. 25 June 2020. Retrieved 2 May 2022.
  5. ^ Zetter, Kim. "RSA Agrees to Replace Security Tokens After Admitting Compromise". WIRED. Archived from the original on 12 November 2020. Retrieved 17 February 2017.