Skip to content

How-ToOS

How to Password-Protect a ZIP File with 7-Zip in Windows 11

Windows 11 can't create password-protected archives, but free 7-Zip can. How to encrypt a 7z or ZIP file with AES-256, hide file names, avoid weak ZipCrypto, test the archive and do the same from the command line.

By , Systems & Technical Editor

4 min read

How to Password-Protect a ZIP File with 7-Zip in Windows 11

Windows 11 can open and create ZIP files on its own, but it can't put a password on them. Microsoft's own support page says Windows 11 version 24H2 "does not support operations on encrypted archive files". It suggests non-Microsoft apps such as 7-Zip or WinRAR instead. 7-Zip is free, including for business use, and offers AES-256 encryption in both its own 7z format and ZIP. This guide shows how to use it. The menu names and options below are taken from 7-Zip's official documentation, change log and published source code, checked on 27 November 2026.

Before you start: install the current version

Download 7-Zip from the official site, 7-zip.org. The current version is 7-Zip 26.06, released on 6 November 2026. If you already have 7-Zip, update it: several 2026 releases fixed security vulnerabilities. Our 7-Zip 26.06 news story explains what changed.

Step 1: Open the Add to Archive window

  1. In File Explorer, select the files or folder you want to protect.

  2. Right-click and choose 7-Zip > Add to archive...

  3. The Add to Archive window opens. In the Archive box, change the file name if you want to.

Step 2: Choose 7z or ZIP

Use the Archive format drop-down. This is the most important choice, because it changes how much the password protects:

  • 7z offers one encryption method, AES-256, and adds an Encrypt file names option. The 7-Zip website says that for 7z it creates the 256-bit key from your password with a SHA-256-based key derivation function. It runs a large number of iterations to make password-guessing attacks more expensive.

  • ZIP offers two methods in the Encryption method drop-down: ZipCrypto and AES-256. The Encrypt file names box isn't shown for ZIP, so anyone can still see the names of the files inside, even without the password.

Our advice: use 7z whenever the person opening the file has 7-Zip or another app that supports 7z. Use ZIP only when you need it to open in a wider range of tools.

Step 3: Pick the encryption method (ZIP only)

If you chose ZIP, set Encryption method to AES-256. 7-Zip may pre-select ZipCrypto. ZipCrypto is the original ZIP encryption system, and the Wikipedia article on the ZIP format describes it as "known to be seriously flawed" and vulnerable to known-plaintext attacks. That article also notes that ZIP support built into some operating systems can open ZipCrypto archives but not other encryption methods. That's the only real reason to pick ZipCrypto. And remember that Microsoft says Windows 11 24H2's built-in archive support doesn't handle encrypted archives anyway.

Step 4: Set a password and encrypt file names

  1. Type your password in Enter password and again in Reenter password. Tick Show Password if you want to check what you've typed.

  2. Use only English letters, numbers and standard symbols. 7-Zip shows the warning "Use only English letters, numbers and special characters (!, #, $, ...) for password." if you use other characters, so stick to that advice.

  3. For a 7z archive, tick Encrypt file names. Without it, the file names inside the archive stay visible.

  4. Click OK.

The encryption is only as strong as the password. Our tip: use a long, random passphrase. Store it in a password manager (see our best free password managers), and send it to the recipient through a different channel from the archive itself.

Step 5: Check the archive

Right-click the new archive and choose 7-Zip > Test archive, entering your password when asked. Then open the archive in 7-Zip without the password to see what someone else would see. With Encrypt file names on in a 7z archive, you shouldn't be able to see the file list.

Delete or securely store the original files once you've confirmed the archive opens with your password. If you forget the password, 7-Zip can't recover it for you.

Doing it from the command line

7-Zip's command-line version, 7z.exe, uses the a command to add files, -t to set the archive type, -p to set the password and -m to set method options. Two common examples:

7z a -t7z -p -mhe=on secret.7z "C:\Users\You\Documents\Tax"

7z a -tzip -p -mem=AES256 secret.zip "C:\Users\You\Documents\Tax"

Typing -p with nothing after it makes 7-Zip ask for the password (that's how the console code handles an empty -p switch), so the password doesn't end up in your command history. 7-Zip's change log notes that the console version doesn't show the password as you enter it. In the first example, -mhe=on turns on header encryption for 7z, which is the setting the Encrypt file names box controls in the Add to Archive window. In the second, -mem=AES256 chooses AES-256 instead of ZipCrypto for ZIP. Both property names come from 7-Zip's archive handler source code.

When an encrypted archive is the wrong tool

A password-protected archive is good for sending a few files or storing a one-off copy. It isn't a good fit for files you open and edit every day. For those, an encrypted container or whole-drive encryption is more practical. See our guide on how to create an encrypted container with VeraCrypt, or compare BitLocker vs Device Encryption.

Also note Microsoft's warning about Windows' own zipped folders: "If you add encrypted files to a zipped folder, they'll be unencrypted when they're unzipped". The same applies in general to any archive. Once someone extracts the files, the copies on their PC aren't protected.

Our verdict

To password-protect files in Windows 11, use 7-Zip and choose the 7z format with AES-256 and Encrypt file names ticked. If the recipient needs a ZIP, switch the encryption method to AES-256 rather than ZipCrypto, and accept that file names will be visible. Use a strong passphrase, test the archive before deleting the originals, and keep 7-Zip up to date.

The bottom line

To password-protect files in Windows 11, use 7-Zip and choose the 7z format with AES-256 and Encrypt file names ticked. If the recipient needs a ZIP, switch the encryption method to AES-256 rather than ZipCrypto, and accept that file names will be visible. Use a strong passphrase, test the archive before deleting the originals, and keep 7-Zip up to date.

Sources

  1. 01Microsoft Support: Zip and unzip files in Windows
  2. 027-Zip: official homepage and feature list
  3. 037-Zip: 7z format and AES-256 encryption
  4. 047-Zip: official change log (history.txt)
  5. 057-Zip source code: Add to Archive dialog resources (CompressDialog.rc)
  6. 067-Zip source code: Add to Archive dialog logic (CompressDialog.cpp)
  7. 077-Zip source code: Explorer context menu strings (resource2.rc)
  8. 087-Zip source code: command-line help (Console/Main.cpp)
  9. 097-Zip source code: 7z handler options including he (7zHandlerOut.cpp)
  10. 107-Zip source code: ZIP handler options including em (ZipHandlerOut.cpp)
  11. 11Wikipedia: ZIP (file format), encryption

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

Best Free Encryption Software for Windows in 2026

Best Picks

Best Free Encryption Software for Windows in 2026

The best free encryption software for Windows in 2026: Device Encryption for Windows 11 Home, BitLocker and BitLocker To Go for Pro, VeraCrypt for containers and cross-platform drives, Cryptomator for cloud folders and 7-Zip for sending encrypted files.

Hannah Vance7 min

7-Zip 26.06 Is Out: Why You Should Update Your Archiver Now

News

7-Zip 26.06 Is Out: Why You Should Update Your Archiver Now

7-Zip 26.06 adds better support for Linux split files and more bug and vulnerability fixes, capping a 2026 run of releases that patched CVEs including an XZ remote code execution flaw and a Mark-of-the-Web flaw. Here's what changed and how to update.

Eleanor Shaw4 min

Thinking vs Instruct Models for Local AI: Which Should You Run?

Versus

Thinking vs Instruct Models for Local AI: Which Should You Run?

Thinking models write out their reasoning before answering, while instruct models reply straight away. We explain the trade-offs for local AI on your PC, from waiting time and context use to switchable models such as Qwen3 and gpt-oss, using Ollama's documentation.

Callum Reid4 min

Best Local Reasoning Models in 2026

Best Picks

Best Local Reasoning Models in 2026

Reasoning (thinking) models work through problems step by step before answering, which helps with maths, logic and debugging. We pick the best ones to run locally through Ollama, from Qwen3 4B and DeepSeek-R1 to gpt-oss, Qwen3.8 and Inkling 2 Mini, grouped by GPU memory.

Hannah Vance6 min