Skip to content

Instantly share code, notes, and snippets.

@mstyne
Last active October 24, 2022 22:43
Show Gist options
  • Save mstyne/89e8d8e663b0bddbf432da4b6e282d58 to your computer and use it in GitHub Desktop.
Save mstyne/89e8d8e663b0bddbf432da4b6e282d58 to your computer and use it in GitHub Desktop.
Encrypt a file / pipe using OpenSSL
Encrypt:
openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc
command | openssl aes-256-cbc -a -salt > secrets.txt.enc
php ex.php ubersmith | openssl aes-256-cbc -a -salt > data.csv.enc
Decrypt:
openssl aes-256-cbc -d -a -in data.csv.enc -out data.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment