Age is a command-line file encryption tool that lets you encrypt and decrypt files from the terminal. It supports public key encryption and passphrase-based encryption. You can also encrypt files for multiple recipients and save the encrypted output to a separate file.
Here’s what you can do with Age tool in Termux:
- Encrypt files using a public key.
- Decrypt files using a private key.
- Protect files with a passphrase.
- Generate public and private key pairs.
- Encrypt files for multiple recipients.
- Read recipients from a file.
- Use identity files to decrypt encrypted data.
- Create ASCII-armored encrypted output.
- Encrypt and decrypt data through standard input and output.
Install Age in Termux
You can install Age in Termux with a single command. Open Termux and run the command below to start the installation.
First, update and upgrade the packages:
pkg update && pkg upgrade -yNow, Install Age:
pkg install age -yOnce the installation is complete, Age is ready to use in your Termux terminal.
Use Age in Termux
You can use the following Age commands to encrypt files, decrypt protected data, generate keys, and manage different encryption options in Termux.
Generate a new key pair:
age-keygen -o key.txtThis creates a private key file named
key.txtand displays your public key in the terminal.
Encrypt a file using a public key:
age -r YOUR_PUBLIC_KEY -o secret.txt.age secret.txtReplace
YOUR_PUBLIC_KEYwith your actual public key andsecret.txtwith the name of your file.
Decrypt an encrypted file:
age -d -i key.txt -o secret.txt secret.txt.ageEncrypt a file using a passphrase:
age -p -o secret.txt.age secret.txtDecrypt a passphrase-protected file:
age -d -o secret.txt secret.txt.ageAge will ask for the passphrase before decrypting the file.
Encrypt a file in ASCII-armored format:
age -a -r YOUR_PUBLIC_KEY -o secret.txt.age secret.txtEncrypt a file for multiple recipients:
age -r RECIPIENT_1 -r RECIPIENT_2 -o secret.txt.age secret.txtEncrypt using a recipients file:
age -R recipients.txt -o secret.txt.age secret.txtDecrypt using multiple identity files:
age -i key1.txt -i key2.txt -d -o secret.txt secret.txt.ageEncrypt data from standard input:
echo "Hello World" | age -p > message.ageDecrypt data and display the output in the terminal:
age -d -i key.txt message.ageDisplay the help menu:
age --helpThese commands let you encrypt and decrypt files using public keys, private keys, and passphrases. You can also choose where to save the output and work with multiple recipients.
End Note
Age is a useful command-line tool for protecting files and sensitive data in Termux. Its simple commands support public key encryption, passphrase protection, and file decryption. Keep your private keys and passphrases safe, as you need them to access your encrypted files.

