Skip to content

Instantly share code, notes, and snippets.

@soygul
Created October 2, 2018 08:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save soygul/9d0d0b32ce2b3c43ecff9f8b4a2c8dde to your computer and use it in GitHub Desktop.
Save soygul/9d0d0b32ce2b3c43ecff9f8b4a2c8dde to your computer and use it in GitHub Desktop.
Encrypt/Decrypt Files Using OpenSSL
# encrypt
openssl enc -in test.txt -aes-256-cbc -pass pass:mypass -out test.txt.enc
# decrypt
openssl enc -in test.txt.enc -d -aes-256-cbc -pass pass:mypass -out test.txt
# valid password sources (as of OpenSSL 1.1.1, see 'man openssl' for more recent info):
# -pass pass:mypass
# -pass env:somevar
# -pass file:somepathname
# -pass fd:number
# -pass stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment