#encryption #file-encryption #unix #workflow #key-pair #config-dir #decryption

app enx

Rails-credentials-style encrypted env workflow for Unix projects

1 unstable release

Uses new Rust 2024

0.1.0 Mar 20, 2026

#573 in Cryptography

MIT license

21KB
393 lines

enx

Rails-credentials-style encrypted env workflow for Unix projects.

enx uses age keys stored under your user config directory and gives you a simple CLI to initialize keys, encrypt/decrypt files, and edit encrypted env files.

Features

  • Uses age X25519 keypairs for encryption.
  • Stores global config and keys under ~/.config/enx (or $XDG_CONFIG_HOME/enx).
  • Supports encrypting plaintext env files into .enx files.
  • Supports decrypting .enx files back to plaintext.
  • Supports Rails-style edit flow for encrypted files.
  • Supports read-only show flow for .enx in the current directory.

Install

From crates.io

cargo install enx

From this repository:

cargo install --git https://github.com/AlextheYounga/enx.git tuimux

Initialization

Run once:

enx init

This creates:

  • ~/.config/enx/keys.txt (private key)
  • ~/.config/enx/keys.pub (public key)
  • ~/.config/enx/enx.toml (global config)

Example enx.toml:

editor = "nvim"

editor defaults to $EDITOR, or vi if $EDITOR is not set.

CLI Usage

Initialize keys/config:

enx init

Encrypt a file and delete plaintext input:

enx -e .env

Decrypt an encrypted file to plaintext output:

enx -d .enx

Edit an encrypted file (decrypt -> open editor -> re-encrypt):

enx .enx

Show .enx in current directory without writing changes back:

enx -s

Show help:

enx

File Mapping Rules

  • Encrypt .env -> .enx
  • Encrypt something.ext -> something.enx
  • Decrypt .enx -> .env
  • Decrypt something.enx -> something

Encryption/decryption will fail if output file already exists.

Notes

  • enx -e deletes the plaintext input after successful encryption.
  • enx -s is read-only with respect to the encrypted file.
  • All commands use the global keypair/config under ~/.config/enx.

Dependencies

~12–19MB
~346K SLoC