Archives

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.

Close-up of server drives with SAS labels — an image of secure data storage
A password on an archive means encrypting the data. The only question is which cipher — and how strong it is. Photo: Pexels

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.

An opened hard drive exposing the magnetic platter and read/write head assembly
Data on a disk is just bytes. Encryption decides whether an outsider can read them. Photo: Pexels

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.

ZipCrypto
Weak, crackable
AES-256
Strong standard
In 7z / RAR
Always AES-256
In ZIP
Choose manually
Name encryption
7z and RAR — yes
What decides
Cipher type + password

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:

1

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.

2

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".

3

Turn on name encryption (7z/RAR)

If hiding the file list matters, tick the corresponding box in the password dialog.

4

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.

A strong cipher plus a weak password is still weak protection. Safety comes only from combining AES-256 with a good password.

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 converters

The 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.

It depends on the type of encryption, not the length of the password. If the archive is encrypted with AES-256 (available in 7z, RAR and in ZIP when you pick AES), cracking it by brute force is practically impossible with a good password. If old ZipCrypto is used, protection is weak: it is bypassed by a known attack in hours. So 'safe' means AES-256 only.
ZipCrypto is an outdated stream cipher from the 90s with a built-in weakness. There is a known-plaintext attack: if an attacker knows or can guess even a small piece of one original file (and by file type and size that is often feasible), the password is recovered with free software in about a couple of hours on an ordinary PC. AES-256 is immune to this attack.
With 7z and RAR, yes: they encrypt both the contents and the file list, so an outsider cannot even see the names. With ZIP the file names always stay visible, even with AES-256: only the contents are encrypted. If the very presence of certain files is a secret, choose 7z or RAR with file-name encryption.
There is no official way: the password is stored nowhere; the encryption key is derived from it. For AES-256 with a strong password, recovery is effectively impossible — which is why you should save the password in a password manager. Brute-force tools exist, but they are useless against a strong AES password.
Long and unpredictable. Even strong AES-256 won't help if the password is '12345' or 'qwerty': those are cracked instantly from a dictionary. Use 12–16 or more characters, ideally a random phrase or a string from a password manager, and never send the password through the same channel as the archive itself.