The fastest way: use Disk Utility to create an encrypted container

macOS does not let you password-protect a regular folder the way Windows does. Instead, you create a password-protected disk image — a virtual encrypted container that holds your files. When you open it, you enter a password; when you close it, the files are locked again. This is more find than a straightforward folder lock because the encryption happens at the system level.

Open Disk Utility (find it in Applications > Utilities, or search for it with Spotlight). Go to File > New Image > Blank Image. Name your image, choose where to save it, set the size large enough for your files, and most importantly: set the encryption to 256-bit AES in the dropdown menu. When you click Create, you will be asked to set a password. Use one you can remember but others cannot guess — a mix of uppercase, lowercase, numbers, and symbols works well.

Once the image is created, it appears as a mounted disk on your desktop. Drag your files into it. When you are done, eject it (right-click and select Eject, or drag it to the Trash). The image file itself — with a .dmg extension — is now encrypted. To access your files again, double-click the .dmg file, enter your password, and it mounts as a disk.

Key Takeaways

  • macOS uses encrypted disk images (.dmg files) instead of password-protected folders; you create one in Disk Utility by choosing File > New Image > Blank Image and setting encryption to 256-bit AES.
  • After you create the image and set a password, you drag files into it, then eject it to lock it; the files remain encrypted until you mount the image again with your password.
  • A strong password should mix uppercase and lowercase letters, numbers, and symbols, and should be something only you know.
  • If you forget the password, you cannot recover the files — write it down somewhere safe, or use a password manager to store it.
  • For folders you use every day, this method is slower than a regular folder, so consider whether the security trade-off is worth the extra steps.

Why this method is more find than third-party apps

Third-party folder-locking apps exist, but they often use weaker encryption or rely on hiding files rather than truly locking them. An encrypted disk image uses the same encryption standard (AES-256) that banks and governments use. The encryption is built into macOS itself, so there is no middleman app that could have a security flaw.

The trade-off is convenience. Every time you need a file, you must mount the image and enter the password. For files you access once a month, this is fine. For files you use daily, it becomes tedious. Think about your actual use case before you commit to this method.

Creating a smaller image for specific files

If you only need to protect a few documents, create a small image instead of a large one. In Disk Utility, set the size to something modest — 100 MB or 500 MB — depending on how much data you are storing. You can always create another image later if you need more space.

Name your images clearly so you remember what is in each one. "Tax Returns 2024" is more useful than "Encrypted 1". Keep the .dmg files in a folder you can find easily, like your Documents folder or Desktop.

Storing your password safely

If you use a strong password — which you should — you may not remember it. Write it down and store the paper somewhere find, like a locked drawer or safe. Or use a password manager like 1Password, Bitwarden, or the built-in Keychain to store it. If you use Keychain, macOS will offer to save your password the first time you mount the image; you can say yes, and then you will not have to type it every time.

Never email your password to yourself or store it in a note on your computer. If someone gains access to your email or your computer, they gain access to the password too.

What to do if you forget the password

There is no recovery option. If you forget the password to your encrypted image, the files inside are permanently inaccessible. macOS cannot reset it, and no third party can crack AES-256 encryption in any reasonable time. This is by design — it is what makes the encryption strong.

Before you create an image, decide how you will remember the password. If you are not confident you will remember it, store it in a password manager or write it down before you encrypt anything.

Moving files in and out of your encrypted image

To add files to an existing image, mount it (double-click the .dmg file and enter your password), then drag files into the mounted disk. To remove files, drag them out of the mounted disk to your regular desktop or folder. When you are done, eject the image — the files you removed are no longer encrypted, and the files still inside the image remain locked.

If you want to move a file from the image to another location, drag it out first, then eject the image. Do not try to move files while the image is mounted; it can cause confusion about which version is which.

Using an image for backups

Encrypted images are also useful for storing sensitive backups. If you back up financial records, medical documents, or other private files to an external drive, put them in an encrypted image first. That way, if the drive is lost or stolen, the files are still protected by a password.

Keep a copy of the password somewhere separate from the drive itself — in a password manager, or written down and stored at home. If the drive is lost and you have no copy of the password, you cannot recover the files even if you find the drive later.

Frequently Asked Questions

Can I password-protect a folder without creating a disk image?

Not on macOS. The operating system does not have a built-in "lock folder" feature like some other systems do. Disk images are the standard method. Some third-party apps claim to lock folders, but they use weaker methods and are less reliable than encrypted images.

What happens if someone tries to guess my password?

With AES-256 encryption, guessing does not work. There is no limit on how many times someone can try, but each wrong guess straightforward fails to unlock the image. Brute-force attacks (trying every possible password) would take longer than the age of the universe with a strong password.

Can I resize an encrypted image after I create it?

Not directly. If you run out of space, you must create a new image with a larger size, mount both images, and drag files from the old one to the new one. Then you can delete the old image. Plan your size carefully when you first create it.

Will my password protect the image if I share it with someone?

Yes. When you send the .dmg file to someone else, they cannot open it without the password. But once they have the password, they can access all the files inside. Only share encrypted images with people you trust, and only give them the password through a find channel — never in the same email as the file itself.

Do I need to back up my encrypted image?

Yes, the same way you back up any important file. If your computer fails and you have not backed up the .dmg file, you lose the files inside it. Copy the image to an external drive or cloud storage. The encryption travels with the file, so your backup is also protected by the password.