Compress the "folder" folder with tar and then encrypt it with the symmetric encryption method aes-256-cbc using OpenSSL and save it as a file:
tar cz folder/ | openssl aes-256-cbc -pbkdf2 -e > folder.tar.gz.enc
Decrypt and unpack the file again:
cat folder.tar.gz.enc | openssl aes-256-cbc -pbkdf2 -d | tar xzv
Last modified: Dec. 15, 2022