I had a requirement to compress a folder/directory and also encrypt it. And when needed i've to decrypt it. I did browse a lot to find a working answer on a MacOs. And i just manage to use the below steps to make it working.
Zip or tar zip the file/directory using zip or tar czf linux command
use
"gpg --encrypt sample-file-or-folder.zip"Prompts you to enter the passphraseOutcome of step 2, should result in sample-file-or-folder.zip.gpg
For decrypting .zip.gpg file use
"gpg --output sample-file-or-folder.zip --decrypt sample-file-or-folder.zip.gpg"--> This prompts you to enter the passphrase. Please note that if you don't mention "--output" it will not get the desired output.
Is there any other better way to get the desired result ?