How to Password Protect Zip Files in Mac OS X

In Mac Tools, OSX by bchesleyLeave a Comment

Run Terminal from the Applications > Utilities folder

Type the following command and press [ENTER]:

zip -e filename.txt

Enter and verify the password when prompted and save this information somewhere secure (1Password secure notes work well). Unless your password entries don’t match the process will run and report files added until complete.

The archive “”, is now compressed and encrypted with the password entered. The file that was encrypted, “filename.txt” will display a password entry dialog for the user attempting to open it and only open or extract if the user provides the password used to encrypt the archive.

To compress and encrypt multiple files in a folder or group of folders add the ‘r’ option as shown in the example below:

zip -er ./MyDirectoryToZip

If the path to the directory contains spaces or other special characters you will want to escape these with backslashes as shown below:

zip -er Path\ With\ Spaces\MyDirectory

The zip utility has MAN help access by typing:

zip --help

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.