OTP, TOTP, HOTP: What’s the Difference? | OneLogin (2024)

Providing secure access to applications and cloud-based software is aconstant challenge for companies across all industries. Empowering users withsimple but reliable security is critical to protecting user information andsensitive company data.

One of the ways technology companies have counteracted password theft andother types of cyberattacks is through the use of one-time passwords (OTPs).OTP is a form of multi-factor authentication(MFA) designed to make it much harder for hackers to access protectedinformation.

MFAs require additional credentials beyond a simple password before the enduser can gain access to an application or system. For example, an MFA thatuses SMS will send the user a text with a numeric string that has to beentered before they are granted access. That code is a type of OTP.

Both B2B and B2C companies have an incentive to protect their user andcompany data while maintaining a great user experience (UX), which means thatwhatever security solution they choose, it needs to be streamlined withoutdrastically interfering with a user’s workflow.

OTP authentication is an elegant solution to both security concerns and UX.There are two types of OTP: HOTP and TOTP. We’ll get into thedifferences of each below. But first, let’s dig a little deeper intoOTP.

What is OTP and How Does it Work?

An OTP is like a password but it can only be used once, thus it stands forone-time password. It is often used in combination with a regular password asan additional authentication mechanism providing extra security.

OTPs are exactly what they sound like: one and done. Once you’ve usedthat password once, it’s dumped, and the next time you need to get intothat application, you will use another one. Doing this increases security andmakes it a lot harder for bad actors to penetrate private accounts.

Users can access an OTP for a given application or website throughsmartphone apps, a text message, or a proprietary token (such as a key fob).OneLogin Protect is an example of an OTP generator that you can use as an appon your phone. Any time you receive an SMS text with a code to help you getinto a website or application, you’re using an OTP.

There are a variety of industry standard algorithms, such as SHA-1, thatgenerate OTPs. All of these algorithms use two inputs to generate the OTPcode: a seed and a moving factor. The seedis a static value (secret key) that’s created when you establish a newaccount on the authentication server.

While the seed doesn’t change, the moving factor does each time a newOTP is requested. How the moving factor is generated is the big differentiatorbetween HOTP and TOTP.

What is HOTP?

The “H” in HOTP stands for Hash-based Message Authentication Code (HMAC). Put in layman’s terms, HMAC-based One-time Password algorithm (HOTP) is an event-based OTP where the moving factor in each code is based on a counter.

Each time the HOTP is requested and validated, the moving factor is incremented based on a counter. The code that’s generated is valid until you actively request another one and it’s validated by the authentication server. The OTP generator and the server are synced each time the code is validated and the user gains access. Yubiko’s Yubikey is an example of an OTP generator that uses HOTP.

OTP, TOTP, HOTP: What’s the Difference? | OneLogin (1)

You might be interested in:

Privileged Access Management (PAM) Demystified

Find out how Privileged Access Management (PAM) works and why you need it from One Identity experts.

Learn More

Password Vaulting vs SSOWhich is better, a password vault or single sign-on?Learn MoreElevating Security with Advanced Authentication[GATED] Advanced Authentication offers a holistic solution that mitigates most prevalent access management chall...Download Techbrief

What is TOTP?

Time-based One-time Password (TOTP) is a time-based OTP. The seed for TOTP is static, just like in HOTP, but the moving factor in a TOTP is time-based rather than counter-based.

The amount of time in which each password is valid is called a timestep. As a rule, timesteps tend to be 30 seconds or 60 seconds in length. If you haven’t used your password within that window, it will no longer be valid, and you’ll need to request a new one to gain access to your application.

OTP, TOTP, HOTP: What’s the Difference? | OneLogin (2)

Limitations and Advantages

While both are far more secure than not using MFA at all, there are limitations and advantages to both HOTP and TOTP. TOTP (the newer of the two technologies) is easy to use and implement, but the time-based element does have a potential for time-drift (the lag between the password creation and use). If the user doesn’t enter the TOTP right away, there’s a chance it will expire before they do. So the server has to account for that and make it easy for the user to try again without automatically locking them out.

Since HOTP doesn’t have the time-based limitation, it’s a little more user-friendly, but may be more susceptible to brute force attack. That’s because of a potentially longer window in which the HOTP is valid. Some forms of HOTP have accounted for this vulnerability by adding a time-based component to their code, somewhat blurring the lines between these two types of OTP.

A Final Word

Regardless of which type of OTP you use, choosing an OTPgenerator like an authenticator app or key fob is a safer way to use MFAthan the SMS texting options. Scammers have found creative ways to interceptthese SMS codes, whether it’s through SIM card fraud or some other typeof hack that helps them gain access to your texts. While SMS-based MFAs mightbe better than no MFA at all, they’re a lot less secure than having anauthenticator app on your phone or using a key fob code generator.

Try OneLogin for Free

Empower your employees to work better and faster with the OneLogin Identity and Access Management (IAM) solution.

Try Online

OTP, TOTP, HOTP: What’s the Difference? | OneLogin (2024)

FAQs

OTP, TOTP, HOTP: What’s the Difference? | OneLogin? ›

Time-based One-time Password

Time-based One-time Password
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 RFC 6238.
https://en.wikipedia.org › Time-based_one-time_password
(TOTP) is a time-based OTP. The seed for TOTP is static, just like in HOTP, but the moving factor in a TOTP is time-based rather than counter-based. The amount of time in which each password is valid is called a timestep. As a rule, timesteps tend to be 30 seconds or 60 seconds in length.

What is HOTP used for? ›

Both TOTPs and HOTPs are commonly used to enable multi-factor authentication. The type of one-time password in use depends on the chosen MFA method. Typically, the one-time password is generated via code generation hardware, an authenticator app, or a text message.

What does HOTP mean? ›

HMAC-based one-time password (HOTP) is a one-time password (OTP) algorithm based on HMAC. It is a cornerstone of the Initiative for Open Authentication (OATH).

Does Google Authenticator use HOTP or TOTP? ›

Google Authenticator is a software-based authenticator by Google. It implements multi-factor authentication services using the time-based one-time password (TOTP; specified in RFC 6238) and HMAC-based one-time password (HOTP; specified in RFC 4226), for authenticating users of software applications.

Can I use TOTP instead of OTP? ›

Definition: TOTP is an 8-digit number generated uniquely for each person every 30 seconds. Purpose: It boosts security for online activities related to Aadhaar, like transactions and authentication. Generation: TOTP is produced by an algorithm and serves as an alternative to traditional Aadhaar-based OTPs.

Should I use TOTP or HOTP? ›

TOTPs are more secure than passwords, HOTPs, and SMS authentication. HOTPs are more secure than passwords but less so than TOTPs. They are vulnerable to brute force attacks. HOTPs and TOTPs are not entirely unique protocols from scratch; they're two means of achieving the same end.

What is OTP? ›

What does OTP mean? One-time password (OTP) systems provide a mechanism for logging on to a network or service using a unique password that can only be used once, as the name suggests. The static password is the most common authentication method and the least secure.

What is the meaning of TOTP and OTP? ›

TOTP is time-based one time password to be used as alternate to Aadhaar-based OTP in case there is a limitation of mobile signal to every receive OTP from Aadhaar on mobile.

What is OTP slang? ›

"OTP" means "one true pair/pairing," according to Merriam-Webster. The term comes from "shipping" within fandom culture. "Shipping" refers to creating a relationship between two characters or people who are not previously romantically linked, says Merriam-Webster. So, OTP refers to a fan-made couple.

What is OTP in banking? ›

OTP- One Time Password, that four to six-digit code that pops up on your screen every time you use your Debit or Credit Card for an online transaction or a NetBanking transaction.

Is Google Authenticator an OTP? ›

The Google Authenticator app is based on the time-based one-time password algorithm specified in the Internet Engineering Task Force's (IETF) RFC 6238. The TOTP algorithm generates a six-digit passcode that factors in the current time of day to ensure that each passcode is unique.

What type of authentication is OTP? ›

OTP is a form of multi-factor authentication (MFA) designed to make it much harder for hackers to access protected information. MFAs require additional credentials beyond a simple password before the end user can gain access to an application or system.

Is TOTP the same as 2FA? ›

TOTP stands for Time-based One-Time Passwords and is a common form of two-factor authentication (2FA). Unique numeric passwords are generated with a standardized algorithm that uses the current time as an input.

What are the disadvantages of HOTP? ›

Drawbacks of HOTP

The inclusion of a moving factor (counter) in HOTP mitigates the risk of replay attacks, where intercepted passwords cannot be reused. However, unlike Time-Based One-Time Passwords (TOTP), HOTP is not time-sensitive.

Why is TOTP not secure? ›

Also, the services often offer reserve codes instead of explicitly suggesting to save the secret. If you lose your secret and log in with a reserve code, you will have to redo the entire TOTP registration process again. Backup codes are sent online, which is often insecure. You and Provider share the same secret.

Is SMS OTP better than app OTP? ›

Pros of using a dedicated authenticator app

Authenticator apps are not only faster and more reliable than SMS 2FA, they also enforce an additional layer of security, such as a passcode, a password or biometrics (i.e. fingerprint).

What is the difference between HOTP and HMAC? ›

The “H” in HOTP stands for Hash-based Message Authentication Code (HMAC). Put in layman's terms, HMAC-based One-time Password algorithm (HOTP) is an event-based OTP where the moving factor in each code is based on a counter.

Should I delete OTP messages? ›

Because these OTP messages can only be used once, it makes no sense to keep them around. They will just clutter your SMS inbox. Thankfully, the official Messages app for Android can auto delete OTPs after 24 hrs.

What is the purpose of TOTP? ›

The time-based passwords are available offline and provide user-friendly, increased account security when used as a second factor. TOTP is also known as app based authentication, software tokens, or soft tokens. Authentication apps like Authy and Google Authenticator support the TOTP standard.

Top Articles
Latest Posts
Article information

Author: Francesca Jacobs Ret

Last Updated:

Views: 6131

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Francesca Jacobs Ret

Birthday: 1996-12-09

Address: Apt. 141 1406 Mitch Summit, New Teganshire, UT 82655-0699

Phone: +2296092334654

Job: Technology Architect

Hobby: Snowboarding, Scouting, Foreign language learning, Dowsing, Baton twirling, Sculpting, Cabaret

Introduction: My name is Francesca Jacobs Ret, I am a innocent, super, beautiful, charming, lucky, gentle, clever person who loves writing and wants to share my knowledge and understanding with you.