Simple File Encryption With age

Generate a key and encrypt or decrypt files with a modern format.

LinuxbackupsecurityencryptionLow risk
Run age-keygen -o key.txt to create a key pair, then age -r <public-key> file > file.age.

01Command

Command
$ age-keygen -o key.txt

02What it does

age is a small, composable encryption tool with a simple CLI and a modern file format, supporting recipient public keys, passphrases and SSH keys. It is often used for secrets in repositories and backups because the commands are easy to remember.

03Risk

RiskLow risk
Requirementssudo apt install age
!Warning: Losing the private key makes encrypted files unrecoverable; back it up securely and never commit it.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • age
    Official project · vendor-doc · 2026-09-20
    Evidence: Debian packages age, a simple, modern file encryption tool.
  • Debian package: age
    Debian · vendor-doc · 2026-09-20
    Evidence: Debian packages age, a simple, modern file encryption tool.

Last verified: 2026-09-22 · Category: Security & Privacy

06Related solutions