Security

How to password-protect a folder on Mac to lock it from prying eyes

Dawna Roberts

Jan 19, 20245 min read

How to password-protect a folder on Mac to lock it from prying eyes: Header image

Everyone has the right to privacy. With so much of our personal lives on display for public consumption, it makes sense to want to button up certain aspects of your digital life to keep them safe. 

Regardless of why you want to keep information private on your Mac, you can do so easily by password-protecting a folder, among other methods. Keep reading to learn how to password-protect a folder on a Mac.

How can I password-protect a folder on macOS?

If you live in a house with other people, password-protecting your files and folders becomes a necessity. Learning how to put a password on a folder can keep your personal data safe from prying eyes and help protect you from identity theft.

Data breaches occur every day. By password-securing a folder, you could also protect your data against hackers. The following are a few ways you can password-protect a folder.

How to add a password to a folder using Disk Utility

While securing individual files makes sense, it’s also a good idea to secure an entire folder. That way, you can quickly move files in and out of it whenever you like without any tricky maneuvers. 

The first way to protect a folder on a Mac is by using the built-in Disk Utility tool. The tool creates an archive file (.dmg) using AES encryption, which requires a password to open. 

A screenshot of Mac Disk Utility to set a password on a folder.
Disk Utility is a trademark of Apple Inc.

How to apply a password to a folder using Disk Utility:

  1. On a Mac, open Applications.
  2. Choose Utilities, Disk Utility.
  3. Choose File, New Image, and Image from Folder from the top menu.
  4. Select the folder you want to password-protect.
  5. Click Choose.
  6. Choose the location.
  7. Give the folder a name.
  8. Use the Encryption drop-down menu to choose your encryption level (128-AES or 256-AES).
  9. Enter a password.
  10. Verify the password (your Mac can create a password for you).
  11. Click Choose.
  12. Select the Image Format drop-down and select “read/write.”
  13. Click Save.
A screenshot of how to password-protect a folder using Disk Utility.
Disk Utility is a trademark of Apple Inc.

Disk Utility will encrypt your folder. Wait until it is done before closing the app. Click Done, and then you can close it.

Because macOS creates a new encrypted folder, you can delete the old one. To open your new folder, simply double-click it and enter the password you created. 

How to secure a folder with a password using Encrypto

Encrypto is a free MacPaw app with increased versatility and more features than the built-in Disk Utility. You can download it for free on the App Store.

One of Encrypto’s best features is sending or sharing password-protected files with anyone with 256-AES encryption. You can also hide encrypted files so no one can see or delete them. You cannot do this with Disk Utility. Encrypto even works seamlessly between Mac and Windows machines. 

This powerful program is easy to use, simply:

  1. Download and install Encrypto from the App Store.
  2. Open the app.
  3. Drop the files you want to password-protect in the yellow bar.
  4. Encrypto gets to work encrypting your files.
  5. Set a password.
  6. Set a password hint. 
  7. Click Encrypt.
  8. Wait for it to finish.

Once Encrypto is done working, you can share or send the file using built-in macOS tools like messages, email, AirDrop, etc. 

A screenshot showing how to use Encypto to password-protect a folder on Mac.

How to password-lock a folder with a Terminal command

Another way to password-lock a folder on a Mac is using Terminal commands. Terminal is like the old DOS operating system, and commands quickly get to the heart of the matter without any visual distractions. That said, you always want to be careful before using Terminal commands.

The following process turns your folder into an encrypted ZIP archive file. This method works well if you intend to share or send the password-protected file via email:

  1. On a Mac, go to Applications > Utilities > Terminal.
  2. Open Finder and locate the folder. CTRL-click and choose Get Info.
  3. Copy the Where location to your clipboard (CMD+C).
  4. Back in Terminal, type cd and a space.
  5. Paste (CMD+V) the path you copied above, and click Return.
  6. This will select that location. 
  7. Type ls and click Return.
  8. Confirm access to that location when the Terminal asks for it.
  9. Type zip -er PasswordProtectedFiles.zip “Secret”
  10. Above “PasswordProtectedFiles” is the name you want to give your new file. Change it to whatever you like. Just ensure that it includes the .zip at the end.
  11. Where we have “Secret,” change it to the name of the folder that you want to password-protect. (Ours is called Secret.) 
  12. Click Return.
  13. Enter the password you want to use.
  14. Verify the password.

You will now see an archive folder (ZIP) in the exact location of the original file. Double-click it, and a pop-up box will ask you to enter the password. The file is now safe to send. 

A screenshot showing how to use Terminal to password-protect a folder.
Terminal is a trademark of Apple Inc.

Things to keep in mind when you lock a folder with a password

As good as password-protecting your files sounds, password-protecting comes with limitations and some dangers. Here are some things to consider before locking up all your data. 

Don’t lose your password

Once you password-protect your folder, the password cannot be retrieved. If you lose it or forget it, you may lose access to those files forever. Be sure to keep your password in a safe location (preferably a password vault). Always back up your files before password-protecting and store them offline on a disk that can be locked in a safe. 

Consider the risk of deletion

If you use Disk Utility, anyone with access to your computer could find and delete your protected files. They are not hidden from view. If you use third-party tools like Encrypto, you could hide them from others so they don’t even know they are on your Mac. 

Files are protected at the folder level

When you encrypt a folder, each file inside is protected, but the individual files do not have passwords. This means if anyone gets into that folder, all the files within it are vulnerable. However, you can still use built-in password features within each program (Pages, Word, Excel, Notes, etc.) and set a password to protect them. 

A screenshot showing how to set a password within a Mac application.

Now that you have learned how to apply a password to a folder, you have one more tool in your cybersecurity toolbelt to keep you and your private information safe and secure. 

This is an independent publication, and it has not been authorized, sponsored, or otherwise approved by Apple Inc. Mac and Disk Utility are trademarks of Apple Inc.

Dawna Roberts Dawna Roberts
Dawna has spent her entire career in web dev, cybersecurity, and IT. Her work has been featured on Forbes, Adobe, Airtable, Backblaze, Cyberleaf, Lifewire, and other online publications for the past ten years.