{"id":51118924,"url":"https://github.com/sulthonzh/envault","last_synced_at":"2026-06-25T00:30:33.204Z","repository":{"id":363809345,"uuid":"1255557550","full_name":"sulthonzh/envault","owner":"sulthonzh","description":"Zero-dep .env file encryption for teams — encrypt, decrypt, diff, merge secrets with a passphrase","archived":false,"fork":false,"pushed_at":"2026-06-21T15:04:55.000Z","size":25,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-21T17:05:36.341Z","etag":null,"topics":["aes","decrypt","dotenv","encrypt","env","passphrase","secrets","security"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sulthonzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-01T00:52:39.000Z","updated_at":"2026-06-21T15:04:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sulthonzh/envault","commit_stats":null,"previous_names":["sulthonzh/envault"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sulthonzh/envault","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fenvault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fenvault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fenvault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fenvault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sulthonzh","download_url":"https://codeload.github.com/sulthonzh/envault/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fenvault/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34755061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes","decrypt","dotenv","encrypt","env","passphrase","secrets","security"],"created_at":"2026-06-25T00:30:33.143Z","updated_at":"2026-06-25T00:30:33.198Z","avatar_url":"https://github.com/sulthonzh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# envault\n\nZero-dep .env file encryption for teams. Encrypt, decrypt, diff, merge, and rotate secrets with a passphrase.\n\n## Why?\n\nYou're committing `.env` files to... somewhere. Maybe a shared drive, maybe a private repo, maybe Slack (please stop). **envault** gives you a dead-simple way to encrypt `.env` files so you can safely share them without leaking secrets.\n\nNo vault server. No cloud dependency. No runtime deps. Just a passphrase and AES-256-GCM.\n\n## Install\n\n```bash\nnpm install -g envault\n```\n\nOr use without installing:\n\n```bash\nnpx envault encrypt .env --out .env.encrypted --passphrase=my-secret\n```\n\n## Usage\n\n### Encrypt\n\n```bash\n# Encrypt .env → prints encrypted blob to stdout\nenvault encrypt .env --passphrase my-secret\n\n# Encrypt to file\nenvault encrypt .env --out .env.encrypted --passphrase my-secret\n\n# Pipe stdin\necho \"DATABASE_URL=postgres://localhost/db\" | envault encrypt --passphrase my-secret\n```\n\n### Decrypt\n\n```bash\n# Decrypt to stdout\nenvault decrypt .env.encrypted --passphrase my-secret\n\n# Decrypt to file\nenvault decrypt .env.encrypted --out .env --passphrase my-secret\n```\n\n### View keys \u0026 values\n\n```bash\n# Show key=value pairs\nenvault view .env.encrypted --passphrase my-secret\n\n# List just the keys\nenvault keys .env.encrypted --passphrase my-secret\n\n# JSON output (good for scripting)\nenvault keys .env.encrypted --passphrase my-secret --json\n```\n\n### Diff two encrypted files\n\n```bash\n# See what changed between staging and prod\nenvault diff .env.staging.enc .env.prod.enc --passphrase my-secret\n```\n\nOutput:\n```\nAdded:\n  + NEW_FEATURE_FLAG=true\nChanged:\n  ~ LOG_LEVEL: debug → info\nRemoved:\n  - DEPRECATED_KEY=old-value\n```\n\n### Merge encrypted files\n\n```bash\n# Merge with strategy: ours | theirs | union (default: ours)\nenvault merge .env.base.enc .env.override.enc --strategy theirs --passphrase my-secret\n```\n\n### Rotate passphrase\n\n```bash\nenvault rotate .env.encrypted\n# Prompts for old + new passphrase\n```\n\n### Environment variable\n\nSet `ENVAULT_PASSPHRASE` to avoid typing it every time (useful in CI):\n\n```bash\nexport ENVAULT_PASSPHRASE=my-secret\nenvault encrypt .env --out .env.enc\nenvault decrypt .env.enc --out .env\n```\n\n## Programmatic API\n\n```js\nconst { encrypt, decrypt, encryptEnv, decryptEnv, parseEnv, diffEnv, mergeEnv, rotatePassphrase } = require('envault');\n\n// Basic encrypt/decrypt\nconst blob = encrypt('secret content', 'my-passphrase');\nconst plain = decrypt(blob, 'my-passphrase');\n\n// Env-specific with metadata\nconst result = encryptEnv('DB_HOST=localhost\\nDB_PORT=5432', 'passphrase');\n// → { encrypted: '...', lineCount: 2, byteSize: 32 }\n\n// Parse .env content\nconst parsed = parseEnv('KEY=value\\n# comment\\nKEY2=\"quoted value\"');\n// → [{ key: 'KEY', value: 'value' }, { key: 'KEY2', value: 'quoted value' }]\n\n// Diff two parsed env arrays\nconst diff = diffEnv(parsed1, parsed2);\n// → { added: [...], removed: [...], changed: [...] }\n\n// Merge with strategy\nconst merged = mergeEnv(content1, content2, 'ours'); // ours | theirs | union\n\n// Rotate passphrase\nconst newBlob = rotatePassphrase(oldBlob, oldPass, newPass);\n```\n\n## How It Works\n\n1. **Key derivation**: PBKDF2 with SHA-256, 100k iterations, random 32-byte salt\n2. **Encryption**: AES-256-GCM with random 16-byte IV\n3. **Format**: `base64(salt + iv + authTag + ciphertext)`\n4. **Deterministic?** No. Same input + passphrase → different ciphertext every time (random salt + IV)\n\n## Security Notes\n\n- This is **file-level encryption** for sharing secrets, not a replacement for a proper secrets manager\n- Passphrase strength matters — use long, random passphrases\n- The encrypted blob contains the salt and IV (that's fine, they're not secrets)\n- AES-256-GCM provides authenticated encryption (integrity + confidentiality)\n- No password is ever stored — if you forget it, your data is gone\n\n## CLI Reference\n\n```\nenvault encrypt \u003cfile\u003e [--out \u003cfile\u003e] [--passphrase \u003cpw\u003e] [--json]\nenvault decrypt \u003cfile\u003e [--out \u003cfile\u003e] [--passphrase \u003cpw\u003e] [--json]\nenvault view \u003cfile\u003e [--passphrase \u003cpw\u003e] [--json]\nenvault keys \u003cfile\u003e [--passphrase \u003cpw\u003e] [--json]\nenvault diff \u003cfile1\u003e \u003cfile2\u003e [--passphrase \u003cpw\u003e] [--json]\nenvault merge \u003cf1\u003e \u003cf2\u003e [--strategy ours|theirs|union] [--passphrase \u003cpw\u003e] [--out \u003cfile\u003e]\nenvault rotate \u003cfile\u003e [--out \u003cfile\u003e]\n```\n\nFlags:\n- `--out, -o` — output file path\n- `--passphrase` — passphrase (or set `ENVAULT_PASSPHRASE`)\n- `--json` — JSON output\n- `--pretty` — pretty-print JSON\n- `--strategy` — merge strategy: `ours`, `theirs`, `union`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fenvault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsulthonzh%2Fenvault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fenvault/lists"}