Age encryption
Create secret key (public key is included as comment):
$ age-keygen -o /tmp/age.key
$ cat /tmp/age.key
# created: 2026-05-08T14:13:31+02:00
# public key: age1…
AGE-SECRET-KEY-1TD…
Simple example of piping text into age:
$ echo hi | age -r PUBKEY > /tmp/txt.age
$ age --decrypt -i /tmp/age.sec /tmp/txt.age
hi
Example of encrypting a file:
echo hi > /tmp/hi.txt
age -r PUBKEY -o /tmp/hi.age /tmp/hi.txt
Decrpt file:
age --decrypt -i /tmp/age.key /tmp/hi.age