Visual RFC.
ALL RFCs / RFC 6238
Read the RFC ↗
RFC 6238 / TIME-BASED ONE-TIME PASSWORDS

Provision and protect the shared secret

06

The prover and verifier need matching secret material before they can compute the same codes. Time is public; the secret is what makes the computation specific to the prover. RFC 6238 defines the algorithm, not a QR enrollment format.

RFC 6238 · § 3EXAMPLE
3 / 3
Provision and protect the shared secretBefore use, a schematic provisioning step establishes matching secretK, time-stepX and start timeT0 in both endpoints; the transport is intentionally unspecified because this RFC leaves provisioning flows out of scope. The second state sends only a short OTP over a protected channel, while the verifier recomputes with its locally stored key. The last state stops an unauthorized process before the secret store, illustrating secure-area storage and restricted access, not a property automatically enforced by HMAC.The secret stays behind the codeUnauthorized processVerifier key storeunauthorized access deniedKey store MUST be in a secure areaKeys SHOULD be protected from misuse
03
Protect the verifier’s stored key.

An unauthorized process must not gain access to secret material. The secure-area key-store requirement and restricted access protect more than the displayed decimal code.

Source for this drawing: RFC 6238 · Read RFC section 3 ↗

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

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

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

Terms in this drawing
Provisioning
Setting up matching secret material and system parameters before generation and verification.
Shared secret
Key material held by both endpoints, unlike the public clock or the transmitted short code.
Related RFCs and changes

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

KEY POINT

There MUST be a unique secret for each prover. Keys SHOULD be randomly generated or derived using key-derivation algorithms and SHOULD be protected against unauthorized access and use.

  • There MUST be a unique secret for each prover. Keys SHOULD be randomly generated or derived using key-derivation algorithms and SHOULD be protected against unauthorized access and use.
  • Provision X and T0 in advance. The provisioning flow is outside this RFC; it points to RFC 6030 for provisioning containers. Do not present an otpauth URI or QR code as a format specified by RFC 6238.
  • The prover and verifier MUST share the same secret or know a transformation that yields a shared secret. The verifier recomputes the OTP; it does not recover the secret from the short code.
  • All communications SHOULD take place over a secure channel. The key store MUST be in a secure area; the RFC recommends encrypted, tightly limited key access and brief exposure when validating.
  • MAY use tamper-resistant storage is optional, not an excuse to skip protection. A valid code does not make an untrusted destination safe. Use only public fixtures in demonstrations; never paste a real enrollment key into a guide.
DETAILS

The secret icons represent private, provisioned material, not a key sent with each login. No enrollment service, user account or real key is created. The failed-access stop bar illustrates an access-control boundary, not automatic protection provided by HMAC. Protecting keys, limiting guesses, bounding windows and rejecting replay are complementary controls.

Read the RFC section ↗

All chapters in RFC 6238

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 ↗