Encrypt a single file:
openssl enc -aes-256-cbc -e -in <file> -out <file>.enc
cat <file> | openssl enc -aes-256-cbc -e > <file>.enc
Create an archive and encrypt:
tar cz <folder> | openssl enc -aes-256-cbc -e > <folder>.tar.gz.enc
Decrypt a single file:
openssl enc -aes-256-cbc -d -in <file>.enc -out <file>.dec
cat <file>.enc | openssl enc -aes-256-cbc -d > <file>.dec
Decrypt and extract an archive:
openssl enc -aes-256-cbc -d -in <folder>.tar.gz.enc | tar xz
To add base64-encoding/decoding, use -a
.