zip -e myzipfile.zip file1.txt file2.txt
zip -e /users/<username>/Desktop/myzipfile.zip /users/<username>/Documents/file1.txt /users/<username>/Desktop/file2.txt
You can easily password protect a zipfile on your mac without any third party software... however to open a password protected zip file on a mac you do need a third party program like Zipeg.
Using terminal(Terminal is found in the Utilities folder inside Applications, it is basically a mac osx version of cmd prompt on windows)... [snip]
4 years on and just in case someone does a google and gets this page
For those of us who just don't do a lot of Terminal-ly things and don't want to figure out how to change directories and stuff, the easiest way I've found to password-protect a zip file is just using Keka, a free Mac app at http://www.kekaosx.com/en/.
All I had to do was open the app, type in my password that I want on my .zip file and just drag and drop the .zip file onto the app in my dock.
Voila! The encrypted .zip file appears in the same folder as the un-encrypted .zip file.