Skip to content

Instantly share code, notes, and snippets.

@soulmachine
Created December 12, 2017 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soulmachine/27ecf7463620dba11dc03f6a61f97ba3 to your computer and use it in GitHub Desktop.
Save soulmachine/27ecf7463620dba11dc03f6a61f97ba3 to your computer and use it in GitHub Desktop.
openssl aes encrypt command line
# encrypt file.txt to file.enc using 256-bit AES in CBC mode
openssl enc -e -aes-256-cbc -salt -in file.txt -out file.enc
# the same, only the output is base64 encoded for, e.g., e-mail
openssl enc -e -aes-256-cbc -a -salt -in file.txt -out file.enc
# decrypt binary file.enc
openssl enc -d -aes-256-cbc -in file.enc -out file.txt
# decrypt base64-encoded version
openssl enc -d -aes-256-cbc -a -in file.enc -out file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment