opensoul.org

Creating encrypted Zip archives with OS X

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 myarchive.zip mydir/
Enter password: ********

mac, osx, popular, security, and zip April 08, 2007

5 Comments

  1. dade murphy dade murphy October 2, 2007

    nice work! works for me…

    ASUS A8Fm Notebook
    OSX86 10.4.8

    thanks~

  2. Jeff Jeff December 10, 2007

    Seems that zip -e in Leopard works fine as is, without Darwin ports.

  3. kg23 kg23 February 4, 2009

    Just an FYI that a .zip created this way is not encrypted when accessed on a Windows machine. I was able to view the encrypted .zip without any password entry.

  4. kg23 kg23 February 4, 2009

    My bad! The files are encrypted even on Windows. The filenames can be viewed however without having the password.

  5. Alex Alex October 13, 2009

    Thank you for the great tip! Yes, in (Snow) Leopard, the zip utility comes with encryption. Sadly though, even in Snow Leopard OS X’s built-in GUI archive utility cannot handle password encrypted files, you still have to use Stuffit Expander or something similar.

Post a Comment

Comments use textile. Anonymous comments will be deleted.

I am Brandon Keepers. I build Internet things, usually with Ruby or JavaScript. I work at GitHub and live in Holland, MI.

Popular Posts