Ambimat GroupAmbimatAmbiSecureSIMAuthAmbiAutomationEngineering BlogAhmedabad · India · Est. 1982
WebAuthn

WebAuthn Challenge Viewer

Validate a WebAuthn challenge. Reports length, Shannon entropy, and warns about common mistakes (under-length, ASCII-shaped strings, Math.random output). Can also generate fresh 32-byte challenges using the platform CSPRNG. For where that randomness comes from, see lava lamps and cryptographic entropy.

How to use this tool

What it does

Decodes and inspects a WebAuthn challenge value from its URL-safe base64 form.

When to use it

Use it to confirm the challenge in a ceremony is the random value your server generated.

Worked example

Paste a challenge field to recover and compare its raw bytes.

Input

Inspection

Paste a challenge or click Generate.
All decoding runs locally.

About WebAuthn challenges

The challenge is the freshness anchor in every WebAuthn ceremony — without one, signatures can be replayed. The spec mandates ≥16 random bytes, and security guidance is 32. Generate server-side with a CSPRNG, bind to the user session, expire after a short window.

Spec

WebAuthn Level 2 §13.4.3.

Pitfall

Never use Math.random or string concatenation. Use crypto.randomBytes / crypto.getRandomValues / SecureRandom.

Frequently asked questions

How long should a WebAuthn challenge be?

At least 16 bytes; 32 is the common choice. The requirement that matters more is that it comes from a cryptographically secure random source and is never reused.

What does the entropy reading tell me?

Shannon entropy over the decoded bytes, used as a smell test. A low value on a long input usually means the challenge is ASCII text, a counter, or the output of a non-cryptographic generator.

Why is Math.random() unsafe for challenges?

It is a fast non-cryptographic generator with predictable internal state. An attacker who observes enough output can predict future values; use crypto.getRandomValues() or a server-side CSPRNG.

Does the challenge need to be stored server-side?

Yes. The relying party must remember the challenge it issued and compare it against the one echoed in clientDataJSON, otherwise the anti-replay property is lost entirely.

Does anything I paste leave my browser?

Nothing. The tool is entirely client-side: the page ships a static script, does no network calls, and never transmits what you paste. You can confirm it by opening the network tab, or by loading the page and then going offline.