~/androidlabs / apps / termux-vault
// File 02 · Declassified

Termux Vault
org.androidlabs.termuxvaultEncrypted Termux commands. Unlock, tap, run. Nothing sits in plain text.
Some shell commands carry secrets: a token in a curl header, a VPN password, an rsync line that points at your server. Termux Vault keeps each one encrypted and hands it to Termux only after you unlock.
// Briefing
What it is
Shell history, notes apps and home-screen shortcuts all keep secrets in clear text. Termux Vault keeps each command encrypted with AES-256-GCM. To edit, delete or run one, you unlock your vault with your passphrase, or with an optional strong biometric. Termux Vault then hands the decrypted command straight to Termux and wipes its own copy from memory.
Not affiliated with or endorsed by the Termux project.






Commands, servers and tokens in the screenshots are made-up examples.
// Capabilities
What it does
- Run on demand. Tap an entry, unlock, and it runs in Termux.
- See the result. Every run ends with one line: all commands succeeded, or which line failed. Failures wait for you to press Enter.
- Per-command behaviour. Keep a successful session open, be notified when it finishes, or hide the output.
- Reorder commands by dragging.
- Widget and Tasker. Both only ever show an authentication prompt. Nothing runs unattended.
- Back up and restore the whole vault as one line of encrypted text.
// Procedure
How a command reaches Termux
- 01You unlock your vault. The passphrase goes through Argon2id and unwraps the vault key.
- 02Termux Vault checks that the installed Termux still has the signing certificate you trusted.
- 03It opens a one-time listener on
127.0.0.1and starts Termux with only a fixed bootstrap, two random one-run tokens and the command's title. The command itself is never in the Intent. - 04Termux and Termux Vault prove to each other that they hold the tokens. Only then is the command sent, through memory and an anonymous pipe: never a file, an argument or an environment variable.
- 05Termux Vault wipes its copy. The whole exchange has a strict 12-second deadline.
// Threat model
What it protects against, and what it does not
| Protects against | Does not protect against |
|---|---|
| Anyone who gets your vault file or a backup: commands are ciphertext | A compromised phone, root access or a debugger |
| Other apps reading commands from Intents, process arguments, files, cache, shell history or logs | A malicious or modified Termux build that you chose to trust |
| Unattended runs: widgets and Tasker only show an authentication prompt | A keyboard or accessibility service you enabled |
| Screenshots, overlays and tap-jacking over sensitive screens | What the command itself reveals: output, files, network requests |
| Running a different Termux: its certificate is checked before every run | A weak passphrase: Argon2id slows guessing but cannot make it safe |
Keys: per-command AES-256-GCM keys, wrapped by a vault key, wrapped by your passphrase through Argon2id (64 MiB, 3 passes, 4 lanes). Biometric unlock uses a non-exportable Android Keystore key that accepts only Class 3 biometrics. Titles, icons and order are stored unencrypted; only the commands are encrypted.
// Requirements
Before the first run
- Android 11 or newer.
- Termux installed in the same Android profile, from F-Droid or GitHub.
- In Termux, allow other apps to run commands:
mkdir -p ~/.termux echo "allow-external-apps=true" >> ~/.termux/termux.properties termux-reload-settings - The notification permission and Run commands in Termux environment. Termux Vault asks for both after you create your first vault.
// Automation
Tasker
Long-press an entry and choose Tasker ID. In Tasker, add a Send Intent action:
| Field | Value |
|---|---|
| Action | org.androidlabs.termuxvault.RUN_ENTRY |
| Package | org.androidlabs.termuxvault |
| Extra | entry_id:<UUID from the dialog> |
| Target | Broadcast Receiver |
Termux Vault answers with a notification. Tap it and unlock to run. Tasker can request a run but never decrypts or executes anything by itself.
// Verification
Check the signature
apksigner verify --print-certs TermuxVault-v<version>.apkThe signing certificate SHA-256 must be:
e8503bc245fa92e4238dd741cbc6ec87d5bf945843d6248a1364ba3c880abc37