HOTP One-Time Password Generator

HOTP One-Time Password Generator: Computes HMAC-SHA1 across 8-byte big-endian counter value and performs dynamic truncation.

Hotp Generator · Client runtimeSandboxed
Formatted results will render here in real time.

About this hotp one-time password generator

Computes HMAC-SHA1 across 8-byte big-endian counter value and performs dynamic truncation Runs entirely in-memory using Web Crypto primitives to keep sensitive tokens, certificates, and cryptographic keys secure from third-party interception.

Encoding & cryptographic principles

Generates one RFC 4226 HMAC-SHA-1 HOTP code from a shared secret and a non-negative safe-integer counter encoded as eight big-endian bytes. Dynamic truncation uses the low four bits of the final digest byte; the page accepts 6, 7, or 8 decimal digits and does not verify a token.

Worked verification example

Scenario: A security engineer generates counter-based HMAC-Based One-Time Passwords (RFC 4226).

Sample input:

{"secret":"JBSWY3DPEHPK3PXP","counter":1,"digits":6}

Processing: The client-side engine parses the provided input, executes the transformation routine, and outputs the result in real time.

Illustrative output:

{ "algorithm": "SHA-1", "digits": 6, "counter": 1, "code": "996554" }

Security parameters & input constraints

The counter must be a non-negative safe integer and digits must be an integer from 6 through 8; defaults are counter 0 and six digits. The page generates one code only; it does not verify a token, manage counter resynchronization or store a shared secret. Base32 detection is conditional, so other secret text is treated as UTF-8.

Cryptographic digests, encoded strings, and signatures generated by HOTP One-Time Password Generator should be verified against target authentication systems before production use.

Client-side Web Crypto boundary

Key derivation, hashing, and encoding in HOTP One-Time Password Generator execute in local memory using Web Crypto APIs without remote socket transmission.

Cryptographic specifications & RFC standards

Technical specifications and cryptographic RFC standards governing algorithms and key representations:

HOTP One-Time Password Generator verification · Audit standards

How to use it

  1. Enter JSON with secret, counter and optional digits.
  2. Decode the secret as Base32 only when its alphabet and length match the page's Base32 rule; otherwise use UTF-8, then compute HMAC-SHA-1 over the 8-byte counter.
  3. Apply dynamic truncation and display a six-to-eight-digit code with metadata as JSON.

Frequently asked questions

How does HOTP Generator use the counter?+

It parses JSON secret, counter, and optional digits, then calculates an HMAC-SHA-1 HOTP code for that exact counter value.

What result should the documented example produce?+

The RFC 4226 secret at counter 0 and six digits produced 755224.

Does HOTP advance or store the counter?+

No. It reads the supplied counter only and does not persist or increment it. The calling system must manage synchronization and replay prevention.

Can TOTP and HOTP codes be substituted?+

No. TOTP derives its counter from time while HOTP uses an explicit event counter. Both sides must use the same scheme and parameters.