command line encrypt files

To Encrypt

We do the following steps

tar czvpf - file1.txt file2.pdf file3.jpg | gpg --symmetric --cipher-algo aes256 -o myarchive.tar.gz.gpg

TO Decrypt

We do the following steps

tar czvpf - file1.txt file2.pdf file3.jpg | gpg --symmetric --cipher-algo aes256 -o myarchive.tar.gz.gpg
file1.txt
file2.pdf
Enter passphrase: 

Mac Error

There seems an error reading the password from stdin on the mac - so try this

brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf