How to Encrypt and Decrypt Files and Directories Using Tar and OpenSSL

To package, compress and encrypt:
tar cz path_to_source | openssl enc -e -aes256 -out encrypted.tar.gz

To decrypt, decompress and extract
openssl enc -d -aes256 -in encrypted.tar.gz | tar xz

Syndicate content