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