Best for: Maximum security, cross-platform compatibility, and single-file encryption.
OpenSSL is a robust, cryptography-grade toolkit found on virtually every Linux distribution, macOS, and even Windows (via WSL or Git Bash). It uses military-grade AES (Advanced Encryption Standard) encryption. password protect tar.gz file
zip --encrypt -r secured_backup.zip my_folder/
Important: By default, zip uses a weak PKZIP stream cipher. For real security, force AES: Important: By default, zip uses a weak PKZIP
zip -r -e --password=yourpassword -AES256 secured_backup.zip my_folder/
(Note: Not all zip versions on Linux support AES-256; check your man page.) (Note: Not all zip versions on Linux support
gpg --decrypt backup.tar.gz.gpg | tar xz
You will be prompted for the password. The unencrypted data streams directly to tar.
Alternatively, skip tar.gz entirely and use .7z—it compresses better and supports native encryption.