How to Password-Protect an Archive (and Is It Safe)
A password on an archive feels like a solid safe. In reality the same ZIP can be either a real fortress or a lock you pick with a hairpin in a couple of hours. It all comes down to one easily-missed setting. Let's find out where it is — and how not to protect your files in vain.
What an archive password actually is
Many people picture an archive password as a lock on a door: without the key, the files simply "won't come out." The reality is more interesting. When you set a password, the archiver encrypts the contents — turns the data into a meaningless stream of bytes. Your password isn't stored inside the archive; a special formula derives an encryption key from it, and that key locks the data.
Two things follow. First: there's nowhere to recover a forgotten password from — it isn't in the file — so you must safeguard it. Second, and crucial: strength depends not on the "door" but on how the data is encrypted. And here's the trap: the same ZIP format can encrypt in two completely different ways — one strong, one almost useless.
In short
A password isn't a "door" — it's the key to a cipher. What makes an archive strong is the encryption type: weak ZipCrypto or strong AES-256. Pick the wrong one and even a long password won't save you.
ZipCrypto — the illusion of protection
ZipCrypto is the old encryption method built into the ZIP format since the early 90s. Its big plus is compatibility: any program will open such an archive. And that's where the pluses end. ZipCrypto is an outdated stream cipher with a fundamental weakness, and people have long known how to break it.
The main threat is the known-plaintext attack. It sounds complex, but the idea is simple: if an attacker knows or can guess even a small fragment of one of the original files, they can recover the key. And guessing a fragment is often feasible — for example, files of known formats have predictable beginnings (JPG, PDF and DOCX headers are standard). Researchers have shown that in many cases the "known text" requirement reduces to a guess based on file type and size, while the crack itself runs in roughly two hours on a single ordinary computer, using free tools.
Important
ZipCrypto can't be treated as protection for anything valuable. Password length and complexity barely help here: the attack targets the cipher's weakness, not the password. For real data — AES-256 only.
AES-256 — a real lock
AES-256 is the modern encryption standard — the same one that protects banking data and government secrets. AES is approved as an official standard (NIST FIPS 197), and in its 256-bit-key variant it resists all known practical attacks. The plaintext attack that's fatal to ZipCrypto doesn't work against AES-256 at all.
The good news: AES-256 is available in all three popular formats. In 7z and RAR it's the only encryption option — there's nothing to choose, protection is strong by default. In ZIP you have to choose manually: the archiver often offers ZipCrypto by default for compatibility, and AES-256 has to be selected explicitly. That's exactly why "I put a password on the ZIP" and "I securely protected the ZIP" are not the same thing. There's more on the differences between formats in the article ZIP vs RAR vs 7z.
Hidden file names: the detail people forget
Here's a nuance almost everyone misses. Even with AES-256, ZIP does not hide the file names inside the archive — only their contents are encrypted. So without knowing the password, an outsider still sees the structure: for instance, that it contains contract_jones.pdf, salaries_2026.xlsx and passwords.txt. Sometimes the names alone give away more than you'd like.
7z and RAR can encrypt the file list itself. In 7-Zip this is the "Encrypt file names" checkbox; in WinRAR it's "Encrypt file names" in the password dialog. With it on, the archive looks like a single opaque block from the outside: no names, no counts, no sizes. If the secret is not just the contents but the very existence of certain documents, this is the only correct choice.
How to set a password the right way
Let's fold it all into a short, safe sequence — the same in spirit for both 7-Zip and WinRAR:
Choose the 7z or RAR format
That gives you AES-256 right away plus the option to hide file names. If you specifically need ZIP — on the password step explicitly pick AES-256, not ZipCrypto.
Set a long, unpredictable password
12–16 characters or more, ideally a random phrase or a string from a password manager. Even strong AES is powerless against the password "12345".
Turn on name encryption (7z/RAR)
If hiding the file list matters, tick the corresponding box in the password dialog.
Share the password separately
Never send the archive and the password in the same message or channel. Archive by email, password over a messenger or by voice.
Five mistakes that undo your protection
Even with the right cipher, people routinely leave gaps open. Here are the most common:
- Left ZipCrypto as the default. The classic: a password is set, but the cipher is weak. Always confirm AES-256 is selected.
- A simple password. "qwerty", a birthday, a pet's name — all cracked from a dictionary in seconds, regardless of the cipher.
- Password next to the archive. Sending the archive and the password in one email or chat cancels the point: whoever accessed the conversation got both.
- Forgot about file names. With ZIP the names are always visible; if that's critical, you need 7z/RAR with name encryption.
- Didn't save the password. With AES-256, a forgotten password means the data is lost for good — it can't be recovered. Store it in a reliable password manager.
Need to prepare files before packing?
FormatZ helps you convert and compress documents and images before archiving — right in your browser, no install and no sign-up.
Open all convertersThe bottom line: a password on an archive really can protect your data — but only if it's AES-256 with a good password, not ZipCrypto with "12345". Learn once where the right checkbox lives, and protection becomes a habit. And if your goal isn't so much to lock files as to shrink them for sending, that's a separate topic, covered in how to shrink files for email.
Frequently asked questions about archive passwords
Read next
ArchivesZIP vs RAR vs 7z: Which Archive Format to Choose
Compression, speed and encryption of three formats, with numbers.
ArchivesHow to Open RAR and 7z on Your Phone
Apps for Android and iPhone, including password-protected archives.
ArchivesHow to Shrink Files for Email
Mail limits, volumes and the cloud — what to pick for the job.