Debian Codegraph @

doc/age.1

raw
1 .\" generated with Ronn-NG/v0.9.1
2 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1
3 .TH "AGE" "1" "August 2026" ""
4 .SH "NAME"
5 \fBage\fR \- simple, modern, and secure file encryption
6 .SH "SYNOPSIS"
7 \fBage\fR [\fB\-\-encrypt\fR] (\fB\-r\fR \fIRECIPIENT\fR | \fB\-R\fR \fIPATH\fR)\|\.\|\.\|\. [\fB\-\-armor\fR] [\fB\-o\fR \fIOUTPUT\fR] [\fIINPUT\fR]
8 .br
9 \fBage\fR [\fB\-\-encrypt\fR] \fB\-\-passphrase\fR [\fB\-\-armor\fR] [\fB\-o\fR \fIOUTPUT\fR] [\fIINPUT\fR]
10 .br
11 \fBage\fR \fB\-\-decrypt\fR [\fB\-i\fR \fIPATH\fR | \fB\-j\fR \fIPLUGIN\fR]\|\.\|\.\|\. [\fB\-o\fR \fIOUTPUT\fR] [\fIINPUT\fR]
12 .br
13 .SH "DESCRIPTION"
14 \fBage\fR encrypts or decrypts \fIINPUT\fR to \fIOUTPUT\fR\. The \fIINPUT\fR argument is optional and defaults to standard input\. Only a single \fIINPUT\fR file may be specified\. If \fB\-o\fR is not specified, \fIOUTPUT\fR defaults to standard output\.
15 .P
16 If \fB\-p\fR/\fB\-\-passphrase\fR is specified, the file is encrypted with a passphrase requested interactively\. Otherwise, it's encrypted to one or more \fIRECIPIENTS\fR specified with \fB\-r\fR/\fB\-\-recipient\fR or \fB\-R\fR/\fB\-\-recipients\-file\fR\. Every recipient can decrypt the file\.
17 .P
18 In \fB\-d\fR/\fB\-\-decrypt\fR mode, passphrase\-encrypted files are detected automatically and the passphrase is requested interactively\. Otherwise, one or more \fIIDENTITIES\fR specified with \fB\-i\fR/\fB\-\-identity\fR are used to decrypt the file\.
19 .P
20 \fBage\fR encrypted files are binary and not malleable, with around 200 bytes of overhead per recipient, plus 16 bytes every 64KiB of plaintext\.
21 .SH "OPTIONS"
22 .TP
23 \fB\-o\fR, \fB\-\-output\fR=\fIOUTPUT\fR
24 Write encrypted or decrypted file to \fIOUTPUT\fR instead of standard output\. If \fIOUTPUT\fR already exists it will be overwritten\.
25 .IP
26 If encrypting without \fB\-\-armor\fR, \fBage\fR will refuse to output binary to a TTY\. This can be forced by specifying \fB\-\fR as \fIOUTPUT\fR\.
27 .TP
28 \fB\-\-version\fR
29 Print the version and exit\.
30 .SS "Encryption options"
31 .TP
32 \fB\-e\fR, \fB\-\-encrypt\fR
33 Encrypt \fIINPUT\fR to \fIOUTPUT\fR\. This is the default\.
34 .TP
35 \fB\-r\fR, \fB\-\-recipient\fR=\fIRECIPIENT\fR
36 Encrypt to the explicitly specified \fIRECIPIENT\fR\. See the \fIRECIPIENTS AND IDENTITIES\fR section for possible recipient formats\.
37 .IP
38 This option can be repeated and combined with other recipient flags, and the file can be decrypted by all provided recipients independently\.
39 .TP
40 \fB\-R\fR, \fB\-\-recipients\-file\fR=\fIPATH\fR
41 Encrypt to the \fIRECIPIENTS\fR listed in the file at \fIPATH\fR, one per line\. Empty lines and lines starting with \fB#\fR are ignored as comments\.
42 .IP
43 If \fIPATH\fR is \fB\-\fR, the recipients are read from standard input\. In this case, the \fIINPUT\fR argument must be specified\.
44 .IP
45 This option can be repeated and combined with other recipient flags, and the file can be decrypted by all provided recipients independently\.
46 .TP
47 \fB\-p\fR, \fB\-\-passphrase\fR
48 Encrypt with a passphrase, requested interactively from the terminal\. \fBage\fR will offer to auto\-generate a secure passphrase\.
49 .IP
50 This option can't be used with other recipient flags\.
51 .TP
52 \fB\-a\fR, \fB\-\-armor\fR
53 Encrypt to an ASCII\-only "armored" encoding\.
54 .IP
55 \fBage\fR armor is a strict version of PEM with type \fBAGE ENCRYPTED FILE\fR, canonical "strict" Base64, no headers, and no support for leading and trailing extra data\.
56 .IP
57 Decryption transparently detects and decodes ASCII armoring\.
58 .TP
59 \fB\-i\fR, \fB\-\-identity\fR=\fIPATH\fR
60 Encrypt to the \fIRECIPIENTS\fR corresponding to the \fIIDENTITIES\fR listed in the file at \fIPATH\fR\. This is equivalent to converting the file at \fIPATH\fR to a recipients file with \fBage\-keygen \-y\fR and then passing that to \fB\-R\fR/\fB\-\-recipients\-file\fR\.
61 .IP
62 For the format of \fIPATH\fR, see the definition of \fB\-i\fR/\fB\-\-identity\fR in the \fIDecryption options\fR section\.
63 .IP
64 \fB\-e\fR/\fB\-\-encrypt\fR must be explicitly specified when using \fB\-i\fR/\fB\-\-identity\fR in encryption mode to avoid confusion\.
65 .TP
66 \fB\-j\fR \fIPLUGIN\fR
67 Encrypt using the data\-less \fIplugin\fR \fIPLUGIN\fR\.
68 .IP
69 This is equivalent to using \fB\-i\fR/\fB\-\-identity\fR with a file that contains a single plugin \fBIDENTITY\fR that encodes no plugin\-specific data\.
70 .IP
71 \fB\-e\fR/\fB\-\-encrypt\fR must be explicitly specified when using \fB\-j\fR in encryption mode to avoid confusion\.
72 .SS "Decryption options"
73 .TP
74 \fB\-d\fR, \fB\-\-decrypt\fR
75 Decrypt \fIINPUT\fR to \fIOUTPUT\fR\.
76 .IP
77 If \fIINPUT\fR is passphrase encrypted, it will be automatically detected and the passphrase will be requested interactively\. Otherwise, the \fIIDENTITIES\fR specified with \fB\-i\fR/\fB\-\-identity\fR are used\.
78 .IP
79 ASCII armoring is transparently detected and decoded\.
80 .TP
81 \fB\-i\fR, \fB\-\-identity\fR=\fIPATH\fR
82 Decrypt using the \fIIDENTITIES\fR at \fIPATH\fR\.
83 .IP
84 \fIPATH\fR may be one of the following:
85 .IP
86 a\. A file listing \fIIDENTITIES\fR one per line\. Empty lines and lines starting with "\fB#\fR" are ignored as comments\.
87 .IP
88 b\. A passphrase encrypted age file, containing \fIIDENTITIES\fR one per line like above\. The passphrase is requested interactively\. Note that passphrase\-protected identity files are not necessary for most use cases, where access to the encrypted identity file implies access to the whole system\.
89 .IP
90 c\. An SSH private key file, in PKCS#1, PKCS#8, or OpenSSH format\. If the private key is password\-protected, the password is requested interactively only if the SSH identity matches the file\. See the \fISSH keys\fR section for more information, including supported key types\.
91 .IP
92 d\. "\fB\-\fR", causing one of the options above to be read from standard input\. In this case, the \fIINPUT\fR argument must be specified\.
93 .IP
94 This option can be repeated\. Identities are tried in the order in which are provided, and the first one matching one of the file's recipients is used\. Unused identities are ignored, but it is an error if the \fIINPUT\fR file is passphrase\-encrypted and \fB\-i\fR/\fB\-\-identity\fR is specified\.
95 .TP
96 \fB\-j\fR \fIPLUGIN\fR
97 Decrypt using the data\-less \fIplugin\fR \fIPLUGIN\fR\.
98 .IP
99 This is equivalent to using \fB\-i\fR/\fB\-\-identity\fR with a file that contains a single plugin \fBIDENTITY\fR that encodes no plugin\-specific data\.
100 .SH "RECIPIENTS AND IDENTITIES"
101 \fBRECIPIENTS\fR are public values, like a public key, that a file can be encrypted to\. \fBIDENTITIES\fR are private values, like a private key, that allow decrypting a file encrypted to the corresponding \fBRECIPIENT\fR\.
102 .SS "Native keys"
103 Native \fBage\fR key pairs are generated with age\-keygen(1), and provide small encodings and strong encryption based on X25519 for classic keys, and X25519 + ML\-KEM\-768 for post\-quantum hybrid keys\. The post\-quantum hybrid keys are secure against future quantum computers and are the recommended recipient type for most applications\.
104 .P
105 A hybrid \fBRECIPIENT\fR encoding begins with \fBage1pq1\fR and looks like the following:
106 .IP "" 4
107 .nf
108 age1pq167[\|\.\|\.\|\. 1950 more characters \|\.\|\.\|\.]
109 .fi
110 .IP "" 0
111 .P
112 A hybrid \fBIDENTITY\fR encoding begins with \fBAGE\-SECRET\-KEY\-PQ\-1\fR and looks like the following:
113 .IP "" 4
114 .nf
115 AGE\-SECRET\-KEY\-PQ\-1K30MYPZAHAXHR22YHH27EGDVLU0QNSUH3DSV7J7NR3X6D9LHXNWSDLTV4T
116 .fi
117 .IP "" 0
118 .P
119 A classic \fBRECIPIENT\fR encoding begins with \fBage1\fR and looks like the following:
120 .IP "" 4
121 .nf
122 age1gde3ncmahlqd9gg50tanl99r960llztrhfapnmx853s4tjum03uqfssgdh
123 .fi
124 .IP "" 0
125 .P
126 A classic \fBIDENTITY\fR encoding begins with \fBAGE\-SECRET\-KEY\-1\fR and looks like the following:
127 .IP "" 4
128 .nf
129 AGE\-SECRET\-KEY\-1KTYK6RVLN5TAPE7VF6FQQSKZ9HWWCDSKUGXXNUQDWZ7XXT5YK5LSF3UTKQ
130 .fi
131 .IP "" 0
132 .P
133 A file can't be encrypted to both post\-quantum and classic keys, as that would defeat the post\-quantum security of the encryption\.
134 .P
135 An encrypted file can't be linked to the native recipient it's encrypted to without access to the corresponding identity\.
136 .SS "SSH keys"
137 As a convenience feature, \fBage\fR also supports encrypting to RSA or Ed25519 ssh(1) keys\. RSA keys must be at least 2048 bits\. This feature employs more complex cryptography, and should only be used when a native key is not available for the recipient\. Note that SSH keys might not be protected long\-term by the recipient, since they are revokable when used only for authentication\.
138 .P
139 A \fBRECIPIENT\fR encoding is an SSH public key in \fBauthorized_keys\fR format (see the \fBAUTHORIZED_KEYS FILE FORMAT\fR section of sshd(8)), starting with \fBssh\-rsa\fR or \fBssh\-ed25519\fR, like the following:
140 .IP "" 4
141 .nf
142 ssh\-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDULTit0KUehbi[\|\.\|\.\|\.]GU4BtElAbzh8=
143 ssh\-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH9pO5pz22JZEas[\|\.\|\.\|\.]l1uZc31FGYMXa
144 .fi
145 .IP "" 0
146 .P
147 The comment at the end of the line, if present, is ignored\.
148 .P
149 In recipient files passed to \fB\-R\fR/\fB\-\-recipients\-file\fR, unsupported but valid SSH public keys are ignored with a warning, to facilitate using \fBauthorized_keys\fR or GitHub \fB\.keys\fR files\. (See \fIEXAMPLES\fR\.)
150 .P
151 An \fBIDENTITY\fR is an SSH private key \fIfile\fR passed individually to \fB\-i\fR/\fB\-\-identity\fR\. Note that keys held on hardware tokens such as YubiKeys or accessed via ssh\-agent(1) are not supported\.
152 .P
153 An encrypted file \fIcan\fR be linked to the SSH public key it was encrypted to\. This is so that \fBage\fR can identify the correct SSH private key before requesting its password, if any\.
154 .SS "Plugins"
155 \fBage\fR can be extended through plugins\. A plugin is only loaded if a corresponding \fBRECIPIENT\fR or \fBIDENTITY\fR is specified\. (Simply decrypting a file encrypted with a plugin will not cause it to load, for security reasons among others\.)
156 .P
157 A \fBRECIPIENT\fR for a plugin named \fBexample\fR starts with \fBage1example1\fR, while an \fBIDENTITY\fR starts with \fBAGE\-PLUGIN\-EXAMPLE\-1\fR\. They both encode arbitrary plugin\-specific data, and are generated by the plugin\.
158 .P
159 When either is specified, \fBage\fR searches for \fBage\-plugin\-example\fR in the PATH and executes it to perform the file header encryption or decryption\. The plugin may request input from the user through \fBage\fR to complete the operation\.
160 .P
161 Plugins can be freely mixed with other plugins or natively supported keys\.
162 .P
163 A plugin is not bound to only encrypt or decrypt files meant for or generated by the plugin\. For example, a plugin can be used to decrypt files encrypted to a native X25519 \fBRECIPIENT\fR or even with a passphrase\. Similarly, a plugin can encrypt a file such that it can be decrypted without the use of any plugin\.
164 .P
165 Plugins for which the \fBIDENTITY\fR/\fBRECIPIENT\fR distinction doesn't make sense (such as a symmetric encryption plugin) may generate only an \fBIDENTITY\fR and instruct the user to perform encryption with the \fB\-e\fR/\fB\-\-encrypt\fR and \fB\-i\fR/\fB\-\-identity\fR flags\. Plugins for which the concept of separate identities doesn't make sense (such as a password\-encryption plugin) may instruct the user to use the \fB\-j\fR flag\.
166 .P
167 \fBage\fR can natively encrypt to recipients starting with \fBage1tag1\fR (using P\-256 ECDH) or \fBage1tagpq1\fR (using the ML\-KEM\-768 + P\-256 post\-quantum hybrid)\. These are intended to be the public side of private keys held in hardware\.
168 .P
169 They are directly supported to avoid the need to install the plugin, which may be platform\-specific, on the encrypting side\.
170 .P
171 The tag reduces privacy, by allowing an observer to correlate files with a recipient (but not files amongst them without knowledge of the recipient), but this is also a desirable property for hardware keys that require user interaction for each decryption operation\.
172 .SH "EXIT STATUS"
173 \fBage\fR will exit 0 if and only if encryption or decryption are successful for the full length of the input\.
174 .P
175 If an error occurs during decryption, partial output might still be generated, but only if it was possible to securely authenticate it\. No unauthenticated output is ever released\.
176 .SH "BACKWARDS COMPATIBILITY"
177 Files encrypted with a stable version (not alpha, beta, or release candidate) of \fBage\fR, or with any v1\.0\.0 beta or release candidate, will decrypt with any later version of the tool\.
178 .P
179 If decrypting older files poses a security risk, doing so might cause an error by default\. In this case, a flag will be provided to force the operation\.
180 .SH "EXAMPLES"
181 Generate a new post\-quantum identity, encrypt data, and decrypt:
182 .IP "" 4
183 .nf
184 $ age\-keygen \-pq \-o key\.txt
185 Public key: age1pq167[\|\.\|\.\|\. 1950 more characters \|\.\|\.\|\.]
186
187 $ tar cvz ~/data | age \-r age1pq167[\|\.\|\.\|\.] > data\.tar\.gz\.age
188
189 $ age \-d \-o data\.tar\.gz \-i key\.txt data\.tar\.gz\.age
190 .fi
191 .IP "" 0
192 .P
193 Encrypt \fBexample\.jpg\fR to multiple recipients and output to \fBexample\.jpg\.age\fR:
194 .IP "" 4
195 .nf
196 $ age \-o example\.jpg\.age \-r age1pq167[\|\.\|\.\|\.] \-r age1pq1e3[\|\.\|\.\|\.] example\.jpg
197 .fi
198 .IP "" 0
199 .P
200 Encrypt to a list of recipients:
201 .IP "" 4
202 .nf
203 $ cat > recipients\.txt
204 # Alice
205 age1pq167[\|\.\|\.\|\. 1950 more characters \|\.\|\.\|\.]
206 # Bob
207 age1pq1e3[\|\.\|\.\|\. 1950 more characters \|\.\|\.\|\.]
208
209 $ age \-R recipients\.txt example\.jpg > example\.jpg\.age
210 .fi
211 .IP "" 0
212 .P
213 Encrypt and decrypt a file using a passphrase:
214 .IP "" 4
215 .nf
216 $ age \-p secrets\.txt > secrets\.txt\.age
217 Enter passphrase (leave empty to autogenerate a secure one):
218 Using the autogenerated passphrase "release\-response\-step\-brand\-wrap\-ankle\-pair\-unusual\-sword\-train"\.
219
220 $ age \-d secrets\.txt\.age > secrets\.txt
221 Enter passphrase:
222 .fi
223 .IP "" 0
224 .P
225 Encrypt and decrypt with a passphrase\-protected identity file:
226 .IP "" 4
227 .nf
228 $ age\-keygen | age \-p > key\.age
229 Public key: age1yhm4gctwfmrpz87tdslm550wrx6m79y9f2hdzt0lndjnehwj0ukqrjpyx5
230 Enter passphrase (leave empty to autogenerate a secure one):
231 Using the autogenerated passphrase "hip\-roast\-boring\-snake\-mention\-east\-wasp\-honey\-input\-actress"\.
232
233 $ age \-r age1yhm4gctwfmrpz87tdslm550wrx6m79y9f2hdzt0lndjnehwj0ukqrjpyx5 secrets\.txt > secrets\.txt\.age
234
235 $ age \-d \-i key\.age secrets\.txt\.age > secrets\.txt
236 Enter passphrase for identity file "key\.age":
237 .fi
238 .IP "" 0
239 .P
240 Encrypt and decrypt with an SSH public key:
241 .IP "" 4
242 .nf
243 $ age \-R ~/\.ssh/id_ed25519\.pub example\.jpg > example\.jpg\.age
244
245 $ age \-d \-i ~/\.ssh/id_ed25519 example\.jpg\.age > example\.jpg
246 .fi
247 .IP "" 0
248 .P
249 Encrypt and decrypt with age\-plugin\-yubikey:
250 .IP "" 4
251 .nf
252 $ age\-plugin\-yubikey # run interactive setup, generate identity file and obtain recipient
253
254 $ age \-r age1yubikey1qwt50d05nh5vutpdzmlg5wn80xq5negm4uj9ghv0snvdd3yysf5yw3rhl3t secrets\.txt > secrets\.txt\.age
255
256 $ age \-d \-i age\-yubikey\-identity\-388178f3\.txt secrets\.txt\.age
257 .fi
258 .IP "" 0
259 .P
260 Encrypt to the SSH keys of a GitHub user:
261 .IP "" 4
262 .nf
263 $ curl https://github\.com/benjojo\.keys | age \-R \- example\.jpg > example\.jpg\.age
264 .fi
265 .IP "" 0
266 .SH "SEE ALSO"
267 age\-keygen(1), age\-inspect(1)
268 .SH "AUTHORS"
269 Filippo Valsorda \fIage@filippo\.io\fR