Definition
A key-lifecycle table is a table that lists the operations that change which cryptographic keys a device holds, with the state each operation requires and the state it leaves. Typical operations are staging (storing a new key without using it), activation (making the staged key the one in use) and revocation (marking a key as no longer acceptable). A coverage table marks, for each listed operation or transition between states, whether it is implemented and whether a test exercised it.
Where it fits
Main entry: Idempotency (§8.31).
The idempotency entry explains how a sender can safely repeat a request whose outcome is unknown, and the replay attack §1.26 entry describes an attacker who records a genuine message and sends it again. The two meet in a key lifecycle. A device stages a new key and sends an acknowledgment, but the acknowledgment is lost, so the sender tries again. An exact retry is that second sending: the same request, with the same identifier and the same authenticated content, sent because the sender does not know whether the first copy arrived. A replay is a copy, sent by anyone, that seeks an effect the device’s current state should refuse. A retry and a replay can be identical bytes, including the value that proves who produced them, so the device cannot tell them apart by the message. It decides by comparing the message with the state it keeps.
In an invented case, the device’s stored state records request 17 as committed, meaning permanently applied, and the active key version as 8. The device keeps 8 as a version high-water mark §8.27: it refuses any request for an older version.
Request 17 arrives again with identical content. Under an idempotent rule, the device answers “request 17 committed, version 8” from its record and changes nothing. The answer is harmless whoever sent it: a retrying sender learns the outcome, and an attacker gains no effect.
Request 17 arrives with different content, for example naming version 9. Its identifier was already used for something else, so the device rejects the message as a conflict.
Request 16, recorded earlier by an attacker, arrives and asks to restore version 7. Its authentication §1.6 value is still valid, but , so the high-water mark rejects it. This is a replay, and the freshness check stops it, not the authentication.
The exactly-once effect §8.32 entry describes the full construction on the device’s side.
The same distinction binds the sender. Suppose an operator’s tool signs requests for the device, meaning that it attaches a value that only a holder of its key can compute, such as a message authentication code §5.7 (MAC). The response to a request that stages key A is lost. The tool now holds an in-doubt request: the device is either in the state before that request or in the state after it, and the tool cannot tell which. A sound tool keeps a ledger: before it sends each request, it writes the exact signed bytes to durable storage, meaning storage that survives a crash or a loss of power. It also allows at most one in-doubt request per device. The tool may then do either of two things. It may send the stored bytes again unchanged, an exact retry, which the device applies once or answers from its record. Or it may ask the device for its current state with an authenticated status request, and mark the ledger entry done or not done.
The tool may not sign a new request for the same change. A new request carries a new identifier, and perhaps a freshly generated key B, so two valid requests now exist for one intended change. If both arrive, the original request first and the new one second, the device makes two changes where the operator intended one, and ends with key B staged. If the only response that reaches the tool is a late answer to the first request, the tool records key A while the device holds key B. The rule of one in-doubt request keeps the device in one of two known states, which a single retry or status request settles.
A coverage table for the same lifecycle needs three separate marks, because each records a different fact: the transition is listed in the design; a handler for it is implemented in the code; and a test exercised it, meaning that the test drove the device through the transition and checked the resulting state. In an invented table with 6 listed transitions, 5 implemented and 3 exercised, the tested share is of the design but of the code, so every percentage must name its denominator. An empty cell, meaning that nothing was measured, also differs from a cell that holds 0, meaning that it was measured and none occurred.
All data in this entry’s examples are invented.
Limits and common mistakes
A valid authentication value shows who produced a request, not that the request is allowed now. Whether an old authentic request is acceptable is decided by the receiver’s state, such as a version high-water mark or a record of committed request identifiers.
Calling a repeat a retry proves nothing. The receiver treats a repeat as a retry only when its identifier, its content and the recorded outcome all match.
The record of committed requests must be kept in storage that survives a loss of power. Otherwise a retry that arrives after a restart is treated as a new request.
A device that remembers only its latest request cannot answer a retry of an older request from its record. It must reject that retry, and the sender then learns the outcome with a status request.
The rule of one in-doubt request limits throughput: the tool waits for each outcome before it signs the next request. That is the price of always knowing which state the device is in.
A table that describes a design, including one that is not printed, does not establish what an implementation does or what its tests cover. The coverage metric §10.18 entry discusses what a share of exercised items does and does not show.
Questions answered
Why distinguish an exact retry from a replay attack?
An exact retry and a replay attack must be told apart because the same bytes can be either one, and the receiver must give a repeated request no new effect while still letting a legitimate sender learn the outcome. An exact retry is a sender resending its own request, with the same identifier and content, because it never learned whether the first copy arrived. A replay attack is a recorded genuine message sent again to obtain an effect that the receiver’s current state should refuse. Both carry a valid authentication value, such as a message authentication code (MAC), the value that proves who produced the bytes, so neither the bytes nor that value separates them.
The receiver separates them by its stored state. A repeat of the request it last committed, with identical content, is answered from its record and changes nothing; this serves the retrying sender and gives an attacker nothing. A request for a version below its high-water mark, the highest version it has committed, is rejected even though its authentication value is valid. A design that rejected every repeat would leave a sender whose acknowledgment was lost unable to learn the outcome; a sender that then signs a new request for the same change risks a second change. A design that executed every repeat would let an attacker apply a change twice or undo a later one.
Related entries: Replay attack (§1.26), Exactly-once effect (§8.32), Coverage metric (§10.18), Version high-water mark (§8.27), Key rotation (§5.29).