Ondrej Sika

Encrypt & Decrypt file in Linux

04 Jan 2014

Use openssl

KEY="secretkey"

encrypt="openssl aes-256-cbc -a -salt -k $KEY"
decrypt="openssl aes-256-cbc -a -d -salt -k $KEY"


cat input.txt | $encrypt > crypted.txt
cat crypted.txt | $decrypt > output.txt

file input.txt

Hello World

file crypted.txt

U2FsdGVkX18NtMIrL2VOBK7tMQt0LqgDfBgZ4DvcyMk=

file output.txt

Hello World

Share on Facebook, Twitter, Google+, Linkedin

comments powered by Disqus

--