How GitVault protects your secrets
Everything sensitive is encrypted on your device before it touches git or GitHub, and decrypted only in memory when you load it.
What lives in your repository
Your private gitvault-store repository holds only ciphertext environments, project manifests, and a wrapped key header.
Encrypted
- Variable keys and values per environment
- Stored as one AES-256-GCM blob per env
- Fresh 96-bit random nonce on every write
- Zero secret keys or values in file names
Visible in the repository
- –vault.json header (KDF params and wrapped vault key)
- –Project and environment names (project.json)
- –Git commit history and timestamps
<user>/gitvault-store/ ├─ .gitattributes # * binary ├─ vault.json # KDF + wrapped key └─ projects/ └─ shop-api/ ├─ project.json # project + envs └─ envs/ ├─ development.enc └─ production.enc
The key hierarchy
Environments are encrypted with a random 256-bit vault key; your master password and recovery key only wrap that key.
Unlock with your password
- Master passwordyou type it
- Argon2id64 MiB · 3 passes
- Key-encryption keynever stored
- Vault key32 random bytes
Unlock with your recovery key
- Recovery key160 random bits
- HKDF-SHA256key derivation
- Key-encryption keynever stored
- Vault keysame key, second lock
Encrypt each environment
- Vault keyunlocked in RAM
- AES-256-GCMAAD: project + env
- envs/<env>.encciphertext on GitHub
Details that matter
- Zero .env files on disk
- gitvault init writes only non-secret gitvault.json. gitvault load decrypts straight into child process env or shell RAM.
- Cross-environment tamper protection
- Associated data binds every blob to gitvault:v2:<project>:<environment>, so swapping or copying .enc files fails authentication.
- Zero stored GitHub tokens
- GitVault delegates authentication, repo creation, cloning, and git credentials exclusively to your installed gh and git CLIs.
- Strict filesystem permissions
- The hidden vault store (~/.local/share/gitvault/store) is created 0700 and the local session.key cache is 0600, wiped by gitvault lock.
- Cheap password rotation
- gitvault unlock --change-password re-wraps only the VaultKey inside vault.json; encrypted environment files stay untouched.
- Path-traversal & injection defense
- Project/env slugs allow only [a-zA-Z0-9_-], variable keys enforce POSIX identifiers, and --export shell-escapes every value.
Found a problem?
Report vulnerabilities privately through a security advisory on GitHub. Please do not open a public issue.