Create Encrypted zip Archives on OS X

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:

Create a zip archive

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.

No Comments Yet.

Leave a comment