Pcornel
Identity · Authentication

TOTP

Cheat sheet · https://pcornel.dk/topic.php?topic=4487

Back to the Topic

Answer

Both sides protect the same seed, compute HMAC over a time counter, truncate the result and accept a limited window while enforcing retry limits and preventing replay within the accepted interval.

Remember

  • TOTP ≠ phishing-resistant.
  • QR enrollment code ≠ harmless setup metadata; it contains or conveys the seed.
  • Clock synchronized ≠ replay prevented.
  • Six-digit code ≠ sufficient protection without rate limiting.

First checks

  • oathtool --totp -b <base32-secret> — current code
  • date -u; timedatectl — clock sync
  • Allowed time drift window — verification tolerance

Verify in this order

secret + time → HMAC → 6 digits

Where it usually breaks

First mismatch in identity lifecycle → authenticator/credential → IdP/federation/session → authorization policy → target resource → audit trail; preserve identity/policy/pre-state before mutation.

Authentication → TOTP proof map

BoundaryEstablishDoes not establish
Identity and scopeStable subject/account/resource mapping, owner, lifecycle state and expected actionDoes not prove credential control or effective access
Policy and ceremonyEffective entitlement or authenticator/verifier policy plus all fallback pathsConfiguration presence does not prove enforcement or assurance
OutcomeAllowed, denied, failure, expiry/revoke and target read-back tests correlated with telemetryOne success does not prove every interface, session or downstream target
ClosureOriginal end-to-end action retested; residual access/risk, owner and review trigger recordedAdministrative workflow completion alone is not closure

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4487

Confirmation

Confirm action

Continue?