Module 2 · Lesson 2.1

The trust problem

A public key alone doesn’t say whose it is.

  • 3-minute video
  • 6-minute read
  • Builds on Module 1

A card presents a public key labeled “J. Rivera,” and answers the reader’s challenge perfectly. Is this J. Rivera’s card? The key itself can’t say.

Anyone can make a key pair

A computer or smart card can generate a private key and its matching public key. Nothing in the key pair itself identifies its owner: it doesn’t name a person, a company or a card. A label such as “J. Rivera” is text that whoever made the key pair chose to attach.

So an attacker can make a key pair, call it anything, and put it on a card. The card will answer challenges with a valid signature, because it really does hold the matching private key.

Two key pairs, both labeled J. Rivera Two cards, each with its own key pair and the same label, J. Rivera. One was made by J. Rivera’s employer, the other by an attacker. Both public keys look like valid random numbers, and both cards can sign a challenge. Nothing in the keys says which one really belongs to J. Rivera. Label: “J. Rivera” privatepublic 04 9c 2f 5a 73 b8 … Made by the employer Label: “J. Rivera” privatepublic 04 e1 7d 03 6a c9 … Made by an attacker ? Both key pairs work. The label is just text anyone can type.
A key pair carries no proof of who it belongs to. A name attached to it is only a claim.

Try it: two cards that both say “J. Rivera”

Your browser makes two real key pairs (ECDSA, P-256) and gives both the same label. The reader challenges each card. Nothing is sent or stored.

Card 1: “J. Rivera”

Made by the employer

Fingerprint: SHA-256 of the raw public key

…

Card 2: “J. Rivera”

Made by an attacker

Fingerprint: SHA-256 of the raw public key

…

Where this matters

A valid signature shows that the responder controls the private key matching the public key being checked. It doesn’t show whose key that is. Three places where the gap matters:

  • Key agreement. As lesson 1.4 showed, an attacker in the middle can hand each side her own public key. Each side ends up sharing a key with the attacker.
  • Access cards. A card with a self-made key pair passes the signature check. Unless the system knows which key belongs to which person, the check proves nothing about identity.
  • Software updates. A signature only helps if the device knows which public key really belongs to the publisher.

Ways to know whose key it is

There are three common answers, each with its place:

  1. Check a fingerprint out of band. A fingerprint is a hash of a specified encoding of the public key. Both parties compute it the same way and compare the complete value over an authenticated channel, such as in person. Reliable, but it doesn’t scale to thousands of cards.
  2. Trust on first use. Remember the key the first time you see it, and warn if it ever changes. Secure shell (SSH) clients commonly remember a host key on first use. That leaves the first connection exposed unless something else authenticates it: a trusted fingerprint, a preinstalled host key, or a trusted host CA.
  3. Let a trusted third party vouch for it. An authority you already trust signs a statement binding the public key to a name. That signed statement is a certificate, and it’s how access control systems handle keys at scale. The rest of this module builds it up.
Go deeperOptional technical detail for readers who want more

Impersonation scenarios

An attacker can swap a public key wherever keys are looked up, such as a directory or an enrollment database, so that later checks accept the attacker’s key. A rogue card can carry its own key pair and a matching, self-made certificate. And a fake update server can sign malware with its own key. In each case the signature checks out; what fails is the assumption about whose key it is.

Fingerprints in practice

A fingerprint is usually a SHA-256 hash of a specific encoding of the public key, shown in hex or split into groups for reading aloud. Two fingerprints are only comparable if they were computed over the same encoding with the same hash. Comparing the complete value is reliable; comparing only the first few characters is not, because an attacker can generate keys until the first few characters match. The demo above shows complete SHA-256 fingerprints of the raw public keys.

Why access control uses certificates

A site may have thousands of cards, issued over years, and readers that have never seen most of them. Checking fingerprints by hand is impossible at that scale, and trust on first use would accept the first card anyone presents. Certificates let a reader or access control system accept a card it has never seen, because a trusted authority has vouched for it in advance.

Sources

Draft lesson, awaiting technical review · Last updated 21 November 2026

Search

Press / to search from any page