Since tar doesn't encrypt, the most common method on Unix-like systems is to pipe your tarball through . This is powerful because OpenSSL is pre-installed on almost every Linux distribution and macOS. Create and Encrypt in One Command:
: You will be prompted to enter and verify a passphrase. This creates a new file named file.tar.gz.gpg Decryption gpg -d file.tar.gz.gpg > file.tar.gz to restore the archive. On-the-Fly Creation password protect tar.gz file