Primary Encryption & Decryption
Step 1: Create the Tar Archive
To begin the backup process on Ubuntu 24.04, you must first aggregate your files. Using tar with the -cvzf flags allows you to create a new archive while simultaneously applying Gzip compression. This reduces disk space usage and prepares the data for efficient encryption, making it a standard practice for Linux sysadmins managing large datasets.
Step 2: Apply Symmetric Encryption
Securing your data requires GPG symmetric encryption, which utilizes a robust AES-256 cipher. By running this command, Ubuntu prompts you for a passphrase to lock the file, creating a .gpg output. This ensures that even if the archive is intercepted on an insecure network, the contents remain inaccessible without the specific cryptographic key you provided.
Step 3: Secure Decryption
When data recovery is necessary, the GPG decryption process reverses the cipher. By redirecting the output of the -d flag into a filename, you restore the original compressed tarball. This command line utility is essential for maintaining data integrity on Linux systems, providing a reliable method to unlock encrypted backups for maintenance or migration.
Step 4: Final Extraction
The final stage involves extracting the Tar archive to restore the original file structure. The -xvzf flags instruct the system to uncompress the Gzip stream and unpack the files into the current directory. This Linux command line operation preserves all original permissions and directory hierarchies, completing the secure data lifecycle on your Ubuntu workstation.
| Tool | Action | Outcome |
|---|---|---|
| Tar | Aggregation | Single .tar file |
| Gzip | Compression | Reduced size (.gz) |
| GPG | Encryption | Secure binary (.gpg) |