Mac OSX: Creating ‘Password Protected’ Zip Files

KB ID 0001357

Problem

Me to the office: Does anyone know how to create a password protected Zip file on a Mac?

Reply: Use Windows

Well actually this advice is ‘bobbins!’ Windows still can’t do this without installing an application, (I would recommend 7-Zip). But with a Mac of course you can 🙂

Solution

First open an Terminal window, then ‘change directory’ to the folder that contains the uncompressed file(s), or folder(s) you want to Zip.

Changing Directory With Spaces In Your Foldernames

I thought I’d better put this here, if you have spaces in your folder names, you use the following syntax;

And repeat if you have multiple spaces like so;

Mac OSX: Create a Normal Zip File

Before we try and password protect a Zip, file let’s see how to create a simple one;

[box]zip -r {Archive-Name}.zip {Folder-or-Filename-To-Add}[/box]

Mac OSX: Adding Password Protection To Zip Files

Use the following syntax;

[box]zip -e {Archive-Name}.zip {Folder-or-Filename-To-Add}

Enter and Confirm The Password[/box]

Related Articles, References, Credits, or External Links

NA