OpenSSL to encrypt a file

There are more elegant ways to do this, but when you need to encrypt a file from one point to another this works and the tool is almost always available.

<br />encrypt:<br />openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc<br />(password)<br /><br />decrypt:<br />openssl enc -d -aes-256-cbc -a -in file.enc -out file.txt<br />(password)<br />

source:
OpenSSL Command-Line HOWTO

Leave a Reply