This document describes the security model and best practices for Lazy-Locker.
Lazy-Locker uses Argon2id for key derivation:
- Algorithm: Argon2id (memory-hard, resistant to GPU attacks)
- Output: 256-bit key
- Salt: Random 128-bit salt per locker
The derived key is used for all encryption operations and is never stored on disk.
All secrets are encrypted with AES-256-GCM:
- Algorithm: AES-256-GCM (authenticated encryption)
- Key: 256-bit derived from passphrase
- Nonce: Random 96-bit nonce per encryption
GCM provides both confidentiality and integrity protection.
All random values are generated using the operating system's cryptographically secure random number generator via OsRng.
Sensitive data is zeroized (overwritten with zeros) when no longer needed:
- Passphrase after key derivation
- Derived key on locker drop
- Decrypted secret values after use
- Agent state on shutdown
This is implemented using the zeroize crate.
The agent daemon:
- Runs as a separate process
- Communicates only via Unix socket
- Socket has restrictive permissions (0600)
- Only the user who started it can connect
| Threat | Protection |
|---|---|
| Plain-text secrets on disk | AES-256-GCM encryption |
| Secrets in version control | Encrypted storage |
| Brute-force passphrase attacks | Argon2id key derivation |
| Tampering with encrypted data | GCM authentication |
| Memory leaks | Zeroization |
| Threat | Reason |
|---|---|
| Root/administrator access | Can read process memory |
| Memory forensics | Key is in memory while agent runs |
| Keyloggers | Can capture passphrase |
| Malware on the same machine | Can impersonate user |
| Physical access | Can extract keys from running system |
- Use a strong, unique passphrase (16+ characters)
- Never reuse your passphrase elsewhere
- Consider using a passphrase manager
- Don't share your passphrase
- Set expiration dates for temporary credentials
- Rotate secrets regularly
- Remove unused secrets
- Use descriptive names
- Keep your system updated
- Use full-disk encryption
- Lock your screen when away
- Monitor for unauthorized access
- Never log secret values
- Don't commit secrets to version control
- Use
.gitignorefor sensitive files - Review code for accidental secret exposure
| Feature | Lazy-Locker | .env files | HashiCorp Vault |
|---|---|---|---|
| Encryption at rest | ✅ AES-256-GCM | ❌ Plain text | ✅ Yes |
| Local-first | ✅ Yes | ✅ Yes | ❌ Server-based |
| No infrastructure | ✅ Yes | ✅ Yes | ❌ Requires server |
| SDK support | ✅ Python, JS | ✅ dotenv | ✅ Multiple |
| Expiration | ✅ Yes | ❌ No | ✅ Yes |
| Access control | ✅ Passphrase | ❌ None | ✅ Policies |
| Audit logging | ❌ No | ❌ No | ✅ Yes |
If you discover a security vulnerability, please:
- Do not open a public issue
- Email security concerns to: william.derue@gmail.com
- Include detailed reproduction steps
- Allow reasonable time for a fix before disclosure
Lazy-Locker has not undergone a formal security audit. Use at your own risk for sensitive production workloads.
The cryptographic primitives used (Argon2, AES-GCM) are well-established and implemented by widely-used Rust crates:
argon2- RustCrypto implementationaes-gcm- RustCrypto implementationrand_core- RustCrypto random number generation