# Lost a device or your keys? How recovery works with end-to-end encryption

> With end-to-end encryption the provider never holds your key, so it cannot reset it. Recovery has to be set up in advance: a second device, an offline recovery key, or another person who can re-share. Test it before you need it.

Updated 2026-12-05 by SecureSecretStore.

If you have just lost a device: start with [what to do now](#what-should-i-do-right-after-losing-a-device). If you are
setting up a service that uses end-to-end encryption, the rest of this article explains why recovery works the way it
does, and how to set it up so a loss is an inconvenience instead of a disaster.

## Why can't the provider just reset my key?

With ordinary services, "forgot password" works because the provider can read your data and simply lets you set a new
password. With end-to-end encryption, your data is encrypted with keys that exist only on your devices. The provider
stores ciphertext it cannot open.

So there is nothing for the provider to reset. A service that *can* restore your data without any of your keys is, by
definition, a service that can decrypt it. Apple says this plainly for its Advanced Data Protection: if you lose
access, "Apple will not have the encryption keys to help you recover it"
([iCloud data security overview](https://support.apple.com/en-us/102651)).

Recovery therefore has to be arranged **before** the loss, by putting a second way to decrypt somewhere safe.

## What are the ways to recover an end-to-end encrypted account?

Every service uses some mix of three:

| path | what it is | what it protects against | what it costs you |
|---|---|---|---|
| another device | a second phone, laptop or tablet that already has access | losing one device | nothing extra, but a fire or theft can take them all |
| a recovery key | a secret you keep offline, on paper or a drive | losing every device | keeping it safe, and knowing where it is in five years |
| another person | someone who can help you back in, or re-share to you | losing every device and the key | trusting them, and their availability |

How three well-known services use them:

- **Apple Advanced Data Protection** requires at least one recovery contact or a recovery key before you can turn it on
  ([Apple](https://support.apple.com/en-us/102651)). The recovery key is "a 28-character code", and "If you lose it,
  Apple can't provide you with your recovery key" ([Apple](https://support.apple.com/en-us/109345)). A recovery
  contact "won't have any access to your account, only the ability to give you a code"
  ([Apple](https://support.apple.com/en-us/102641)).
- **1Password** combines your account password with a Secret Key generated on your device, with "128 bits of entropy".
  "We have no record of your Secret Key and can't recover it"
  ([1Password](https://support.1password.com/secret-key-security/)). The
  [Emergency Kit](https://support.1password.com/emergency-kit/) is a printable sheet that "contains everything needed
  to sign in", with a blank where you write your account password yourself.
- **Bitwarden** lets a trusted contact request emergency access to your vault, granted after a wait time you choose,
  as either view-only or takeover access ([Bitwarden](https://bitwarden.com/help/emergency-access/)).

Notice the common rule: every recovery path is also an access path. A recovery key on paper opens your data for
whoever finds the paper. A trusted contact with takeover rights is trusted with your data. Choose recovery paths you
would be comfortable seeing used by someone other than you.

## How does a recovery key work, technically?

In many designs the recovery key is simply **one more reader**, either of each value or of an account key that
unlocks them. When a value is encrypted, it is encrypted to each of your devices and to the recovery key. Lose every
device, and the recovery key still decrypts everything. (Other designs differ: 1Password's Emergency Kit holds your
sign-in secrets, and Apple's recovery key works together with a trusted phone number and an Apple device.)

You can see this with the [age encryption tool](https://github.com/FiloSottile/age), which encrypts one file to
several keys at once. The following run is real, with version 1.4.0, whose `age-keygen` makes post-quantum keys by
default. Your keys will differ, and the long public keys are shortened here.

Make a device key and a recovery key, and encrypt a value to both:

```console
$ age-keygen -o laptop.txt
Public key: age1pq1q2mx62jhksvwtnzs3jeg5…
$ age-keygen -o recovery.txt
Public key: age1pq1lxn9lk3542kx3sfws2qlz…
$ age-keygen -y laptop.txt > readers.txt
$ age-keygen -y recovery.txt >> readers.txt
$ printf 'ghp_exampletoken\n' | age -R readers.txt -o github-token.age
```

(Versions before 1.4.0 make classic X25519 keys with the same command. The steps work the same way, and version 1.4.0's
`age` command warns whenever it encrypts or decrypts with a classic key. See [What is an age key?](https://securesecretstore.com/articles/what-is-an-age-key).)

Now "lose" the laptop, and recover with only the recovery key:

```console
$ mv laptop.txt laptop.txt.lost
$ age -d -i recovery.txt github-token.age
ghp_exampletoken
```

Set up a new laptop, and encrypt again to the new key and the recovery key, leaving the lost laptop out:

```console
$ age-keygen -o new-laptop.txt
Public key: age1pq168z8zavu3p7swp27xu7rv…
$ { age-keygen -y new-laptop.txt; age-keygen -y recovery.txt; } > readers.txt
$ age -d -i recovery.txt github-token.age | age -R readers.txt -o github-token.age.new
$ mv github-token.age.new github-token.age
$ age -d -i new-laptop.txt github-token.age
ghp_exampletoken
$ age -d -i laptop.txt.lost github-token.age
age: error: no identity matched any of the recipients
age: report unexpected or unhelpful errors at https://filippo.io/age/report
```

The lost laptop's key no longer opens the current file. It can still open any **old copy** of the file it already
had, which is why the next section says to change the secret itself.

## What should I do right after losing a device?

1. **Remove the device from every service it could access,** from another device or with your recovery key. In some
   end-to-end designs, SecureSecretStore's among them, this re-encrypts your data to the keys that remain.
2. **Treat every secret the device could read as exposed.** Removing the device stops it reading *new* versions. A
   thief with the device may already hold the old ones. Change the value at its source: issue a new API key at the
   provider, change the password, revoke the token.
3. **Sign out the device's sessions** and revoke its API keys, if the services offer it.
4. **Add a new device** with its own new key, and compare its fingerprint when you approve it (see
   [Check a fingerprint](https://securesecretstore.com/help/check-a-fingerprint)).
5. **If you used your recovery key,** consider it seen. Make a new one, add it as a reader, and remove the old one.

## How do I store a recovery key so it survives?

An age secret key is one line: 77 characters starting `AGE-SECRET-KEY-PQ-1` for a post-quantum key, or 74 starting
`AGE-SECRET-KEY-1` for a classic one. That is short enough to print and type back.

- **Print it, or write it out, and keep it where your devices are not:** a safe, a safe deposit box, a trusted
  relative's home. Two copies in two places beat one.
- **Do not keep the only copy in a cloud drive or password manager you would need a lost device to open.** That is a
  loop, not a backup.
- **Type it back exactly, in capitals.** The key has a checksum, so a typo is caught rather than silently producing a
  different key. `age-keygen -y` is a quick test: run it, type or paste the key, and press Ctrl-D. It prints the public
  key for a correct key and fails for a wrong one, without writing the key to disk.

```console
$ age-keygen -y
AGE-SECRET-KEY-PQ-1…   (typed back, with one character wrong)
age-keygen: error: failed to parse input: error at line 1: malformed secret key: invalid checksum
age-keygen: report unexpected or unhelpful errors at https://filippo.io/age/report
```

A key typed in lowercase fails too (`unknown identity type`), so keep the capitals.

## How do I know my recovery setup actually works?

Test it, once when you set it up and again every year or so. Most recovery failures are discovered at the worst
possible moment: the paper was lost, the key was never added to new data, or the trusted contact changed phones.

A test takes two minutes:

1. Take the recovery key out of storage, on a computer you trust.
2. Decrypt one real, recent value with only the recovery key, typed or pasted at the prompt instead of saved to a
   file: `age -d -i - github-token.age`, then the key, then Ctrl-D. Secure deletion is unreliable on SSDs and with
   snapshots and backups, so never writing the key to disk is the safer habit.
3. Put the key back.

If step 2 fails, your recovery key is not a reader on recent data, and you have found out in time.

## What about shared and team accounts?

Teams have one more path: another member who can still decrypt can re-share to your new key. That is why a shared
vault should always have at least two owners. A vault with one owner who loses every device and the recovery key is
as unrecoverable as a personal one.

## How does SecureSecretStore handle a lost device or key?

SecureSecretStore is not open yet. In its design, every device and agent runtime holds its own key pair, so a lost
device is removed from any other device, and the client re-encrypts your secrets to the keys that remain. Before your
first real vault opens, you create a recovery kit: a second key pair whose public half is a reader on everything you
own, downloaded or printed, and confirmed by typing its last 6 characters. If you lose every device, the kit approves a
new one; in a shared vault, another owner can also re-share to you. Without a device, the kit or another owner, the
values are gone, and no one, including SecureSecretStore, can recover them. The site says so before you sign up.

The details are in [A key per device, and the recovery kit](https://securesecretstore.com/help/devices-and-recovery-kit).

## Links

- This page for people: https://securesecretstore.com/articles/lost-device-encryption-key-recovery
- Every AI version on this site: https://securesecretstore.com/llms.txt

How little we track: no tracking scripts, no third-party scripts, no ad or analytics cookies. https://securesecretstore.com/privacy.md
