v1.0.0 is now available

Never commit a .env file again

envcrypt encrypts your environment variables with AES-256-GCM. Generate secrets, detect safe ports, and decrypt straight into memory — so plaintext never touches your disk.

$ npm install -g envcrypt
envcrypt init
0
npm downloads
0
GitHub stars
0
Latest version

Your .env file is a liability

Every plaintext .env file is a potential data breach waiting to happen.

⚠️

Without envcrypt

Secrets stored in plaintext .env files. Accidentally committed to git. Leaked in code reviews. Exposed in backups.

🔒

With envcrypt

Secrets encrypted with AES-256-GCM. Only .env.enc is committed. Decrypted straight into memory. Never touches disk.

Four steps to secure environments

From initialization to runtime — envcrypt handles everything.

1

Initialize

Run envcrypt init and answer a few questions. Choose a preset or configure custom variables.

2

Generate

envcrypt creates cryptographically secure secrets and finds safe, unblocked ports automatically.

3

Encrypt

Everything is bundled into an AES-256-GCM encrypted .env.enc file with Argon2id key derivation.

4

Run

Use envcrypt run to decrypt into memory and execute. Auto-cleanup when done.

Everything you need for secure environments

Built by developers, for developers. Every feature designed to make secret management effortless.

AES-256-GCM Encryption

Military-grade encryption with Argon2id key derivation. Your password never leaves your machine.

Auto-Generated Secrets

Cryptographically secure random strings for JWT, sessions, and API keys. No more changeme123.

Smart Port Detection

Scans active processes and suggests completely safe, unblocked ports. No more EADDRINUSE.

Memory-Safe Decryption

Secrets decrypted straight into application memory. Auto-shred on exit. Never touches disk as plaintext.

Pre-Commit Hook

Automatically blocks plaintext .env commits. Never accidentally expose secrets again.

Team Ready

Asymmetric key sharing and one-time bootstrap tokens. Share .env.enc safely with your team.

One line of code

Add envcrypt to any Node.js project in seconds.

// At the top of your entry file
import { decryptToEnv } from "envcrypt";

await decryptToEnv();

// process.env is now populated
import express from "express";
const app = express();

// Your secrets are in memory, never on disk

Common questions

Everything you need to know about envcrypt.

dotenv loads plaintext .env files into memory. envcrypt encrypts your environment variables with AES-256-GCM, so only an encrypted .env.enc file exists on disk. Secrets are decrypted at runtime and never saved as plaintext. Plus, envcrypt auto-generates secure secrets and detects safe ports.

envcrypt uses AES-256-GCM for encryption with Argon2id for key derivation. The encrypted file includes an HMAC-SHA256 header for tamper detection. This is the same encryption standard used by governments and military organizations worldwide.

Yes! .env.enc is designed to be committed to version control. For team sharing, envcrypt supports asymmetric encryption — the AES key is encrypted with each team member's public key. New members can join with one-time bootstrap tokens.

Your password is never stored anywhere — it's used to derive the encryption key via Argon2id. If you forget it, you cannot decrypt .env.enc. You'll need to run envcrypt init again to create a new encrypted environment. This is by design — zero-knowledge security.

Yes, envcrypt is completely free and open source under the MIT license. All core features — encryption, secret generation, port detection, and the CLI — are free forever. Future cloud integrations may have paid tiers.

Stop committing secrets

Join thousands of developers who trust envcrypt to protect their environments.