To establish TOTP authentication, the authenticatee and authenticator must pre-establish both the
HOTP parameters and the following TOTP parameters: •
T, the
Unix time from which to start counting time steps (default is 0), •
T, an interval which will be used to calculate the value of the counter
C (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,
C), calculating counter valueC_T = \left\lfloor\frac{T - T_0}{T_X}\right\rfloor,where •
C is the count of the number of durations
T between
T and
T, •
T is the current time in seconds since a particular
epoch, •
T is the epoch as specified in seconds since the
Unix epoch (e.g. if using
Unix time, then
T is 0), •
T is the length of one-time duration (e.g. 30 seconds). == Security ==