Archive:Security Guide/7Zip

= Chapter 4, Section 3 - 7-Zip Encrypted Archive =

Introduction to 7-Zip Encrypted Archives
7-Zip is a cross-platform, next generation, file compression tool that can also use strong encryption (AES-256) to protect the contents of the archive. This is extremely useful when you need to move data between multiple computers that use varying operating systems (i.e. Linux at home, Windows at work) and you want a portable encryption solution.

7-Zip Installation in Fedora
7-Zip is not a base package in Fedora, but it is available in the software repository. Once installed, the package will update alongside the rest of the software on the computer with no special attention necessary.

Step-by-Step Installation Instructions
Click Applications -> System Tools -> Terminal
 * Open a Terminal:

sudo yum install p7zip
 * Install 7-Zip with sudo access:

exit
 * Close the Terminal:

Step-by-Step Usage Instructions
By following these instructions you are going to compress and encrypt your "Documents" directory. Your original "Documents" directory will remain unaltered. This technique can be applied to any directory or file you have access to on the filesystem.


 * Open a Terminal: Click Applications -> System Tools -> Terminal

7za a -mhe=on -ms=on -p Documents.7z Documents/
 * Compress and Encrypt: (enter a password when prompted)

The "Documents" directory is now compressed and encrypted. The following instructions will move the encrypted archive somewhere new and then extract it.

mkdir newplace
 * Create a new directory:

mv Documents.7z newplace
 * Move the encrypted file:

cd newplace
 * Go to the new directory:

7za x Documents.7z
 * Extract the file: (enter the password when prompted)

The archive is now extracted into the new location. The following instructions will clean up all the prior steps and restore your computer to its previous state.

cd ..
 * Go up a directory:

rm -r newplace
 * Delete the test archive and test extraction:

exit
 * Close the Terminal:

Things of note
7-Zip is not shipped by default with Microsoft Windows or Mac OS X. If you need to use your 7-Zip files on those platforms you will need to install the appropriate version of 7-Zip on those computers. See the 7-Zip download page.

GNOME's File Roller application will recognize your .7z files and attempt to open them, but it will fail with the error "An error occurred while loading the archive." when it attempts to do so. This is because File Roller does not currently support the extraction of encrypted 7-Zip files. A bug report (Gnome Bug 490732) has been submitted.