Skip to main content

Password Protect Tar.gz File |work| Jun 2026

The most common way to password-protect a tarball on Unix-like systems is using . This creates a .gpg file that requires a password to decrypt. To Create and Encrypt:

Here’s a little secret: A tar.gz file is not the only archiving format. The .zip format has supported password-based AES encryption for years. While you lose some of the Unix-specific perks of tar (like preserving exact ownership and symlinks), the zip command can directly compress and encrypt a folder. password protect tar.gz file

You will be prompted to enter and verify a password. The most common way to password-protect a tarball

You will be prompted to enter and verify your password in the terminal. gpg -d secure_archive.tar.gz.gpg | tar -xzvf - Use code with caution. Copied to clipboard Method 2: Using 7-Zip (Best for Cross-Platform) You will be prompted to enter and verify

Note: 7-Zip cannot create .tar.gz directly with encryption because the GZIP compression layer does not support passwords.

gpg --symmetric --cipher-algo AES256 myfiles.tar.gz