Make an age key pair, and use it with the age encryption tool
SecureSecretStore is not open yet. Its design uses key pairs in the age format, of the classic
X25519 kind. This page shows two ways to make one and how to use it with the age encryption tool. The
age-keygen way works today; the free tool arrives shortly. Neither needs an account.
What do I get?
Two lines of text:
| half | starts with | who sees it |
|---|---|---|
| public key (recipient) | age1 |
anyone you want to receive encrypted values from |
| secret key (identity) | AGE-SECRET-KEY-1 |
only the device that made it |
A value encrypted to the public key opens only with the secret key. The public key can be posted anywhere. The secret key should never leave the device that made it.
Way 1: the free tool in your browser
- Open the free key tools on the home page and choose Make an age key pair.
- The tool shows the public key, the secret key hidden behind Show, and the key's fingerprint.
- Run the tool on the device that will use the key, and save the secret key there with Copy or Download.
The key is made in your browser by a WebAssembly module, and nothing is sent. You can check that yourself: open your browser's developer tools on the Network tab, make a key and watch that no request goes out, or load the page, turn off your network, and make a key offline.
Way 2: age-keygen on the command line
Install the age encryption tool. On macOS, brew install age; on Debian 12 or later and Ubuntu 22.04 or later,
apt install age; on Windows, winget install --id FiloSottile.age. The
project's README lists every other package and the pre-built
binaries.
Check which version you have, because the right command depends on it:
age --version
| version | to make an X25519 key pair |
|---|---|
| 1.4.0 or later | age-keygen -pq=false -o key.txt |
| 1.3.x | age-keygen -o key.txt (classic is the default) |
| 1.2.1 or earlier | age-keygen -o key.txt (only classic keys exist) |
Version 1.4.0, released on 1 December 2026, changed the
default: age-keygen with no flags now makes a post-quantum hybrid key, whose public key starts with age1pq1 and is
about 2,000 characters long. Versions 1.2.1 and earlier stop with flag provided but not defined: -pq if you pass the
flag.
On version 1.4.0:
$ age-keygen -pq=false -o key.txt
Public key: age1zclk3f7hzjsdzxdp7flytqdjz5ltyjfu34mcphjr9fsa2vxyq3hsjyech8
$ cat key.txt
# created: 2026-12-05T20:17:58Z
# public key: age1zclk3f7hzjsdzxdp7flytqdjz5ltyjfu34mcphjr9fsa2vxyq3hsjyech8
AGE-SECRET-KEY-1…
The file holds the secret key, with the public key in a comment. With -o, age-keygen creates the file readable only
by you (mode 600 on macOS and Linux) and refuses to overwrite one that exists. Keep it that way.
Lost the public key? Get it back from the secret key at any time:
age-keygen -y key.txt
Check the key
Paste the public key into Check a key's fingerprint on the home page, or run the script on Check a fingerprint:
$ python3 age-fingerprint.py "$(age-keygen -y key.txt)"
05c6 f091 667b d9bc caf0 bd0a 496d 871d
The free tool and the script must show the same 8 groups for the same key.
Encrypt and decrypt a test value
Encrypt to the public key with -r, decrypt with the secret key file with -i:
printf 'sk_test_example_value\n' | age -r "$(age-keygen -y key.txt)" -o test.age
age -d -i key.txt test.age
The second command prints sk_test_example_value. Version 1.4.0 also prints this on both commands, because the key is
a classic one:
age: warning: the encrypted file could be decrypted by a future quantum computer, see https://age-encryption.org/pq-warning
The linked page is the age project's explanation.
To see what the encrypted file says about itself without decrypting it, use age-inspect (version 1.3.0 and later):
$ age-inspect test.age
test.age is an age file, version "age-encryption.org/v1".
This file is encrypted to the following recipient types:
- "X25519"
This file does NOT use post-quantum encryption.
…
It goes on with a size breakdown: the header, the encryption overhead, and the exact length of the value.
Encrypt to several readers at once
Put one public key per line in a recipients file. Lines starting with # are comments:
# laptop
age1zclk3f7hzjsdzxdp7flytqdjz5ltyjfu34mcphjr9fsa2vxyq3hsjyech8
# phone
age10mmamr9j8j7wsjpw6lqvyl33zf8uw2qk5cxsazea56z2jguetflsm5e68l
# recovery kit
age1z55r3z88f67sp5nv4leaajmehah4haus8hcdd37lx8e5wxwp9pksw5hht2
printf 'sk_test_example_value\n' | age -R readers.txt -o shared.age
Any one of the three secret keys now decrypts shared.age. This is the same thing SecureSecretStore is designed to do
for every version of a secret: one encrypted value, wrapped once for each reader's key. See
How the encryption works.
You cannot mix kinds. Versions 1.3.0 and later refuse to encrypt to a classic key and a post-quantum key in the same file, because the classic one would undo the post-quantum protection:
age: error: incompatible recipients: can't mix post-quantum and classic recipients, or the file would be vulnerable to quantum computers
Where should the secret key live?
- On a laptop or server: a file only your user can read, outside any repository. Add it to
.gitignoreif it sits near one. - In the browser: SecureSecretStore's web app is designed to keep it encrypted under a key the page cannot export.
- For an AI agent: in the agent runtime's own secret storage, readable by the code that calls other services and never placed in the model's prompt. See How to give an AI agent an API key without putting it in the prompt.
Make one key pair per device. If one secret key is copied to several machines, losing any one of them exposes all of them. A key per device, and the recovery kit explains how devices are added and removed.
For more on the format itself, including the post-quantum keys, read What is an age key, and how do I make one?.
For agents and tools: llms.txt. AI version of this page.