Definition
Proof of possession (PoP) is a protocol step in which a prover shows a verifier that it can use a particular secret key, without revealing the key. The prover applies the key to a message that the verifier checks, usually one containing a fresh random value: it computes a digital signature §5.14, which anyone with the matching public key can check, or a message authentication code §5.7 (MAC), a tag that only holders of a shared key can compute. A valid result shows that the key was used on that message.
The idea
Two everyday situations need such a proof. The first is certificate issuance. A certificate authority (CA) is an organization that signs certificates: statements that a given public key belongs to a given name. If a CA certified any public key it received, Mallory could submit Alice’s public key under Mallory’s own name. Documents that Alice signs would then also verify under a certificate that names Mallory, and Mallory could claim them as Mallory’s own. CAs therefore require each certificate request to be signed with the private key that matches the public key in the request. PKCS #10 (Public-Key Cryptography §5.15 Standards number 10), the usual format for such requests, published as RFC 2986 [331], works this way.
The second is key installation. A management server tells a device to install a new key, and the device replies installed. Any device, or any attacker on the link, could send that reply, and the reply does not show that the key was stored correctly. If the server stops using the old key on the strength of that reply while the device in fact holds a corrupted copy, the server can no longer reach the device.
The idea is to demand an action that only a key holder can perform, on a value that did not exist before the question was asked. A notary who watches you sign a fresh page learns more than one who accepts a photocopy of an old signature, because the photocopy could come from anyone who once saw a signed document. The verifier’s fresh random value plays the part of the fresh page. The picture stops at the signer: a cryptographic proof shows that the key was used, not which person or which chip used it.
How it works
A challenge–response proof of possession runs in five steps.
Select the key. The verifier decides from its own trusted records which key it expects: for example, the public key it registered for device A during key provisioning §5.28, when the device received its first keys, or the key it has just told device A to install. Nothing in the prover’s message chooses this key.
Issue a challenge. The verifier draws a challenge, a nonce §5.18 (a value used only once) of at least 16 random bytes, from a cryptographically secure pseudorandom number generator §5.27 (CSPRNG). It stores a pending record: the challenge, the device asked, the operation the proof is for, the key epoch (the number of the key generation in use) and an expiry time.
Respond. The prover builds a response message that holds a fixed purpose label followed by these same fields in a fixed layout, and signs it or computes a MAC over it with the key.
Verify. The verifier looks up the pending record for the challenge, checks that every field of the response equals the field in the record, and checks the signature or MAC with the key selected in step 1.
Consume. After accepting a response, the verifier deletes the pending record, so that the same challenge can never be accepted twice. It also deletes records whose expiry time has passed.
Each part of the context is bound by its own mechanism:
to the key, by the signature or MAC, which only a holder of the key can produce if the scheme cannot be forged;
to the device, by the verifier’s own record that this key belongs to device A, made at provisioning or by a certificate, and by device A’s identifier inside the signed bytes;
to the operation, by the purpose label and the operation field inside the signed bytes, which keep a response made for one purpose from being accepted for another; this use of a fixed label is called domain separation §5.22;
to freshness, by the challenge, which did not exist before step 2, and by the single-use pending record.
A proof can also travel without a round trip. The prover then signs a counter or a timestamp in place of a challenge, and the verifier needs other state to reject old proofs: the highest counter it has accepted from this prover, or a trusted clock, a short acceptance window and a list of the proofs already seen inside that window.
Worked example
A verifier V asks device A to prove that it can use the key it has just installed, the key of epoch 5. V and A share this key, and the proof is an HMAC-SHA-256 §5.9 tag: HMAC §5.8 (hash-based message authentication code) computed with SHA-256 §5.2 (Secure Hash Algorithm with a 256-bit output), which gives a 32-byte tag. V draws the 16-byte challenge 9f3c27a1b6d04e58c2f17a93d06b4ee1, written in hexadecimal, and stores the pending record: device A, operation key-confirm, epoch 5, this challenge, expiry in 30 seconds.
The response message has fixed field widths, so it can be read only one way:
purpose label
PoP1: 4 bytes;device identifier: 8 bytes;
operation code §2.8
0x02, meaning key confirmation §5.42: 1 byte;key epoch 5 as a 32-bit number: 4 bytes;
challenge: 16 bytes.
The message is bytes. A computes the 32-byte tag over these 33 bytes and sends both, bytes in all. V compares the fields with its record, recomputes the tag with the key of epoch 5, compares the two tags and deletes the record.
Three attacks fail. An attacker who recorded A’s valid response to yesterday’s challenge sends it again: its challenge field differs from the pending one, so V rejects it, and if the attacker overwrites the challenge field with today’s value, the tag no longer matches the 33 bytes. An old response to an unlock request, operation code 0x01, fails because the operation field differs. A response computed by another device fails because its device field and its key differ from V’s record.
Collecting old responses does not help. With 16 random bytes there are possible challenges, so even recorded responses contain the answer to the next challenge with probability at most . Two mistakes undo this. If V checks only that the tag is valid over whatever bytes arrive, without comparing the fields with its record, yesterday’s response passes. If V’s challenges are predictable, for example the previous challenge plus 1, an attacker who can briefly make the key compute, through a signing service or a moment of access to the device, obtains the responses to the next 1,000 challenges in advance and uses them later.
Stated precisely
Let be the key that the verifier’s trusted records assign to device for key epoch . Let be the encoding of the purpose label , the device , the operation , the epoch and the challenge , fixed so that different field values always give different byte strings. The verifier accepts a response , in which is the tag or signature, exactly when
it holds an unexpired, unconsumed pending record that it created itself, and
verifies under as a tag or signature on ;
on acceptance it marks the record consumed.
Guarantee: if the verifier accepts, then some party able to use computed on exactly these field values after the challenge was issued, except with probability at most . Here is the number of random bits in the challenge, is the number of tags or signatures under that the attacker obtained, on messages of its choice, before the challenge was issued, and is the probability that the attacker forges a tag or signature on a message for which no key holder computed one. The guarantee rests on four assumptions.
Unforgeability: the signature or MAC scheme is existentially unforgeable under chosen-message attack, meaning that no feasible attacker, even after seeing valid results on messages it chose, produces a valid result on any new message, except with the small probability .
Fresh challenges: each challenge is drawn uniformly from values, independently of everything before it.
A correct key record: the verifier’s record that belongs to is right.
An exclusive format: no key holder computes results under on messages that carry the label for any other purpose; with a shared key this includes the verifier itself.
Limits and common mistakes
Possession is not identity, location or intent. A secure element §5.38 (a chip that stores a key and uses it without releasing it), a signing service or a relay can produce the answer. A relay that forwards the live challenge to the real key holder passes every check above, because the proof says nothing about distance. A signing service that signs whatever any caller submits is a confused deputy §1.25: a program with authority that is tricked into using that authority for someone else.
Possession is not correct installation. A device can prove that it holds the new key while its stored settings, its other keys or its software are wrong. The entry on key confirmation versus application confirmation separates these two checks.
A proof without a challenge or verifier state shows only that the key was used at some time. A signed statement “I hold key ” can be recorded and sent again forever; sending it again is a replay attack §1.26.
With a shared key, the verifier can compute every valid tag itself. If the verifier also answers challenges in the same format, an attacker can pass the verifier’s own challenge back to the verifier in a second session and return the verifier’s answer as the prover’s; this is a reflection attack. A role field that names the prover, checked against the pending record, stops it.
A challenge that the prover chooses, or that the verifier computes from data the prover sent, gives no freshness.
How much freshness a proof needs depends on what the proof authorizes. A certificate request carries no challenge, and that is acceptable: replaying Alice’s signed request only gets Alice’s key certified for Alice’s name again. A proof that unlocks an operation needs the challenge.
Questions answered
What binds the demonstration to this device, operation, and freshness context?
Three things bind a proof of possession to its context, and all three are needed. First, the bytes that the prover signs, or covers with a message authentication code (MAC), must contain a fixed purpose label, the device’s identifier, the operation the proof is for, the key epoch (the number of the key generation) and the verifier’s challenge, in a fixed layout that can be read only one way; changing any field then invalidates the signature or tag. Second, the verifier must compare each of those fields with its own pending record, not with values the prover supplies, and must check the signature or tag with the key that its own trusted records assign to that device. Third, freshness comes from the challenge: at least 16 random bytes that the verifier generated when it asked, stored as pending, and accepted once only and before an expiry time.
Without the challenge or the pending record, an old valid response can be replayed. Without the device and operation fields, a response made for one device or one purpose can be reused for another. Even with all three, the proof shows only that the key was used; it does not show where the key is stored, who approved its use, or that the device’s other state is correct.
Related entries: Key confirmation versus application confirmation (§5.42), Nonce (§5.18), Confused deputy (§1.25), Replay attack (§1.26), Digital signature (§5.14), Key provisioning (§5.28). Further reading: [331].