Secure, local-first .env encryption for developers.
EnvLock encrypts your .env files using Argon2id + XChaCha20-Poly1305 and stores the encrypted output inside a dedicated .envlock/ folder.
You can safely commit the encrypted version to Git, sync it between machines, or share it with your team — without exposing any secrets.
No cloud. No backend. 100% local.
- Local-first encryption — No cloud dependency
- Strong cryptography — Argon2id (KDF) + XChaCha20-Poly1305 (AEAD)
.envlock/project folder for clean structure- Git-friendly — only encrypted files are committed
- Zero dependencies — just a Rust binary
- Colorful success & error messages
- Profiles supported via custom paths
- Safe metadata (
env.meta.json) stored separately - Config file (
envlock/config.json) for project defaults
Planned future features:
- VSCode extension
- Additional sync backends (S3, local folder, SFTP)
- History & snapshots
- Multi-profile system (
dev,stage,prod)
See: 👉 https://github.com/harunozceyhan/envlock/releases
Binaries provided for:
- macOS (Apple + Intel)
- Linux
- Windows
envlock initThis creates:
.envlock/
config.json
Default config:
{
"env_file": ".env",
"encrypted_file": ".envlock/.env.enc",
"meta_file": ".envlock/.env.meta.json"
}Below are all core commands implemented so far.
Initializes the project.
envlock initCreates:
.envlock/config.json
Encrypt your .env file.
envlock lockOr custom paths:
envlock lock \
--env .env.local \
--enc .envlock/local.enc \
--meta .envlock/local.meta.json \
--force-
Reads plaintext
.env -
Asks for password (no echo)
-
Derives key (Argon2id)
-
Encrypts with XChaCha20-Poly1305
-
Writes:
- encrypted:
.envlock/.env.enc - metadata:
.envlock/.env.meta.json
- encrypted:
Decrypt an encrypted .env file.
envlock unlockOr with custom paths:
envlock unlock --enc .envlock/.env.enc --env .env --meta .envlock/.env.meta.jsonIf --force is omitted and .env exists, EnvLock will ask for overwrite confirmation.
Show differences between plaintext and encrypted env.
envlock diffOr custom:
envlock diff --env .env --enc .envlock/dev.encThis command:
- decrypts the encrypted env
- compares key/value pairs
- displays a colored diff
Encrypt and push encrypted files to Git.
envlock syncCustom commit message:
envlock sync --message "Update API keys"Equivalent to:
envlock lock --forcegit add encrypted + metagit commit -m <message>git push
EnvLock uses:
As password-based key derivation (KDF). Memory-hard → highly resistant to GPU cracking.
Modern authenticated encryption (AEAD). Prevents tampering and leaking partial plaintext.
Contains:
- salt
- nonce
- Argon2 parameters
- version
Never contains plaintext or password.
Contains ONLY encrypted data:
.envlock/
.env.enc
.env.meta.json
config.json
Plaintext .env stays untracked.
your-project/
.env # plaintext, gitignored
.envlock/
.env.enc # encrypted
.env.meta.json # metadata
config.json # defaults
envlock lock --env .env.dev --enc .envlock/dev.enc --meta .envlock/dev.meta.jsonenvlock unlock --env /tmp/myenvenvlock diff --env .env --enc .envlock/prod.encgit clone https://github.com/harunozceyhan/envlock
cd envlock
cargo build --releasePull requests, issues, and feature discussions are welcome!
Current priorities:
- VSCode extension
- Additional sync providers (S3, local folder)
- Multi-profile support
- History snapshots
MIT License. Commercial-friendly. Modify and build on top freely.
If EnvLock helps you:
- ⭐ Star the repo
- 💬 Share feedback
- 🐛 Report bugs
- 🧑💻 Contribute code
Thanks for trying EnvLock!