Module 1 · Lesson 1.6

Challenge-response

A fresh question every time, that only the holder of the private key can answer: how a reader checks a card.

  • 4-minute video
  • 8-minute read
  • Builds on lesson 1.5

A card is held up to a reader at a door. The reader has never seen this card before, and anything the card sends could have been recorded and copied. How can the reader know the card holds the right private key, right now?

Why a fixed answer isn't enough

If a card always answered with the same value, such as a card number, anyone who recorded that value once could play it back forever. That's how simple badges get cloned, as Module 0 explains. A fixed secret sent over the air is no better: once it's been sent, it can be copied.

The answer is to ask a different question every time, one that only the holder of the private key can answer.

The challenge and the response

In challenge-response authentication, the reader and the card follow three steps:

  1. The reader sends a challenge. For each attempt, the reader generates a fresh, unpredictable challenge, long enough that an accidental repeat is extremely unlikely.
  2. The card signs the challenge with its private key, inside its chip, and sends back the signature. The private key itself never leaves the card.
  3. The reader verifies the signature against its current challenge, using the public key from the card's certificate. A valid signature shows that the card controls the private key matching that public key, right now.

The reader accepts a response only for the challenge it currently has outstanding, and retires that challenge as soon as it's been used or has timed out. So a recording of an earlier exchange doesn't help an attacker: it contains a signature over an old challenge that the reader no longer accepts. Because the challenge is unpredictable, the attacker can't prepare an answer in advance either.

Challenge-response between a reader and a card On the left, a card with a private key inside its chip. On the right, a reader. Arrow one, from the reader to the card: a fresh random challenge. Arrow two, from the card to the reader: a signature over the challenge. The reader checks it with the public key from the card's certificate. ACCESS CARD Card: private key in the chip Reader 1. Fresh challenge 7c1e 94ab 03f2 … 2. Signature over it signed inside the chip 3. The reader verifies it with the public key from the card's certificate.
The challenge is new every time, so an old answer is useless.

Try it: challenge three cards

Your browser plays a reader and a card. The genuine card holds a real private key (ECDSA, P-256); the reader already trusts the matching public key, as it would after verifying the card's certificate. Present each card and watch what happens. Nothing is sent or stored.

Reader's challenge (new for every attempt)

Present a card to start.

Response from the card

…

"Replay" sends the genuine card's answer from its previous attempt, as an attacker who recorded it would. Present the genuine card at least once first.

What the reader checks, and what it doesn't decide

A valid signature, checked with a key the card supplied, only shows that the card controls that key. A card could present its own, untrusted certificate and still pass the signature check. To treat the key as this card's certified identity, the reader must also verify the certificate for this use under its trust policy: that it chains to an issuer the site trusts, that it's meant for this kind of authentication, and that it hasn't expired. Where the policy requires, the back end also validates that it hasn't been revoked. Module 2 covers those checks, and Module 4 shows how PIV defines them.

Only with both checks, a valid signature on the current challenge and a validated certificate, has the card shown that it controls the private key of a trusted, certified identity. Even then, that doesn't decide whether the person may open this door at this time. That's a separate decision, made by the access control system using the card's identity, as Module 5 explains.

Some doors also ask for something you know or are, such as a PIN or a fingerprint, so that a lost or stolen card isn't enough on its own. Lesson 4.5 covers those extra factors.

Go deeperOptional technical detail for readers who want more

Challenge-response in PIV

PIV cards, covered in Module 4, use this pattern in two mechanisms. In PKI-CAK, with an asymmetric Card Authentication Key, a reader, typically contactless, can challenge the card without a PIN; the card signs the challenge and the reader verifies the CAK certificate. In PKI-AUTH, the card signs the challenge with its PIV Authentication private key, whose use must first be authorised by the cardholder's PIN under the card's activation policy; the reader verifies the PIV Authentication certificate. NIST SP 800-116 describes how physical access systems should use these mechanisms.

Symmetric challenge-response

Challenge-response also works with shared symmetric keys, as many contactless cards do: both sides compute a value from the challenge and the shared key and compare. The idea of a fresh challenge is the same. The difference is that the reader side must hold the secret too, which is why key diversification matters, as lesson 1.3 explained. With a key pair, the reader only ever needs the public key.

How fresh is fresh?

The challenge must be unpredictable as well as new. A counter is new each time but predictable, so an attacker with brief access to the card could collect answers to future challenges in advance. Readers therefore use a random challenge of sufficient length from a good random number generator, which lesson 1.8 covers.

Relay attacks

Challenge-response stops copying and replay, but not a live relay: an attacker near a victim's card can forward the reader's challenge to the real card and pass the answer back in real time. A valid response shows that the private key was used during the exchange; it doesn't show how far the card is from the reader. Ordinary response timeouts can reject slow relays, and a PIN adds cardholder authentication, but neither establishes proximity. Where proximity itself is the requirement, distance bounding protocols are designed to measure it, by timing very fast challenge-response rounds against the speed of light.

Sources

Draft lesson, awaiting technical review · Last updated 1 December 2026

Search

Press / to search from any page