Minggu, 10 Juni 2018

Sponsored Links

Security+ Guide to Network Security Fundamentals, Fifth Edition ...
src: slideplayer.com

Time Based Time-Time Algorithm ( TOTP ) is an algorithm that calculates one password from shared secret key and current time. It has been adopted as a standard Task Force Internet Engineering RFC 6238, is the foundation of Initiative For Open Authentication (OATH), and is used in a number of two-factor authentication systems.

TOTP is an example of hash-based message authentication code (HMAC). It combines the secret key with the current time stamp using the cryptographic hash function to generate a one-time password. Because network latency and clocks are out of sync can cause recipients the password should try a possible time span to authenticate, typically the timestamp increases within 30 second intervals, thereby cutting the potential search space.

In a common two-factor authentication application, the setup process takes place as follows: the user enters a username and password into another website or server, the server generates a secret key that the user enters into their TOTP app on a smartphone or other device (often by scanning QR code). To verify that the process works, the user application immediately generates a one-time password for review by the server.

In the next authentication, the user enters the username, password and password once at this time. The server checks the username and password as usual then also runs TOTP to verify the one-time password entered. For this to work, the user and server device hours must be roughly synchronized (the server will typically receive a one-time password generated from different time stamps with the Ã, Â ± 1 time interval of the client time stamp).


Video Time-based One-time Password algorithm



Definisi

TOTP is based on HOTP with a timestamp that replaces incrementing counters.

The current time stamp is converted into an integer timer (TC) by defining the beginning of an era (T0) and counting in units of time interval (TI). As an example:

TC = floor ((unixtime (now) - unixtime (T0))/TI),
TOTP = HOTP (SecretKey, TC),
TOTP-Value = TOTP mod 10 d , where d is the desired number of digits of a word one time password.

Maps Time-based One-time Password algorithm



Implementation

According to RFC 6238, the reference implementation is as follows:

  • Generate a key, K, which is an arbitrary byte string, and share it securely with the client.
  • Agree on T0, Unix time to start calculating the time step of, and the interval, TI, to be used to calculate the counter value of C (default is the Unix period as T0 and 30 seconds as TI)
  • Approve the cryptographic hash method (default is SHA-1)
  • Approve with Token length, N (default is 6)

Although RFC 6238 allows different parameters to be used, the application of the Google autentikator application does not support T0, TI's value, hash method, and token length differ from default. It also expects the secret key K to be included (or provided in QR code) in the base-32 encoding according to RFC 3548.

Once the parameters are agreed upon, the token generation is as follows:

  1. Calculate C as the number of times TI has passed after T0.
  2. Calculate HMAC hash H with C as message and K as key (HMAC algorithm is defined in previous section, but also most cryptographical libraries support it). K must be passed as it is, C must be passed as an undone signed 64-bit raw integer.
  3. Take the least 4 bit H and use as offset, O.
  4. Take 4 bytes of H starting from O byte MSB, remove the most significant bit and save the rest as 32-bit integers (unsigned), I.
  5. Token is the lowest N digit I in base 10. If the result has fewer digits than N, match the number with zeros from the left.

Both the server and the client calculate the token, the server checks if the token provided by the client matches the locally generated token. Some servers allow codes that should be created before or after the current time to calculate minimum clock sketches, network latency, and user delays.

Demo - Time-based One-time Password (TOTP) Integration - YouTube
src: i.ytimg.com


Weakness and vulnerability

The TOTP code can be phishing like a password, even if they need phishers to proxy credentials in real time instead of collecting them on time.

Implementations that do not restrict login attempts are vulnerable to coercive code imposition.

An attacker stealing shared secrets can generate a valid new TOTP code at will. This can be a special issue if an attacker breaks a large authentication database.

Because the TOTP device has a flat battery, clocks that can be disabled, and because the software version is on the phone that users can lose or steal, all real-world applications have methods to bypass protection (eg printed code, email- reset, etc..), which can cause considerable support loads for large user bases, and also provide additional vector user fakes to be exploited.

The TOTP code lasts longer than the amount of time displayed on the screen (usually twice or longer). This is a concession that authenticated and authenticated party hours can be changed by a large margin.

Password-based One-Time authentication schemes (TOTP and HOTP including, among others) are still vulnerable to session hijacking, i.e., ordering user sessions after they log in.

Enpass password manager adds native two-factor authentication ...
src: www.androidcentral.com


History

A TOTP draft was developed through the collaboration of several OATH members to create industry-backed standards. This complements HOTP once for event-based standards and offers end-user organizations and companies 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 feedback and comments the author receives from the technical community based on the previous version submitted to the IETF. As of May 2011, TOTP officially became RFC 6238.

06 - One-Time Password Generator Use Case - YouTube
src: i.ytimg.com


Server Implementation


prd6.jpg
src: www.hackit.co


Implementation of client


Spotlight on One Time Password - YouTube
src: i.ytimg.com


References

Source of the article : Wikipedia

Comments
0 Comments