About this interactive
A texted code is made on the server and sent to the phone, so it needs a signal to arrive. An authenticator app or a fob is different: nothing is sent. The device and the server each work the code out for themselves, by hashing a shared key, exchanged once by typing it in or scanning a QR code, with a moving value.
HOTP moves its value with a counter. Each new code steps the device's counter on, and the server steps its own only when a code is used. Codes made and never used put the device ahead, so the server looks a few counts ahead for a match, and when it finds one it moves its own counter up to match. Too far ahead, and the device has to be brought back in step.
TOTP moves its value with the clock, in thirty-second steps. If the phone's clock and the server's disagree, the codes stop matching, so the server also accepts codes from a step or so either side of its own: the tolerance window. A clock off by more than the window fails, whichever side is wrong.
The key decides the rest. Two devices holding the same key show the same code; a new key, or one wrong character, and the codes stop matching. Anyone who steals the key can make the codes too, and anyone who sees one code without the key learns nothing about the next.
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 →