How To Encrypt And Password Protect A Linux File

How to Encrypt the File

openssl enc -aes-256-cbc -in <input_file_name> -out <output_file_name>

How to Decrypt the File

Openssl enc -aes-256-cbc -d -in <input_file_name>

Example

>> openssl enc -aes-256-cbc -in myfile.tar -out myfile.dat
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:
>> openssl enc -aes-256-cbc -d -in myfile.dat -out myfile.tar
enter aes-256-cbc decryption password:
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License