Search code examples
linuxencryptionaesopenwrt

File Encryption/Decryption with AES using Linux


I'm using the 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?


Solution

  • 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