Being able to create encrypted zip archives is your best friend if you are negotiating for a job, bidding on a contract, exchanging medical or financial information with family, or planning for world domination. With everyone from the kids in the high school computer club, to criminals, your Internet provider, and our own government snooping on your email (and when it comes to your Internet provider and government, it is likelyÂ allÂ your email), you may want to have some assurance of privacy for at least a few emails.
TheÂ only wayÂ such assurance can even begin to be assumed is if the contents of the email are encrypted. We aren't talking using HTTPS or SSL to encrypt the email. We need to encrypt the actualÂ contents.
OS X has a built-in tool to do this by usingÂ Disk Utility. However, creating an encrypted .dmg file only works if you will be exchanging email with another OS X user.
Windows, UNIX, and Linux users can create and open encrypted .zip files, but OS X can only open such files.
Well, that is not exactly true. OS X has a graphical interface toÂ createÂ zip files (right-click on a file or folder, and then selectÂ Compress <file or folder name>,Â but it only has a command line interface to createÂ encryptedÂ zip files. Good thing that the command line is easy and simple. Once used, your encrypted .zip file can be attached to an email, sent to anyone regardless of their operating system, and you can be assured of privacy and their ability to just double-click to open (assuming they know the password.
In this blog we will show how with one line you can create these encrypted .zip archives.
Create an encrypted .zip archive
1. On your OS X computer, openÂ Terminal.app.Â This is located in the /Applications/Utilities folder.
2. In Terminal, enter the following command, but don't yet press theÂ EnterÂ orÂ ReturnÂ key (we have more to enter):
zip Â -erj Â "~/Desktop/<name of the encrypted archive to be created>.zip"
Translated this means:
-Â zip: Perform the zip command (compress a target into a single file)
-Â -e: Encrypt the archive
-Â r: Recursively include the contents of the target folder
-Â j: Strip out junk of the URL. Without this option, the archive includes memory of the URL location of the target folder. When expanding the archive, it will create a folder hierarchy of the original source folder or file.
-Â "~/Desktop/<name of the encrypted archive to be created>.zip": This will create a zip file on your desktop in the name you enter. The quote marks allow you to include spaces and other special characters in the name.
3. Drag the source file or folder into the Terminal window. This will add the full URL to that item into the command line. Assuming that your source folder is namedÂ Folder, and is located on yourÂ Desktop, the result will look like:
zip Â -erj Â "~/Desktop/<name of the encrypted archive to be created>.zip" Â /Users/<your user name>/Desktop/Folder
4. Press theÂ EnterÂ orÂ ReturnÂ key to start the encryption process.
5. At theÂ Enter passwordÂ prompt, enter a strong password, and thinkers theÂ EnterÂ orÂ ReturnÂ key. Note that there will be no response on screen to your password input.
6. At theÂ Verify passwordÂ prompt, reenter the strong password, and then press theÂ EnterÂ orÂ ReturnÂ key.Â Note that there will be no response on screen to your password input.
7. Your Terminal window will look like this:
8. A new file will be found on your Desktop, with the name you entered in step 2 above.
9. Attach this new .zip file to your outgoing email.
Opening an encrypted .zip archive
At the recipients computer, all that is needed to read your encrypted attachment is to:
1. Save the attachment to their Desktop.
2. Double-click on the saved attachment.
3. On an OS X computer, the recipient will be prompted for the password. Upon entry, a new decrypted folder will appear on the desktop. On a Windows computer, the recipient see the contents of the archive. When double-clicking any of the contents they will be prompted for theÂ password. Upon entry, that content will open for view.