$linuxjunkies
>

rage(1)

A command-line tool to encrypt and decrypt files using age, a simple, modern, and secure file encryption format.

UbuntuDebianFedoraArch

Synopsis

rage [OPTION]... [FILE]...

Description

rage is a Rust implementation of the age encryption format, providing fast and easy file encryption without complex key management. It supports both symmetric encryption (with a passphrase) and asymmetric encryption (with public/private keypairs).

Files are encrypted by default with a random key, and decryption requires the corresponding passphrase or private key. The tool is designed to be simple enough for casual use yet secure enough for sensitive data.

Common options

FlagWhat it does
-e, --encryptEncrypt the input (default mode if no -d flag)
-d, --decryptDecrypt the input
-p, --passphraseEncrypt with a passphrase instead of a public key; prompts for password
-r, --recipientEncrypt for a recipient's public key (can be used multiple times)
-i, --identityUse a private key file for decryption (can be used multiple times)
-o, --outputWrite output to a file instead of stdout
-a, --armorEncrypt to ASCII-armored format (base64) instead of binary
-g, --generate-keyGenerate a new age keypair and exit

Examples

Encrypt a file with a passphrase; prompts for password interactively

rage -p secrets.txt -o secrets.txt.age

Decrypt a file by prompting for the passphrase

rage -d secrets.txt.age -o secrets.txt

Generate a new age keypair and save the public key

rage -g > key.txt

Encrypt a file for a specific recipient's public key

rage -r AGE1QL3Z5CV5FQ69DQDS8GF55A... document.pdf -o document.pdf.age

Decrypt using a private key from a file

rage -d -i ~/.age/key.txt secrets.txt.age

Encrypt a tar archive with passphrase as ASCII armor and pipe to email

tar czf - /path/to/files | rage -p -a | mail [email protected]

Encrypt a file for multiple recipients (all can decrypt it)

rage -r AGE1... -r AGE2... file.txt -o file.txt.age

Decrypt from stdin to stdout

cat encrypted.txt.age | rage -d

Related commands