Used in:
- Google Authenticator.
- Twillio Authy e.t.c
// n digits
TOTP = TRUCATE(HMAC(secret_key, counter))%10^n
Where;
- secret_key = shared between client and server
- counter = floor(unix-time/time step)
Hash will be truncated, converted to decimal divided by 10^n (where n is the number of otp digits), the result of the remainder will give you an n length integer, which is our OTP code
Top comments (0)