age-plugin-rypt
age-plugin-rypt is a plugin for
age that encrypts files to a rypt key. age encrypts each
file under a new 16-byte file key, and the file's header holds that file key encrypted
once for each recipient. For a rypt recipient, the plugin has rypt encrypt the file
key and stores the ciphertext in the header; to decrypt, it sends that ciphertext to
decrypt and gets the file key back. The file does not reach rypt, but its file key
does, so this is not zero-knowledge. This is direct mode on the file key alone: see
direct or envelope.
Install
Section titled "Install"age finds the plugin on your PATH by its name, age-plugin-rypt. Install it in one of
these three ways; afterwards, age-plugin-rypt --version prints age-plugin-rypt 0.2.0.
It runs on Linux and on macOS 13 Ventura or later; there is no Windows build. You also
need age itself. The output on this page is from age 1.2.1.
With Homebrew
Section titled "With Homebrew"brew install x6c-co/tap/age-plugin-rypt
This installs the prebuilt binary and, with it, Homebrew's age.
From a release
Section titled "From a release"Each release from v0.2.0 on has a
tarball for linux-amd64, linux-arm64, darwin-arm64 (Apple silicon) and
darwin-amd64 (Intel), and a SHA256SUMS file. For Linux on x86_64, download both and
check the sum; on another platform, put its target, such as darwin-arm64, in place of
linux-amd64 in each command below:
curl -fsSLO https://github.com/x6c-co/age-plugin-rypt/releases/download/v0.2.0/age-plugin-rypt-v0.2.0-linux-amd64.tar.gz
curl -fsSLO https://github.com/x6c-co/age-plugin-rypt/releases/download/v0.2.0/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
age-plugin-rypt-v0.2.0-linux-amd64.tar.gz: OK
On macOS, check it with shasum -a 256 -c --ignore-missing SHA256SUMS. The sum shows
that the tarball matches SHA256SUMS. To check that the release workflow built it from
the v0.2.0 tag, run this with the GitHub CLI, which exits 0
when it did:
gh attestation verify age-plugin-rypt-v0.2.0-linux-amd64.tar.gz --repo x6c-co/age-plugin-rypt --signer-workflow x6c-co/age-plugin-rypt/.github/workflows/release.yml --source-ref refs/tags/v0.2.0 --deny-self-hosted-runners
Unpack the tarball and run the binary in it:
tar -xzf age-plugin-rypt-v0.2.0-linux-amd64.tar.gz && ls age-plugin-rypt-v0.2.0-linux-amd64 && ./age-plugin-rypt-v0.2.0-linux-amd64/age-plugin-rypt --version
LICENSE-APACHE
LICENSE-MIT
LICENSE-THIRD-PARTY
README.md
age-plugin-rypt
age-plugin-rypt 0.2.0
Then install it on your PATH:
sudo install age-plugin-rypt-v0.2.0-linux-amd64/age-plugin-rypt /usr/local/bin/
With Go
Section titled "With Go"go install github.com/x6c-co/age-plugin-rypt@v0.2.0
This needs Go 1.27 or later. It puts the binary in $(go env GOPATH)/bin, or in GOBIN
if that is set, and that directory has to be on your PATH for age to find the plugin.
The API token it needs
Section titled "The API token it needs"The plugin reads the API token from RYPT_TOKEN, and only when age needs a request. It
calls encrypt to encrypt and decrypt to decrypt, so the API token needs those two
actions and no others; the quickstart's API token has exactly these. A machine that only
reads files needs decrypt alone. The plugin calls the decrypt route, so an API token
with unwrap alone cannot decrypt with the plugin, even though decrypt and unwrap
open each other's output: see
what each action covers.
Create a key as in the quickstart. Issue an API token for each
machine as in issue an API token, and put it in
RYPT_TOKEN and the key's id in KEY_ID as that step shows. To hold it to this key,
press Restrict on its row on the API tokens page, choose Only these keys under
Encryption keys it may use, tick the key, and press Save. The key and the API
token must be in the same container (the pieces).
Make an identity and a recipient
Section titled "Make an identity and a recipient"An identity file tells age which rypt key opens a file, and its recipient is what you encrypt to:
age-plugin-rypt new --key "$KEY_ID" > rypt-identity.txt && cat rypt-identity.txt
# created: 2026-11-05T16:36:56Z
# key: 0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0
AGE-PLUGIN-RYPT-1PU0Z60ZTTF5H3PUK5K6V85HP7QJFH64C
age-plugin-rypt recipient rypt-identity.txt
age1rypt1pu0z60zttf5h3puk5k6v85hp7qcmk36k
Neither command calls rypt or needs the API token. Neither string is a secret: both hold
only the key's id. The secret is the API token, since anyone with a file and an API token
that may decrypt or unwrap with its key can read it: unwrap opens the stanza
through the API, though not through the plugin. Copy rypt-identity.txt to each machine
that decrypts.
Encrypt and decrypt
Section titled "Encrypt and decrypt"Make a file to try it on: printf 'hello world\n' > notes.txt. Encrypt it to the
recipient:
age -e -r "$(age-plugin-rypt recipient rypt-identity.txt)" -o notes.txt.age notes.txt
age prints nothing when it succeeds. It costs 1 operation, whatever the file's size. The header has one stanza, for the rypt key:
grep -a "^-> " notes.txt.age
-> rypt 0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0
Decrypt it with the identity file:
age -d -i rypt-identity.txt notes.txt.age
hello world
Always pass -i with the identity file: the plugin has no default identity, so
-j rypt fails. age -o replaces an existing file without asking:
age -d -i rypt-identity.txt -o notes.txt notes.txt.age writes over notes.txt and
exits 0.
Keep an offline recovery key
Section titled "Keep an offline recovery key"A file encrypted only to rypt opens only through rypt. To keep a way in for when rypt cannot answer, make an age key of your own and encrypt to it as well:
age-keygen -o backup.key
Public key: age1t62za65rtccha2q0zvglhga9yfulf9xus2drqp6eczc9rv9jmfnqkq79ay
age-keygen refuses to replace an existing backup.key. Make the key without -pq: age
1.3 and later refuse to mix a post-quantum recipient with a rypt one. Put both recipients
in recipients.txt:
age-plugin-rypt recipient rypt-identity.txt > recipients.txt && age-keygen -y backup.key >> recipients.txt && cat recipients.txt
age1rypt1pu0z60zttf5h3puk5k6v85hp7qcmk36k
age1t62za65rtccha2q0zvglhga9yfulf9xus2drqp6eczc9rv9jmfnqkq79ay
recipients.txt holds no secret: copy it to each machine that encrypts. Encrypt with
-R:
age -e -R recipients.txt -o notes.txt.age notes.txt
This is still 1 operation, and the header now has a stanza for each recipient:
grep -a "^-> " notes.txt.age
-> rypt 0f1e2d3c-4b5a-6978-8796-a5b4c3d2e1f0
-> X25519 0vdgJygqYJv/fQNvcuPGyT8Fz0QhRRzW9Dkz3HFj+Wk
The recovery key opens it with no request to rypt. env -u RYPT_TOKEN runs age without
the API token, to show that none is needed:
env -u RYPT_TOKEN age -d -i backup.key notes.txt.age
hello world
Identity order
Section titled "Identity order"age 1.2.1 tries identities in the order you give them, and stops at the first that fails
for any reason other than not matching the file. With RYPT_TOKEN unset, or rypt out of
reach, a rypt identity given first stops age before it tries backup.key:
env -u RYPT_TOKEN age -d -i rypt-identity.txt -i backup.key notes.txt.age
age: error: rypt plugin: RYPT_TOKEN is not set
age: report unexpected or unhelpful errors at https://filippo.io/age/report
Given first, backup.key opens the file:
env -u RYPT_TOKEN age -d -i backup.key -i rypt-identity.txt notes.txt.age
hello world
When you have tried these, move backup.key off this machine.
What each command costs
Section titled "What each command costs"| Command | Operations |
|---|---|
age-plugin-rypt new, age-plugin-rypt recipient |
0: they make no request |
age -e |
1 encrypt for each rypt recipient, per file, whatever its size |
age -d -i rypt-identity.txt |
1 decrypt per file |
age -d -i backup.key |
0: no request and no API token |
| A request rypt refuses | 0 |
rypt counts an operation only when it completes (operations),
and records each in the key's audit log as encrypt or decrypt
(what is recorded). An operation that completes but
whose audit row cannot be written is counted all the same, and the plugin shows
rypt: 500. A decrypt with backup.key leaves no row. When the connection fails or
drops, or rypt answers 502, 503 or 504, the plugin tries at most 3 times, and rypt
counts each attempt it completed.
When something fails
Section titled "When something fails"Each cell shows the message age prints after rypt plugin: , or Works. The last column
is for files encrypted to recipients.txt.
| Situation | age -e |
age -d -i rypt-identity.txt |
age -d -i backup.key |
|---|---|---|---|
| rypt cannot be reached | rypt: connection failed |
rypt: connection failed |
Works |
RYPT_TOKEN is not set |
RYPT_TOKEN is not set |
RYPT_TOKEN is not set |
Works |
| The API token is wrong or revoked | rypt: unauthorized |
rypt: unauthorized |
Works |
| The machine is outside the API token's firewall | rypt: unauthorized |
rypt: unauthorized |
Works |
The API token has decrypt only |
rypt: unauthorized |
Works | Works |
| A Free key is at its monthly cap | rypt: rate limit or op cap reached |
Works | Works |
| A paid key's billing is not in good standing | rypt: 402 |
Works | Works |
| The key is pending deletion | rypt: 409 |
rypt: 409 |
Works |
| The key is destroyed | rypt: key not found |
rypt: key not found |
Works |
| The file's key version is destroyed | Works | rypt: 400 |
Works |
At a Free key's monthly cap, rypt refuses to encrypt until 00:00 UTC on the 1st, and goes on decrypting.
A deleted key refuses every operation for 7 days, during which Restore on its page in the dashboard brings it back. After those 7 days, or at once with Delete now, the key is destroyed, and whatever was encrypted only to it can never be decrypted again. See one Free key per tenant and errors.
After a rotation
Section titled "After a rotation"On a Free key every rotation retires the version before it; a retired version keeps decrypting for 7 days and is then destroyed (Free keys). A paid key keeps every version until you retire one (versions per tier).
age has no way to rewrap a file's stanza. Before a retired version is destroyed,
decrypt each file under it and encrypt it again, which gives it a new file key encrypted
under the primary version. That is 2 operations a file, and at a Free key's cap the
encrypt half is refused, so first read the key's usage with an API token that has
read, as reading your usage shows: the one this
page issues does not have it. Run this loop in the directory that holds the .age
files, rypt-identity.txt and recipients.txt; the new files keep their recovery
stanza:
set -o pipefail
for f in *.age; do
if age -d -i rypt-identity.txt "$f" | age -e -R recipients.txt -o "$f.new"; then
mv "$f.new" "$f"
else
rm -f "$f.new"
echo "not moved: $f" >&2
fi
done
set -o pipefail makes a failed decrypt fail the whole pipe, so the loop leaves that
file as it was and prints not moved: and its name. The encrypt beside it still runs,
so a file that fails can still cost 1 operation. A file that misses the 7 days but has a
recovery stanza still opens with backup.key: decrypt it with that, and encrypt it
again to recipients.txt.
Errors
Section titled "Errors"age prints each error as age: error: rypt plugin: <message>, then
age: report unexpected or unhelpful errors at https://filippo.io/age/report. When
encrypting, failed to wrap key for recipient #0: comes before rypt plugin: ; the
number is the rypt recipient's position among the recipients, counted from 0. The last
two rows are printed by age-plugin-rypt itself.
| Message | Cause |
|---|---|
RYPT_TOKEN is not set |
RYPT_TOKEN is unset or empty in the shell that runs age. Set it as in the API token it needs. |
RYPT_TOKEN contains invalid characters |
RYPT_TOKEN holds a space inside it, or a character that is not printable ASCII, such as a curly quote. Copy the API token again from where you stored it. |
rypt: unauthorized |
The API token is wrong, cut short or revoked (401 unauthorized); it lacks encrypt or decrypt (403 action_not_allowed); the key is not on its key list (403 key_not_allowed); the machine is outside its firewall (403 ip_not_allowed); or RYPT_TOKEN holds a dashboard session, not an API token (403 api_token_required). Change its actions, key list or firewall with Restrict, or issue a new API token. |
rypt: key not found |
404 not_found. The key id in the identity or recipient is wrong, the key is in another container than the API token, or the key was destroyed. Compare the # key: line of rypt-identity.txt with the Key id on the key's page, and if they differ, make the identity again with age-plugin-rypt new --key; issue the API token in the key's container. A destroyed key does not come back: only a recovery key opens its files. |
rypt: rate limit or op cap reached |
Either the API token's rate limit (429 rate_limited), or, when encrypting, a Free key's monthly cap (429 ops_cap_reached); the plugin shows the same message for both. When decrypting, or on a paid key, it is the rate limit: wait a few seconds and try again. When encrypting to a Free key and it does not clear, read the key's usage with an API token that has read: at 10,000 ops or more it is the cap, and encrypting works again at 00:00 UTC on the 1st. |
rypt: 400 |
400 invalid_ciphertext. The key version the file's stanza was made under has been destroyed: only a recovery key opens the file now. A stanza whose body was changed gives the same message, and then no identity opens the file, because age's header MAC covers every stanza. |
rypt: 402 |
402 billing_required, when encrypting to a paid key whose tenant's billing is not in good standing. Set up or fix billing on the Billing page of the dashboard; decrypting goes on meanwhile. See billing refusals. |
rypt: 409 |
409 key_pending_deletion. The key was deleted: press Restore on its page in the dashboard within 7 days. |
rypt: connection failed |
The plugin could not reach api.rypt.dev, or lost the connection, in 3 attempts. Check the network, and HTTPS_PROXY if you use a proxy. |
rypt: TLS certificate rejected |
The certificate for api.rypt.dev did not verify, as when a proxy intercepts TLS. On Linux, SSL_CERT_FILE can name the proxy's CA certificate. |
rypt: request timed out |
rypt did not answer within 30 seconds, retries included. Try again. |
rypt: TLS error |
The TLS connection to api.rypt.dev failed for a reason other than its certificate, as when a proxy does not speak TLS. Check HTTPS_PROXY. |
rypt: 500, rypt: 503 or another rypt: followed by a status |
rypt answered with that status, after 3 attempts for 502, 503 and 504. Try again later; errors lists each code, and what each command costs says that a 500 can still have cost 1. |
HTTPS_PROXY is not a valid proxy URL |
HTTPS_PROXY, or https_proxy when the message names it, is set to something that is not a proxy URL, and the plugin refuses rather than go around the proxy. Fix the value, or unset it. |
couldn't start plugin: exec: "age-plugin-rypt": executable file not found in $PATH |
age cannot find the plugin. Install it, or add its directory to PATH in the shell that runs age. |
rypt has no default identity: use -i with a file from age-plugin-rypt new |
-j rypt was given. Pass -i rypt-identity.txt instead. |
age-plugin-rypt: no rypt identity found |
age-plugin-rypt recipient read a file with no AGE-PLUGIN-RYPT-1... line. Give it the file age-plugin-rypt new wrote. |
age-plugin-rypt: new: --key <UUID> is required |
age-plugin-rypt new ran without --key. Pass the key's id: --key "$KEY_ID". |