Manage secrets in configuration files.
curl -sf https://gobinaries.com/karimsa/secrets/cmd/secrets | sh
- Encrypt/decrypt selective values
- Supports yaml, json, and .env files
- Editor mode to selectively re-encrypt secrets (better git diffs)
Encrypting secrets in a .env file
$ cat .env
HELLO=SECURE-WORLD
HI=INSECURE-WORLD
$ secrets encrypt --in .env --out .env --key .HELLO
Passphrase: ******
$ cat .env
HELLO=64745a1f754b45bb60c40e14c04ead39afb0d774e9f25f90459de9f714da3ed19c94063e79649d38b0ebb5cc3eaf06554476cbf7bc65ef0cd472c28370bcdb57105343180700523771733f8cfe2e7222
HI=INSECURE-WORLD
Reveal secrets from .env file
$ cat .env
HELLO=64745a1f754b45bb60c40e14c04ead39afb0d774e9f25f90459de9f714da3ed19c94063e79649d38b0ebb5cc3eaf06554476cbf7bc65ef0cd472c28370bcdb57105343180700523771733f8cfe2e7222
HI=INSECURE-WORLD
$ secrets decrypt --in .env --key .HELLO
Passphrase: ******
HELLO=SECURE-WORLD
HI=INSECURE-WORLD
$ cat .env
HELLO=64745a1f754b45bb60c40e14c04ead39afb0d774e9f25f90459de9f714da3ed19c94063e79649d38b0ebb5cc3eaf06554476cbf7bc65ef0cd472c28370bcdb57105343180700523771733f8cfe2e7222
HI=INSECURE-WORLD
Edit config file then re-encrypt changed values
Licensed under MIT license.