how to encrypt and decrypt files with openssl

to encrypt:

  • openssl enc -a -aes-256-cbc -salt -in myfile -out myfile.encrypted

to decrypt:

  • openssl enc -d -aes-256-cbc -a -in myfile.encrypted

or… much easier:

  • openssl des3 < myfile > myfile.encrypted

and

  • openssl des3 -d < myfile.encrypted > myfile

to use blowfish instead of triple DES, replace des3 in the commands above with bf. i.e., + openssl bf < myfile +.