SOURCE_DIR=$1 OUTPUT_BASE=$2
GPG is another industry-standard tool. Unlike OpenSSL (which uses a single password/key), GPG can use either a passphrase (symmetric encryption) or public/private key pairs. For pure password protection, we'll use symmetric encryption. gpg --symmetric --cipher-algo AES256 backup.tar.gz This produces a file named backup.tar.gz.gpg . GPG will ask you to enter and confirm a passphrase. password protect tar.gz file
By adding a password through or GPG , you transform that cardboard box into a steel safe. The process takes only a single extra command, but the security gains are immeasurable. gpg --symmetric --cipher-algo AES256 backup
In the world of Linux and Unix-based systems, the tar command is the gold standard for archiving files. When you combine it with gzip (creating a .tar.gz or .tgz file), you get a highly efficient, compressed archive perfect for backups, software distribution, and data transfer. The process takes only a single extra command,