Set a Zip Password in Mac OS X
You can create password protected archives of files and folders:
- Launch the Terminal from the Applications > Utilities folder
- Type the following command:
- zip -e archivename.zip filetoprotect.txt
- Enter and verify the password – don’t forget this
The resulting archive, in this case named “archivename.zip”, is now encrypted with the password provided. The file that was encrypted, “filetoprotect.txt”, is now inaccessible without entering that password.
If you plan on compressing multiple files within a folder, you will want to slightly modify the command with the -er flag like so:
zip -er archive.zip /path/to/directory/
This is particularly important for encrypting zips of multiple files under OS X Mavericks.