Home > How to Tips

How to Password Protect ZIP Files on Mac with/without Terminal

Updated on Tuesday, December 3, 2024

Written by

Connie Yang

Approved by

Jessica Shee

English Français Deutsch やまと Español Português

Summary: Our post will guide you to password protect ZIP files on a Mac without or with the Terminal. Among them, the simplest way is to use iBoysoft MagicMenu to zip and password protect  a file on Mac by a right-click.

Can you password protect a ZIP file on a Mac? When comes to password protecting ZIP files on Mac, a widely discussed solution on the Internet is to use the built-in Terminal utility. However, this way proved to be prone to failure as most of us are unfamiliar with running commands.

Don't worry though, in this post, we will walk you through how to password protect ZIP files on Mac in different ways.

How to password protect ZIP files on Mac without Terminal?

In this part, let's focus on the three ways to password protect ZIP files on Mac without the Terminal and start with the free one.

Way 1. Zip the file and password protect it with Disk Utility on Mac

The default compressing feature on Mac works fine, but it can't help us make a ZIP archive with password protection for security.

Let's look at this in another way. We can right-click to compress the folder, create a new folder and move the zipped folder to it, and then use the native tool - Disk Utility which contains the encryption function to password protect the ZIP file on Mac for free.

Step 1: Zip the folder on your Mac

  1. Right-click the target folder in Finder or on the desktop.
  2. Choose "Compress filename" from the context menu.

Step 2: Password protect the ZIP file on Mac with Disk Utility

  1. Move the zipped file to a newly created folder.
  2. Open Disk Utility from Launchpad > Other. Or,  press Command-Space to launch Spotlight and then enter "Disk Utility" to open it.
  3. Move your cursor to the top menu bar and select "File" > "New Image" > "Image from Folder." 
  4. Select the target folder containing the zipped file and click "Choose." 
  5. Rename the protected folder and select a destination for it. (Optional) 
  6. Expand the options in the Encryption field and choose an encryption way (128-bit AES encryption is enough).
  7. Keep the compressed option in the Image Format section, and click "Save." 
  8. Wait for Disk Utility to finish encrypting the folder.
  9. Click "Done" and quit Disk Utility.

Now, you can click the encrypted ZIP file on your Mac and enter the password to unlock it. You can also share this password-protected archive with anyone you'd like to.

Share this free method about password protecting zipped files on Mac.

 

Way 2. Use a professional compression tool

As you can see, it is tedious to zip a file and then password protect it using Mac Disk Utility. And this way only applies to folders. If you need to password protect ZIP files and folders on your Mac frequently, we highly suggest you switch to using a professional compression tool like iBoysoft MagicMenu.

This application allows you to set a password for the target file while compressing it. It also offers high, middle, and low compression levels.

Here's how to password protect a ZIP file on Mac with a compression tool:

  1. Download, install, and open iBoysoft MagicMenu on your Mac.
  2. Click "Extension," scroll down to find the Compress feature on the right panel, and then click the download button next to it to add this feature to your right-click menu.
  3. Right-click the file or folder you want to encrypt and choose "Compress." 
  4. Click "Set password" and enter a password for the ZIP file, choose a compression level (optional), and click "Compress." 
  5. Choose a location and click "Save."

Way 3. Password protect ZIP files online

Also, you can password protect ZIP files online. However, most of the online ZIP file encryption websites require you to upload a compressed file. In other words, you need to create a ZIP file on your Mac first.

It is worth noting that uploading your files to web pages puts them at risk of leakage and exposure.

Thus, choose an online ZIP file encryption website you trust or change to use a file compression application.

How to password protect ZIP files on Mac with Terminal?

If you would like to password protect ZIP files on a Mac with Terminal, follow these steps.

  1. Open Terminal.
  2. Enter the following command into the window to navigate to the location where your target file saves. Here, you need to replace "desktop" with the actual location of your target file. Then, press Return. cd desktop
  3. Enter the following command to start zipping and password protecting the file. You should replace "new" with the name of the zipped file and "original" with the name of the original one. zip -er new.zip original
  4. Press Return.
  5. Enter a password to encrypt the ZIP file, press Return, and re-type it for confirmation.
  6. Press Return and wait for the process to end.

Share the detailed way to password protect ZIP files with Terminal with more people.

 

Why can't you password protect ZIP files on a Mac with Terminal?

We have found that many users in forums claim they can't password protect ZIP files on a Mac with Terminal. The "zip error: Nothing to do!" message appears after entering a password for the ZIP file in the Terminal window.

The most possible reason why you see "zip error: Nothing to do!" is the incorrect command line. "zip -er new.zip original" (here, "new" stands for the name of the new file while "original" refers to the name of the original file) is the intact command for zipping a file and password protecting it on your Mac. Don't miss typing the original file's name.

Final words on password protect ZIP files on Mac

Although the built-in compressing feature can't help encrypt compressed files on Mac, multiple ways are available. You can use Terminal to zip a file and password protect it.

If you think it is complicated to password protect ZIP files on a Mac with Terminal, you can also use other ways. The free method is compressing the file and using Disk Utility to set a password for it, the quick way is using iBoysoft MagicMenu, and the online way is dragging and dropping the zipped file to the online zip encryption website.

You can feel free to explore them in our post and choose the one you prefer.

If our post helps you password protect ZIP files on your Mac successfully, hope you can share it.