About this interactive
With a texted code, the server sends the code. With an authenticator app or a fob, nothing is sent: the device and the server each work the code out for themselves. The HOTP and TOTP lesson shows how.
Both start with a shared key, exchanged once ahead of time by typing it in or scanning a QR code. Both hash that key together with a moving value and cut the result down to six or eight digits.
HOTP (HMAC-based one-time password) uses a counter. Each new code moves the counter on by one, and the server keeps track of where each user is. Time plays no part, so an unused code keeps working until a later one is used. If the device makes codes that are never used, the two counters drift apart, so the server looks ahead a few counts for a match: the look-ahead window.
TOTP (time-based one-time password) uses the time instead, in steps of thirty seconds, so the code changes on its own whether or not anyone signs in. If the two clocks disagree, codes stop matching, so the server also accepts codes from a step or so either side of its own: the tolerance window.
A quick test for each card: does the code move when a code is made, or when the clock moves?
About TechKnowSurge
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →