Encrypt your secrets into one local file, injected as environment variables at launch — zero code changes, one command to enable.
In 2026, xAI's Grok Build and Zhipu's ZCode were both caught silently uploading users' entire codebases — Git history, local records, and plaintext API keys, all packaged and shipped to the cloud. keyfort encrypts your secrets into a single .keyfort file: even if a tool packages it up and sends it away someday, what leaves your machine is ciphertext.
DB_PASS, API_KEY and other sensitive values no longer sit in plaintext inside your project. When you develop, entering the project directory automatically injects them as environment variables — npm run dev and python main.py run untouched, not a single line of code changes.
A purely local tool: no account, no server, no network requests of any kind. Built for individual developers.
$ pip install keyfort $ cd my-project $ keyfort .env.local my-password Scope? [1] all (default) [2] partial — keep only the lines to encrypt, in your editor: 2 ↳ your editor opens: keep the lines to encrypt, save & close Original .env.local? [1] hide the secrets in place (default) ...: 1 $ npm run dev # secrets are already in the environment # ---- next session ---- $ cd my-project # open a new terminal, cd in — auto-injected, nothing to type In terminals without the integration installed, typing the single word keyfort also drops you into the injected environment (exit to return).
$ pip install keyfort # before the first release: pip install git+https://github.com/aiPublicProject/keyfort.git Python ≥ 3.9; Windows / macOS / Linux.
Note: interactive CLI messages are currently Chinese-only. Localization is on the roadmap.
$ cd your-project $ keyfort .env.local your-password It asks two things in order: the encryption scope (everything, or partial — an editor opens where you keep only the lines to encrypt; what you keep IS the selection, and editing line counts doesn't matter), and what to do with the original file (hide the secrets in place — values become placeholders, default / you handle it yourself). Then terminal integration installs automatically and you enter the injected environment.
$ keyfort edit # edit secrets in your editor; re-encrypted on close (password required) $ keyfort set KEY value # add a secret (no password) $ keyfort restore # one-click restore to plaintext; deletes .keyfort and the cached password What ends up on your machine:
The terminal integration adds a small marked script to: PowerShell 5.1/7 profiles, bash's .bashrc, and cmd's AutoRun. If PowerShell's execution policy is Restricted and profiles don't load: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.
Encryption. .keyfort stores the ciphertext of the selected KEY=VALUE lines:
KEYFORT1 The encryption key is derived from your password via PBKDF2-HMAC-SHA256 (200,000 iterations) with a fresh random salt each time. AES-256-GCM is authenticated — a tampered file fails to decrypt rather than yielding fake values. Only raw bytes are stored; KEY=VALUE parsing happens only at injection time.
Placeholders. On registration, selected secret values in the original file are replaced with placeholders — the file now holds only placeholders and ordinary vars, and is safe to commit (config visible, values invisible). At injection time the real values are already set as same-named environment variables, and dotenv-family frameworks never overwrite existing env vars — so the placeholders are never read by your app.
Injection. Environment variables are the OS's parent-to-child mechanism — keyfort decrypts, spawns a child shell (bash / PowerShell / cmd auto-detected), and puts the variables into its environment block, so any language can read them. Terminal integration takes another path: a shell function calls keyfort activate --emit to get an assignment script and runs it in the current session (a shell function is not a child process, so it can modify the current environment); the KEYFORT_ACTIVE_KEYS marker prevents double injection and enables cleanup.
New machine. Copy .keyfort over and type the password once — the ciphertext is OS-independent, no re-encryption needed.
Why these guarantees matter — two real incidents:
The common thread: users only learned what these tools uploaded from their own machines through reverse engineering — and a plaintext .env goes to the cloud along with the workspace. keyfort's answer works in both directions: .keyfort contains only ciphertext, so uploads can't hurt you; and keyfort makes zero network requests with open-source code — no reverse engineering needed to know what it does.
$ git clone https://github.com/aiPublicProject/keyfort.git $ cd keyfort && pip install -e . $ python tests/cli_flow.py # full-flow tests; all should PASS $ python -m build # build into dist/ Planned features and design trade-offs (placeholder model, proxy mode, explicit non-goals) are in ROADMAP.md (currently Chinese).
env dotenv secrets environment encryption aes-gcm
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




