Package: envenc
Environment variable encryption and secure vault management for Go applications.
Repository: https://github.com/dracory/envenc
Install
go get github.com/dracory/envenc@latest
Quick Start
import "github.com/dracory/envenc"
// Initialize a new vault file
func initVault() error {
return envenc.Init(".env.production.vault", "your-secure-password")
}
// Hydrate environment from encrypted vault
func loadSecrets() error {
return envenc.HydrateEnvFromFile(
".env.production.vault",
"derived-encryption-key")
}
Features
- Encrypted environment variable storage
- CLI tools for vault management
- Web UI for key management
- Two-layer encryption (XOR + AES)
- Obfuscation for public keys
Security Considerations
- Always use passwords ≥32 characters
- Store private keys securely (not in code)
- Rotate vault passwords regularly
- Use different passwords per environment