Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Encrypt File With Env VariablesNew to Visual Studio Code? Get it now.
Encrypt File With Env Variables

Encrypt File With Env Variables

Kevin Ashton

|
167 installs
| (0) | Free
Allows you to encrypt a file using a password. This is useful when you have a variety of files that will share the same encryption key. An example use case might be encrypting personal documents, such a journal, where you want to avoid typing in the password each time you want to encrypt/decrypt a d
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vsc-encrypt-file-with-env-variables README

This VsCode extension allows you to set an env variable of FILE_PASSWORD and then with a simple commands encrypt and decrypt a file.

Commands

  • encrypt.file - Encrypt file with AES encryption given the env value of FILE_PASSWORD

  • decrypt.file - Decrypt file with AES encryption given the env value of FILE_PASSWORD

Auto-encrypt on focus loss

You can optionally have matching files auto-encrypted in the buffer whenever VS Code loses focus (e.g. you switch to another app) or you switch to a different tab. This is useful for keeping secret content off-screen when you step away.

Set the encryptFile.autoEncryptPatterns setting to a list of globs:

"encryptFile.autoEncryptPatterns": ["**/*.secret.*"]

Notes:

  • Leave the setting empty (the default) to disable the behavior.
  • Auto-encrypt only modifies the editor buffer — the file on disk is not changed until you save.
  • Decryption is still manual via the decrypt.file command.

Demo

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft