File Encryption/Decryption with AES using linux

Ahmed202 picture Ahmed202 · Dec 14, 2016 · Viewed 27.7k times · Source

I'm using openwrt linux distribution and I want to encrypt a file using AES. How can I do that quickly and easily, and how can I - or someone else -decrypt it again?

Answer

Vasily G picture Vasily G · Dec 14, 2016

The quickest and easiest way is to use openssl util (provided by openssl-util package). For example, to encrypt a file, issue the following command:

openssl enc -aes-256-cbc -in file.txt -out file.enc

To decrypt:

openssl enc -d -aes-256-cbc -in file.enc -out file.dec