age is a simple, modern file
encryption tool for sharing secrets via public-key encryption.
macOS
brew install ageWindows
scoop install ageVerify:
age --version- When someone wants to share a secret, generate a key pair and send them your public key.
- Create separate keys per context.
age-keygen -o age-key.txtage-key.txtcontains your private key — never share it.- The public key is printed to your terminal. Share only that line:
Public key: age1dnnrsy2yeevh7tpk007rkzj9kruk4j9kt3z3ywnqvynhzamvcuwql27jzm
- Get the recipient's public key.
- Put secrets in
secret.txt, then encrypt:
age -o secret.txt.age -r age1dnnrsy2yeevh7tpk007rkzj9kruk4j9kt3z3ywnqvynhzamvcuwql27jzm secret.txt- You have a
.agefile someone encrypted with your public key. - Decrypt it with your private key:
age --decrypt -i age-key.txt ~/Downloads/secret.txt.age > ~/Downloads/secret.txt