How to make a password-protected ZIP on Mac
Finder’s Compress has no password option. Terminal’s zip -e adds one, but with the old, weak ZipCrypto encryption; for real protection, make an AES-256 ZIP or 7z with an app such as OpenRAR for Mac or Keka.
macOS can’t add a password to a ZIP from Finder: Compress always makes an unprotected archive. You have two ways to get one. The built-in zip command in Terminal can encrypt an archive in one line, but it uses ZipCrypto, an old scheme that is easy to break. For anything that matters, use an app that makes AES-256 ZIP or 7z archives. Opening protected ZIPs is easier: Archive Utility asks for the password of a classic ZIP, and other tools handle the rest.
The quick way: zip -e in Terminal
macOS ships with the Info-ZIP zip command. To make an encrypted archive of a folder, open Terminal, go to the folder that contains it, and run:
cd ~/Desktop
zip -er archive.zip MyFolder
-e turns on encryption and -r includes everything inside the folder. Terminal asks for the password twice and shows nothing while you type, which is normal. For a single file, leave out -r:
zip -e report.zip report.pdf
Avoid the -P password option you may see online: it puts the password in plain text on the command line, where it ends up in your shell history.
The resulting ZIP opens on any Mac or PC with the password. The catch is the encryption itself.
Why ZipCrypto is weak
zip -e uses the traditional PKWARE encryption, usually called ZipCrypto. It dates from the early days of the format and has well-documented weaknesses: with free tools, a short or common password can be guessed quickly, and an attacker who knows part of the contents of one file can often recover the files without guessing the password at all.
So ZipCrypto is fine for keeping a nosy colleague out of a holiday photo folder. It isn’t a safe way to send tax documents, contracts or anything you’d mind seeing leaked.
The safer way: AES-256 ZIP or 7z
Modern archivers encrypt with AES-256, the standard used for disk and network encryption. Two formats support it:
- AES-256 ZIP: still a .zip, but with a stronger encryption method. Most archivers open it, including 7-Zip and WinRAR on Windows; some older or built-in tools don’t (see below).
- 7z: 7-Zip’s format always uses AES-256 for passwords and can also encrypt the list of file names, so nobody can see what’s inside without the password. It usually compresses better than ZIP too. The person you send it to needs an app that opens 7z.
Apps that create both on a Mac:
- OpenRAR for Mac makes ZIP and 7z archives, both optionally protected with AES-256, as well as TAR. It’s free for personal use and also opens protected ZIP, 7z and RAR archives. It doesn’t create RAR.
- Keka is a popular archiver that also creates password-protected ZIP and 7z files and offers many formats and options.
- 7-Zip’s command-line version (
7zz) runs on macOS too; see Is there 7-Zip for Mac?.
Whatever the tool, the password is the real protection. A long passphrase of several unrelated words is far harder to break than a short word with a number on the end. Send the password by a different route than the archive, for example by text message rather than in the same email.
What ZIP encryption doesn’t hide
Even with AES-256, a ZIP only encrypts the contents of each file. Anyone who has the archive can see the file names, folder structure and sizes without the password. If a name like Divorce settlement draft.pdf is itself sensitive, choose 7z with encrypted file names, or rename the files before archiving.
Opening a password-protected ZIP on Mac
What works depends on how the ZIP was encrypted.
ZipCrypto (classic) ZIPs
Double-click the file. Archive Utility, the Mac’s built-in archiver, asks for the password and then expands the archive next to it. The unzip command in Terminal works too and prompts for the password:
unzip archive.zip
AES-encrypted ZIPs
These are often made on Windows with 7-Zip, WinRAR or WinZip. The unzip command built into macOS can’t decrypt them: it skips each file with an “unsupported compression method 99” message. The ditto command fails as well, and Archive Utility may show an “Unable to expand” error instead of a password prompt. When that happens, nothing is wrong with the file; you just need a tool that supports AES:
- In your browser: drop the ZIP on openrar.app, type the password, and save the files one by one or all together. Nothing is uploaded; the archive is opened on your Mac.
- OpenRAR for Mac, Keka or The Unarchiver open AES ZIPs and ask for the password.
If you’re not sure which kind you have, simply try Archive Utility first and switch tools if it fails. For other “Unable to expand” messages, see Fixing “Unable to expand” errors.
Protected RAR and 7z
A password-protected RAR or 7z file is a different case: Archive Utility can’t open RAR at all. Drop it on openrar.app instead, which asks for the password, or use OpenRAR for Mac or another desktop archiver, which also handle archives of several gigabytes; Opening a password-protected RAR explains the options.
Which should you choose?
| You want to… | Use |
|---|---|
| Keep casual eyes out, open anywhere | zip -e (ZipCrypto) |
| Protect sensitive files, recipient has a modern archiver | AES-256 ZIP |
| Protect files and their names, smallest size | 7z with AES-256 and encrypted names |
If the recipient is on a Mac without any extra software, a ZipCrypto ZIP opens with a double-click; an AES ZIP or a 7z needs an app or the browser tool. For more on the trade-offs between formats, see RAR vs ZIP vs 7z.