How to password protect a zip file, what it hides, and what it does not
Several files have to go to somebody, and they should not be readable by whoever else handles the message. A zip with a password is the usual answer, it is a reasonable one, and there are three things about it that almost nobody is told.
Drop the files into STRONGBOX, type a passphrase, and it writes a zip encrypted with AES-256 in the WinZip form that 7-Zip, WinZip, WinRAR, Keka and The Unarchiver all read. It also opens one, given the passphrase. Everything happens in the tab; the files are not uploaded and the page works with the network off. Three things to know before you rely on it: Windows and macOS cannot open an AES zip with the tools they ship with, the older kind of zip password is broken and should not be used, and a locked zip still tells anyone holding it what the files are called.
Zip has two kinds of password
STRONGBOX writes AES-256 only. It will open a ZipCrypto archive, because somebody will send you one, and it says which kind it found.
The part that catches people out
Windows Explorer cannot open an AES-encrypted zip. Neither can the Archive Utility that macOS uses when you double-click one. Both handle zip files perfectly well and both only understand the old ZipCrypto password. Double-clicking an AES zip on a stock Windows machine gives an unhelpful error, or an empty folder, or a prompt that rejects the correct password.
This is not a fault in the file. It is a gap in the built-in tools, and it has been there for twenty years. If you are sending a locked zip to somebody, tell them to open it with 7-Zip (free, Windows), Keka or The Unarchiver (free, macOS), or WinZip or WinRAR if they have them — or send them a link to STRONGBOX, which opens it in their browser with nothing to install.
What a locked zip does not hide
Zip encrypts the contents of each file. It does not encrypt the list of files. Anybody holding the archive can read, without the password:
- Every file name and folder path.
Dismissal letter - Hannah Reid.docxtells the story before anyone types a password. - The size of each file, before and after compression, and how well each one compressed.
- The timestamps on each file.
- The number of files.
For most jobs this does not matter. For some — a leak, a grievance, a medical record — the names are the disclosure. The fix is to put the revealing zip inside a second, plain zip named something dull, or to use a container that encrypts its own index: CAPSULE makes a single encrypted file that opens in a browser and gives nothing away from the outside.
Choosing the passphrase
A zip passphrase is stretched with PBKDF2 at a thousand rounds, which was a reasonable number in 2003 and is a thin margin now: a modern graphics card tries a great many guesses a second. That makes the passphrase itself the whole of the protection. Four or five unrelated words beat any amount of punctuation stuffed into a short one — PHRASE generates them, and SHADOWKEY will tell you what a given one is actually worth.
And send it separately from the file. A password in the same email as the archive is a key taped to the envelope.
What gets compressed and what does not
STRONGBOX compresses what compresses and stores what does not. Text, spreadsheets, documents and logs shrink by a lot. Photographs, video, music and anything already zipped are already compressed, so they are stored as they are rather than churned through an algorithm that would add a fraction of a percent. The listing shows which happened to each file.
Opening one
Drop the archive in, type the passphrase, and the contents are listed: what is in it, how large each file is, and whether the encryption is AES or the old ZipCrypto. Save one file or save all of them. A wrong passphrase is caught immediately — the format carries a two-byte check for exactly that — and said in plain words rather than as a failure halfway through.
Zip against the alternatives
| If you want | Use | Why |
|---|---|---|
| Several files to one person who has 7-Zip or a Mac tool | A locked zip | Universal format, real encryption |
| One file to somebody with nothing installed | CAPSULE | Opens in any browser; the outside says nothing |
| A PDF only they should read | PADLOCK | Every PDF reader asks for the password |
| To send to the same person often | KEYRING | Encrypt to their key; no shared password to send |
| Just to make a zip, no password | PACK | Zip and unzip, nothing else |
The short version
| The job | Here | Notes |
|---|---|---|
| Make a zip nobody without the passphrase can read | Yes | AES-256, the WinZip form everything reads |
| Open a locked zip somebody sent | Yes | AES or the old ZipCrypto, named either way |
| Keep the files off somebody else's server | Yes | Written and read in the tab; works offline |
| Open it by double-clicking on Windows or a Mac | No | Neither built-in tool understands AES zips |
| Hide what the files are called | No | No zip does; the names are in the clear |
| Write the old ZipCrypto password | No | Deliberately: it has been broken since 1994 |
| Open a 7z, a rar or an encrypted 7z | No | Turned away with a sentence saying which it is |
Questions people ask about password protecting a zip
Related tools
- STRONGBOXMake, or open, a password-protected zip on this device.
- CAPSULEAn encrypted file anyone can open in a browser.
- PACKZip and unzip files in the browser.
- PADLOCKPut a password on a PDF, or take one off.
- PHRASEPassphrases, passwords and recovery phrases.
- KEYRINGMake an age key pair and encrypt files to one.