Definition
A recovery key is a secret, kept apart from the keys used in daily operation, whose purpose is to restore access or control when those everyday keys or passwords are lost, forgotten or compromised. It comes in two forms. An unlock recovery key opens the same protected data by a second route, as the recovery key of an encrypted disk does. An authority recovery key authorizes replacing the everyday keys themselves. Whoever holds a recovery key, owner or thief, can do everything the recovery policy allows.
The idea
Every credential can be lost. A laptop’s disk is encrypted with a key that only the laptop’s own security chip can release; when the motherboard carrying that chip is replaced, the key can no longer be released, and without a second way in every file is gone. A fleet of devices obeys commands signed with a management key; if that key is stolen, the operator must tell the devices to stop obeying it, and the stolen key cannot be the tool for that, because the thief holds it too. A recovery key is the second way in, prepared in advance and stored somewhere else.
A recovery key is not a spare copy of the everyday key but a separate credential, and usually a more powerful one. Its power is set by the recovery policy: the exact list of operations that the system performs when it receives a valid recovery request. A house gives a fair picture. A spare key in a safe-deposit box opens the same door as the everyday key; that is the unlock form. Authority to have the lock changed is the authority form, and whoever has that authority chooses who holds the next key. The picture stops at judgment: a locksmith may ask questions, but a device carries out any request that its policy allows and that carries a valid signature.
How it works
Setting up and using a recovery key takes five steps.
Generate the recovery key at setup with a cryptographically secure pseudorandom number generator §5.27 (CSPRNG), independently of the everyday keys. If both are derived from one root key §5.25 that every device holds, stealing that root yields both, and the separation exists only on paper.
Write the policy: the exact operations that a valid recovery request may perform, such as unlocking data, erasing the device, activating a backup key fixed at setup, or installing any new key named in the request.
Store the recovery key where everyday attacks cannot reach it: printed and locked away; offline in a hardware security module (HSM), a device built to store keys and use them without releasing them; or split with threshold secret sharing §5.44 into shares held by different custodians, so that any of the shares rebuild it and fewer reveal nothing about it.
Use it through a request that names the target device, the operation, the new key epoch (the number of the key generation) and a fresh challenge or counter, all covered by the recovery key’s signature or message authentication code §5.7 (MAC), so that a recorded request cannot be replayed later or sent to another device.
Replace the recovery key after use whenever the use exposed it, for example when a printed recovery code was typed into a computer that may be compromised. Backup codes for online accounts are typically single-use.
The unlock form usually rests on key wrapping §19.1.12, the encryption of one key under another. The data is encrypted once, under a data key . is then stored twice: once wrapped under a key derived from the user’s password, and once wrapped under the recovery key . Either route unwraps . Changing the password re-wraps under the new password but leaves the copy wrapped under untouched, so keeps working until it is replaced.
The authority form follows the same pattern one level up. In The Update Framework §21.10 (TUF), a design for securing software-update systems, each signing job is a role, the keys of the root role are kept offline, and the root role signs the list of keys trusted for each of the other top-level roles. When an online signing key is stolen, the root keys sign a new list without it.
Worked example
A fleet of devices obeys commands signed with a management key at key epoch 7. Each device also holds the public half of a recovery key . An attacker steals the private half of . Compare two recovery policies.
Policy 1: replace with any key. A recovery request replace-key signed with installs whatever public key it names. The attacker generates its own key pair, with public half , signs a replace-key request for device A, epoch 8 and key , and sends it. Device A checks the signature, which is valid, installs and moves to epoch . From then on it rejects commands signed with , which belongs to epoch 7, and obeys the attacker. The owner, who also holds , can answer with a replacement of its own, and the attacker can answer that in turn: whoever sends last controls the device.
Policy 2: activate a pre-committed backup. At setup, each device stores the 32-byte SHA-256 §5.2 hash (Secure Hash Algorithm with a 256-bit output) of a backup public key ; the private half of is in a safe and never on a networked computer. A recovery request activate-backup signed with may only switch the device to the key whose hash it stored, at epoch 8. The attacker can force that switch, so stops working and the owner must fetch from the safe. The attacker gains no key that the device obeys. The worst outcome is a forced change of key, a denial of service §1.28, not a takeover. The policy also needs a rule for a device whose backup has already been used: it refuses activate-backup until a command signed with commits to a new backup, and it never falls back to accepting any key.
A custodian variant. Split with threshold secret sharing into shares with threshold , held by three custodians in different places. Stealing one share reveals nothing about . The attacker must compromise 2 of the 3 custodians, and a legitimate recovery still succeeds when custodian is unavailable.
Stated precisely
Describe a device’s control state as the pair , in which is the set of keys whose commands the device obeys and is the key epoch. A recovery policy is a set of permitted transitions from one control state to another. For a current state , let be the set of states that a holder of the recovery key can reach from by a sequence of valid recovery requests. The contract has two parts.
Anyone who holds the recovery key, owner or attacker, can move the device to any state in , and to no other state.
The damage that a stolen recovery key can do is therefore the worst state in .
Under policy 1 of the example, contains for every key , including keys that the attacker created. Under policy 2 it contains only , so the attacker controls the device only if it also holds the private half of . These conclusions assume that the device enforces exactly, that every recovery request is bound to the device, the epoch and a fresh challenge or counter, and that the signature scheme §5.14 cannot be forged. The effect of a recovery outlasts the recovery session, so judging a recovery key only by how well the session is kept secret misses its main consequence.
Limits and common mistakes
A recovery key is often the most powerful credential in a system and the least used, so it gets the least attention. Storing it offline lowers the chance of theft; it does not reduce what the key can do.
A recovery path must not bypass the protections of the normal path. If recovery accepts an older software version, resets a monotonic counter §8.28 (a stored counter that may only increase) or skips freshness checks §1.26, an attacker uses recovery to bring back an old, weaker state, which is a downgrade attack §1.27. Recovery should raise the key epoch, never lower it.
Account recovery through a weaker channel makes the account only as strong as that channel. Codes sent by text message can be intercepted after a SIM swap, in which an attacker persuades a mobile operator to move the victim’s phone number to a new SIM (subscriber identity module) card.
For the unlock form, losing both the password and the recovery key loses the data permanently; that is the intended behavior of encryption, not a fault. Storing the recovery key with a third party, called key escrow, such as an employer’s directory or a cloud account, gives that third party the power to decrypt.
Recovering control does not recover secrecy. Whatever the attacker read before the recovery stays read, and every key the attacker saw must be replaced, not only the one that triggered the recovery; the key rotation §5.29 and post-compromise security §5.34 entries treat this.
A recovery path that is never exercised may fail when it is needed: the printout is lost, a custodian has left, or the device rejects the request format. Rehearse it.
Questions answered
Can recovery authority §1.46 install a key chosen by an attacker who holds it?
Yes, whenever the recovery policy lets the holder of the recovery key name the new key. A valid signature or message authentication code (MAC) on a recovery request proves only that the recovery key was used; it says nothing about whether the requested key is benign. An attacker who holds the recovery key therefore generates a key pair of its own, signs a request to install the public half, and from then on controls the device, while the legitimate owner’s old key is rejected.
To prevent this, narrow what recovery can do. Allow it only to activate a backup key whose hash was fixed at setup and whose private half is stored elsewhere; require approval from several independent custodians, for example 2 of 3 with threshold secret sharing; or require physical presence at the device. If the policy must allow arbitrary replacement, then the secrecy of the recovery key is an assumption on which the security of the whole system rests, and the design should state it.
Related entries: Recovery authority (§1.46), Key separation (§5.23), Key rotation (§5.29), Threshold secret sharing (§5.44), Key revocation (§5.32), Recovery and anti-rollback can conflict (§17.11). Further reading: [211].