Password Protect Tar.gz File [2021] 〈PREMIUM〉
This is superior for sharing files with specific people. You encrypt with their public key, and only they can decrypt with their private key.
Ultimately, password protecting a tar.gz file represents a maturation in how we view our digital assets. It is the transition from merely storing files to securing them. In a digital landscape rife with surveillance and theft, the ability to wrap your data in a layer of encryption is the closest thing we have to a superpower: invisibility. The archive password protect tar.gz file
To extract the file, use:
| To do this... | Use this command... | |---------------|----------------------| | Encrypt an existing .tar.gz | openssl enc -aes-256-cbc -salt -in file.tar.gz -out file.enc | | Decrypt and extract | openssl enc -d -aes-256-cbc -in file.enc | tar xz | | Create from scratch (no trace) | tar cz folder/ | openssl enc -aes-256-cbc -out backup.enc | | Use GPG instead | gpg --symmetric --cipher-algo AES256 file.tar.gz | This is superior for sharing files with specific people
You can directly create a compressed, encrypted archive without creating a temporary unencrypted file. It is the transition from merely storing files
openssl enc -aes-256-cbc -salt -in audit_report.tar.gz -out audit_report.enc
Be careful: If you create secret.tar.gz first, then encrypt it, the original unencrypted secret.tar.gz might still be on your disk. Always shred or securely delete the plaintext version.