Visual RFC.
ALL RFCs / RFC 4226
Read the RFC ↗
RFC 4226 / Counter-based one-time passwords

Limit guessing and protect the whole protocol

05

A short code needs a secure channel, protected shared secrets, another factor and server-side attempt limits.

RFC 4226 · § 7.1EXAMPLE
4 / 4
Limit guessing and protect the whole protocolFor three attempts and six digits, compare exact worked arithmetic of the RFC approximate model: s3 gives0.000009, s10 gives0.000030. Bar widths scale3to10.A larger window allows more guessesApproximation: s × v /10^Digitv=3 attempts · Digit=6s=3s=100.0000090.000030Approximate model, not system compromise rateSelected requirements · no complete login/security certification
04
Understand the window trade-off

For three attempts and six digits, compare s 3 and s 10 with the RFC’s approximate formula. The illustration is a model, not a measured attack or deployment approval.

Source for this drawing: RFC 4226 · Read RFC section 7.1 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A seal answers a specific question.

A certificate or signature supports particular checks about a key or message. It does not automatically prove that every claim or sender is trustworthy.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

HOTP alone provides neither confidential transport nor a complete authentication system.

  • Protocol P MUST support two-factor authentication: something known, such as a PIN or password, and possession of the token. P SHOULD use a secure channel to protect privacy and avoid replay; HOTP is not a substitute for encryption (§§7–7.1). The picture is a boundary illustration, not a full login protocol.
  • A throttling or lockout scheme is RECOMMENDED. T defines a maximum number of possible OTP validation attempts; keep it low while preserving usability. After the maximum authorized attempts, the server SHOULD lock out and inform the user. Delay or lockout schemes MUST apply across login sessions (§§7.2–7.3).
  • Chosen example policy: T=3 total failures for this token. Failures in sessions A, B, A share one attempt budget. The third exhausted attempt is stopped before OTP acceptance; opening session C does not reset the budget. Three is an example, not an RFC-required constant; recovery and other factor checks are outside this model.
  • The approximate guessing relationship is Sec ≈ s×v/10^Digit, with v verification attempts and s window size (§6). For Digit 6, s 3, v 3 the estimate is0.000009; with s 10 and v 3 it is0.000030. This is a model approximation under the RFC analysis, not an exact whole-system compromise probability or safety certification.
  • Secrets require secure generation, storage and limited exposure. The secret store MUST be in a secure area; storage encryption and proven randomness products are RECOMMENDED (§7.5). A copied secret can generate future codes. The guide does not implement secure key storage, phishing resistance, rate-limited network authentication or account recovery. RFC 6238 is a later companion using time as a moving factor, not a formal update or obsoletion of RFC 4226.
DETAILS

Offline public test values and selected rules; not a login service, secure token implementation or deployment recommendation.

Read the RFC section ↗

All chapters in RFC 4226

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗