Check RFC 4226 HOTP counter drift against the look-ahead window and price the false-accept risk that window creates.
HOTP codes come from a counter that only the token increments, so pressing the button without logging in leaves the token ahead of the server. The server compensates by computing the next s codes and accepting any match, then resynchronising its counter. Every code in that window is a valid answer, so the window multiplies the odds of a blind guess by s. Look-ahead is the setting that decides whether users with over-pressed tokens call the helpdesk or silently gain a wider guessing window, and RFC 4226's s = 3 to 5 is the balance point.
HOTP Counter
drift = token counter − server counter; the server accepts if 0 ≤ drift ≤ s, where s is the look-ahead window.
Cost of the look-ahead window
false-accept probability per attempt = s ÷ 10^digits, and s × attempts ÷ 10^digits before lockout.
drift = token counter − server counter; the server accepts if 0 ≤ drift ≤ s, where s is the look-ahead window. HOTP codes come from a counter that only the token increments, so pressing the button without logging in leaves the token ahead of the server. The server compensates by computing the next s codes and accepting any match, then resynchronising its counter. Every code in that window is a valid answer, so the window multiplies the odds of a blind guess by s.
Look-ahead is the setting that decides whether users with over-pressed tokens call the helpdesk or silently gain a wider guessing window, and RFC 4226's s = 3 to 5 is the balance point.
This calculator takes 5 inputs: Server counter value, Token counter value, Look-ahead window (s), Code length, Attempts allowed before lockout. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Because the acceptance window is also the attacker's guessing window: with s unbounded, every code the token will ever produce is valid and the scheme collapses. RFC 4226 keeps s small and requires throttling on top.
It cannot happen through normal use, because only the token increments. A negative drift means the code was already consumed — either a replay attempt or a server-side counter that was restored from an old backup.