Shared secret (text, from the QR code)
Server clock: 1234567890 +
0
seconds
Phone clock is…
exactly right
20 seconds fast
40 seconds slow
5 minutes fast
PHONE shows
------
WEBSITE expects
------
1. Unix time
÷ 30, drop the remainder → counter
2. HMAC-SHA-1(secret, counter) =
3. Offset = last byte's low 4 bits =
. The 4 bytes from there read as
, minus the top bit =
4.
mod 1,000,000 =
→ pad to 6 digits
Steps 1–4 are shown for the website's clock. The phone runs the same steps with its own clock.