Skip to content

Password-protected ZIP: ZipCrypto vs AES-256, and why it matters

Haven Zip team · · 2 min read

Two ZIP files can both ask for a password and offer completely different protection. One uses a 1990s scheme with known weaknesses that tools crack in minutes on a laptop. The other uses AES-256, the same cipher behind disk encryption and banking. The dialog box looks identical in both cases, which is the problem.

ZipCrypto: a lock that opens with a paperclip

The original ZIP encryption, described in the specification as the traditional PKWARE method, is a stream cipher with three 32-bit registers. In 1994 Biham and Kocher published a known-plaintext attack against it: if an attacker knows as little as 12 bytes of one file inside the archive, the whole archive can be opened without the password. Knowing 12 bytes is easy; every file format has a fixed header.

Because of this, many tools still create ZipCrypto archives for compatibility, and many built-in extractors only understand ZipCrypto. A password on such an archive keeps out a casual glance and nothing more.

AES-256 in ZIP and 7z

WinZip introduced AES encryption for ZIP in 2003 (the AE-1 and AE-2 formats), and 7-Zip adopted it for both 7z and ZIP. The password is stretched with PBKDF2 into a key, the data is encrypted with AES in counter mode, and an HMAC checks integrity. There is no known shortcut; the only attack is guessing the password, so a long passphrase is genuinely safe.

7z goes one step further with header encryption: file names, sizes and the directory structure are encrypted too. With an AES ZIP, the names of the files are still visible to anyone who opens the archive.

How to tell which one you have

Open the archive in a tool that shows the method column. 7-Zip lists AES-256 versus ZipCrypto per file. Haven Zip shows a lock icon on encrypted archives and, when you create one, always uses AES-256, never ZipCrypto.

If you must produce an archive for a recipient whose only tool is the operating system's built-in extractor, know that Windows Explorer cannot open AES ZIP files at all, and macOS Archive Utility cannot either. In that case a 7z archive plus a link to a free extractor is a better answer than a weakly encrypted ZIP.

  • Never rely on ZipCrypto for anything you would mind others reading.
  • Use a passphrase of four or more random words; AES cannot be shortcut, but a short password can be guessed.
  • Send the password through a different channel than the file.

Related

All posts