Two-Factor Authenticator
K
Secret:
Time-based
Counter-based
Current Time
Unix time
T0
X
T = (Unix time - T0) / X
(Time remaining:
sec)
C
Next
HS = HMAC-SHA-1(
K
,
T
)
split HS into components
(Offset
)
Dynamic Truncation
DBC1 = substr(HS, offset B, 4 B)
DBC2 = clear top bit of DBC1
Decimal Code = DBC2 in decimal
HOTP
Code = last 6 of DBC2