40 lines of zero-dependency Node: AES-256-GCM encrypt env vars before your PaaS leaks them
DavidWells · x · 2026-11-20
David Wells shares a "dumb-sounding trick that works": encrypt env var values before pasting them into Vercel or Railway, hardcode the decryption key in your source, decrypt at runtime. If the provider's control plane is popped (like Vercel's April and Railway's October env var breaches this year), attackers only get ciphertext.
Implementation is 40 lines of Node, zero dependencies, AES-256-GCM—the key lives in your code, the ciphertext on the host; neither is useful alone.
More from coding & agent
- Cost-vs-quality chart puts Gemini 4 Neon on the CursorBench Pareto frontier — zacharynado · 2026-11-20
- Codex bug: GPT-6.2 cache hit rate drops from 97.4% to 46.4%, system prompts billed at full price — steipete · 2026-11-20
- Team builds hermetic "Mirror Dimension" synthetic web to safely test browser agents and prompt injections — laparisa · 2026-11-20
- OpenMontage: a self-hosted pipeline for consistent AI short dramas — Direct_Grab7063 · 2026-11-20
- Inkling-2-Small costs 3.7-4.9x less than Claude Sonnet 5.5 on structured pipeline tasks — HowDevelop · 2026-11-20
- Onlook goes open-source: local-first desktop app puts real products on an infinite canvas — ycombinator · 2026-11-20