How to Zip a Folder with a Password on a Mac

The Payload Encryption Vector

While macOS allows you to easily compress files by right-clicking and selecting “Compress,” the resulting `.zip` file is completely unsecured. Anyone who downloads or intercepts that file can double-click it and instantly view your confidential financial documents or proprietary source code. If you are transmitting sensitive data over the internet or storing it on a shared cloud drive, you must wrap the archive in a cryptographic padlock.

How to Zip a Folder with a Password

Apple does not include a graphical interface for password-protecting `.zip` files. You must use the Terminal to invoke the core compression engine directly and force it to encrypt the payload.

1. Open the Terminal application (found in Applications > Utilities, or via Spotlight).
2. Before typing the command, use the cd command to navigate to the exact location of the folder you want to compress (e.g., type cd Desktop and press Enter).
3. Type the following command structure carefully:

zip -er ArchiveName.zip FolderName/

(Replace “ArchiveName” with what you want the final file to be called, and “FolderName” with the exact name of the folder you are targeting).

4. Press Enter.
5. The Terminal will prompt you to Enter password:. As you type, the cursor will not move, and no characters will appear on the screen. This is a security feature. Type your desired password carefully and press Enter.
6. It will prompt you to Verify password:. Type it again and press Enter.
7. The Terminal will instantly compress and encrypt the folder.

If anyone attempts to double-click the resulting `.zip` file, macOS will immediately throw a hard stop, presenting a rigid password prompt before it will even attempt to extract a single byte of data.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.