Creating encrypted Zip archives with OS X

April 9, 2007 popular , life 1 min read

Sadly, OS X Tiger doesn’t come with a way to create or open encrypted Zip archives, even from the command line (hopefully this will change with Leopard if you have Leopard then you can skip the MacPorts part and just use the command at the end). The man pages for zip say that it supports it, but when you pass the -e or -P option, it complains:

zip error: Invalid command arguments (encryption not supported)

Fortunately, MacPorts (formerly DarwinPorts) to the rescue! There’s a version of the command line zip utility in MacPorts that works as advertised.

Install MacPorts, and install the new command line zip utility:

sudo port install zip

Move the old /usr/bin/zip out of the way, and then create encrypted Zip archives to your hearts content.

zip -re mydir/
Enter password: ********
This content is open source. Suggest Improvements.


avatar of Brandon Keepers I am Brandon Keepers, and I work at GitHub on making Open Source more approachable, effective, and ubiquitous. I tend to think like an engineer, work like an artist, dream like an astronaut, love like a human, and sleep like a baby.