I recently needed to password encrypt a ZIP file on my Mac. Most of the free GUI software (Stuffit, Unarchiver, etc..) can only unarchive and decrypt file but you have to purchase a premium version in order to encrypt a file.

Fortunately, if you’re ok with using the Terminal, Mac OS X already comes with an easy way to password encrypt a ZIP file. Simply type in a Terminal

zip -ejr [name_of_archive] [path_to_file]

where name_of_archive is the name that you want to give to your ZIP file and path_to_file is the complete path to the file or folder that you want to compress. You will then be asked for a password that will indeed be the password used to decrypt the archive. In the ejr options, e stands for encrypt, j for junk-paths (do not store directory names) and r for recursive-paths (travel the directory structure recursively).