🔐 EnvLock
Secure environment variable management for teams
EnvLock is a command-line tool that encrypts and decrypts .env files using military-grade AES-256-GCM encryption. Share encrypted environment files safely with your team through version control without exposing sensitive credentials.
🚀 Quick Start
Installation
pip install envlock-kb
Basic Usage
# Initialize envlock in your project
envlock init
# Encrypt your .env file
envlock encrypt
# Decrypt the .env.enc file
envlock decrypt
# Check version
envlock version
✨ Features
- 🔒 AES-256-GCM Encryption - Military-grade authenticated encryption
- 🔑 Password-Based Security - Uses scrypt key derivation (NIST recommended)
- 📁 Auto .gitignore Setup - Automatically configures git to ignore sensitive files
- 🎯 Multiple Environment Support - Handle dev, staging, production environments
- 🛡️ Secure Permissions - Creates files with restricted permissions (0o600)
- ✅ Tamper Detection - Authentication tags detect any file modifications
- 🚫 Zero Dependencies - Only requires
cryptographylibrary
📖 How It Works
- Initialize (
envlock init): Sets up.gitignoreand creates your first encrypted.env.encfile - Encrypt (
envlock encrypt): Converts.env→.env.encwith password protection - Decrypt (
envlock decrypt): Recovers.envfrom.env.encusing your password
The encrypted files (.env.enc*) can be safely committed to version control.
⚠️ Never commit unencrypted .env files!
🔐 Security
EnvLock implements industry-standard security practices:
- AES-256-GCM: Authenticated encryption with associated data (AEAD)
- Scrypt KDF: Password-based key derivation (N=2^14, r=8, p=1)
- Random Salt & IV: Unique values for each encryption operation
- Authentication Tags: Cryptographic verification to detect tampering
- Secure File Permissions: Restricts file access to owner only (Unix mode 600)
💡 Use Cases
- Team Collaboration: Share encrypted configs safely via Git
- CI/CD Pipelines: Store encrypted secrets in repositories
- Multi-Environment: Manage dev, staging, prod credentials separately
- Backup & Recovery: Securely backup environment configurations
📋 Requirements
- Python >= 3.8
- cryptography >= 41.0.0
📝 Example Workflow
# 1. Create your environment variables
echo "DATABASE_URL=postgresql://localhost/mydb" > .env
echo "API_KEY=secret123" >> .env
# 2. Encrypt the file
envlock encrypt
# Enter password: ****
# 3. Commit the encrypted file
git add .env.enc
git commit -m "Add encrypted environment variables"
# 4. Team members can decrypt
envlock decrypt
# Enter password: ****
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Links
- GitHub: https://github.com/kukilbharadwaj/envlock
- PyPI: https://pypi.org/project/envlock-kb/
- Issues: https://github.com/kukilbharadwaj/envlock/issues
⚠️ Security Notice
- Always use strong, unique passwords for encryption
- Store your password securely (password manager recommended)
- Never commit unencrypted
.envfiles to version control - Regularly rotate sensitive credentials
Release files for envlock-kb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envlock_kb-0.1.0.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envlock_kb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / envlock_kb-0.1.0.tar.gz
| Download URL | envlock_kb-0.1.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1228da2716677a99592ad3ca39012e6564ad7cb858e9195cd97b0c7e055370ff
|
|
BLAKE2b-256 checksum How to use checksums |
f4f3fb9056b2fe1ae39cbf70f613533b606de22ca1e2fbc8f470a3bd8b98e41e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / envlock_kb-0.1.0-py3-none-any.whl
| Download URL | envlock_kb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
733b2d5916d955e728bd2cd0063a96c0bc983608546402e60a184cd0f8ea337c
|
|
BLAKE2b-256 checksum How to use checksums |
e44a793f211216c37a33587024db3245b17a83b44280b8495b19905924875547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|