Home > How to Tips

How to Password Protect & Encrypt Any Files on Mac?

Updated on Thursday, March 9, 2023

iBoysoft author Vain Rowe

Written by

Vain Rowe
Professional tech editor

Approved by

Jessica Shee

Simple Ways to Password Protect Files & Folders on Mac

Summary: To secure your sensitive data, you should know how to password protect a file on a mac and how to encrypt files on Mac. In this article, free methods and third-party software are available for you to ensure data security.

password protect a file on mac

 Table of Contents:

If you are using a Mac as a workstation, you will inevitably store confidential documents on your Mac. To prove them from unauthorized visiting, knowing how to password protect a file on Mac is a must for you.

In this article, you will find easy and effective ways to lock your secret files with a password or an encryption method on Mac. Keep reading.

Why not share this article with others on your social platform?


How to password protect files on Mac

Files stored on your Mac contain different formats including folders, images, audio, and videos. Are you wondering if the ways to create a password to protect different types of files are different too? In fact, you can password protect any files on Mac by creating a password-protected dmg file.

How to password protect files by creating a dmg folder on Mac 

DMG is a compressed copy of the contents of a disk or folder and you can use it to store your sensitive and confidential files and documents. Mac allows you to set up a password to protect a dmg file, avoiding your private information from being stolen.

How to password protect a dmg file on Mac:

  1. Create a new folder and move all items into it for protection.
  2. Open Disk Utility on your Mac.
  3. Head over to the menu bar and click on File.
  4. Select New Image > Image from Folder.password protect a file with Disk utility
  5. Select the folder you created and wanted to add a password to and click the Choose button.
  6. Choose the 128-bit AES encryption (recommended) option in Encryption section.password protect a dmg file on Mac
  7. Enter your password and re-enter it again to verify, and then click Choose button.enter and re enter password to protect a file on Mac
  8. Select the read/write option for later re-editing in the Image Format menu.
  9. Click Save to confirm your action.

Don't forget your password. Otherwise, you cannot access the information and files in the locked DMG folder anymore once the password is incorrect.

How to zip a file and password protect it on Mac

Another way to compress your files is to zip them. Mac also allows users to protect a zipped file with a password.

How to zip a file:

  1. Create a new folder and put all the files you want to zip in it.
  2. Right-click the folder you want to zip.
  3. Click Compress “folder name” in the context menu. The zipped file will have the same name as your folder, but with a “.zip” file extension. You will find your zip file in the same location as your original folder.

The process to password protects a zip file on Mac has no different from how to password protect other files and folders mentioned above. You will need to create a dmg file with Disk Utility and set up a password for it.

  1. Open Disk Utility.
  2. Click File in the top menu bar and select New Image > Image from Folder.
  3. Select the zip file and follow the wizard to password protect the zip file. Remember to choose 128-bit AES encryption (recommended) as an encryption method.

After locking the zip file, you need to enter the password when you want to unzip the zip file on Mac

RAR files cannot be opened or created due to copyright issues, but you can convert RAR to ZIP on Mac and then password protect it.

How to Password Protect PDF Files on Mac

After knowing how to password protect and encrypt multiple files, you may want to know how to create a password for a single file on macOS. Here we use a PDF as an example to show you how to password protect PDF files on Mac.

Follow the steps to prevent your PDF files from unwanted access:

  1. Open the PDF file you want to secure and click File in the top taskbar of the screen.
  2. Choose Edit Permissions in the drop-down menu bar.password protect a PDF file on Mac
  3. Choose Require Password To Open Document. No one can open the file unless he has the correct password.
  4. Enter Password and re-enter it again to verify it.
  5. Enter the password and re-enter it in Owner Password. It is essential when you want to change the Permissions of the PDF file and the Owner Password can be different from the password used to open the document.enter password to protect a PDF file on Mac
  6. Click Apply to apply a password to the PDF file.

Think this article useful? Then try it to protect and secure your Mac right now!


How to password protect a folder with Terminal

Advanced Mac users prefer to protect their documents without Disk Utility. Using Terminal, a free terminal emulator built into macOS can definitely help these Mac users complete the task.

How to password protect a folder using Terminal:

Step 1: Right-click on the folder you want to protect and select Get info.

Step 2: Find the Where section and copy the folder's path.

Step 3: Launch the Terminal app on your Mac through Launchpad > Other.

Step 4: Enter the cd and add a space.

password protect a file with Terminal

Step 5: Paste the path to the Terminal window.

use Terminal to protect a file on Mac with password

Step 6: Type the following command and hit Return.

zip -er FolderProtected.zip “set”

 Note: the FolderProtected.zip is the name you give to the zip file. “set” is the folder name you want to protect.

enter command line to password protect a file by Terminal

Step 7: You will be asked to enter your admin passwords twice and you won't see anything while you are entering the password.

enter password to protect a file on Mac with Terminal

Step Eight: Hit Enter key to confirm and wait. Your folder is compressed and protected with a password. If you want to open the folder, the password is a must.

password protect a file on Mac without Disk Utility

 Note: iBoysoft DiskGeeker has a useful feature called USB Defender, which can lock your Mac USB port with a password, and stop the macOS from detecting and mounting USB drives of unknown sources. After enabling USB Defender, all the connected USB drives will be unmounted on your Mac. You need to enter the password for USB Defender to mount them manually. This way, you will not worry about someone stealing your confidential data from your Mac with an unauthorized USB.


How to Encrypt files on your Mac

Password protection means only authorized users can access the information with a correct number or character combination. Data encryption is a level-up for data security because it converts your information to cipher text.

iBoysoft DiskGeeker is an ideal tool that encrypts your data on an internal or external disk with FileVault or BitLocker. It turns your sensitive data into unreadable ciphers and asks for a password to decrypt data. It can protect your graphics, movies, music, Time Machine backups, and so on to maximize your data privacy and security.

How to Encrypt files on Mac with iBoysoft DiskGeeker?

  1. Select a partition or entire disk that you want to encrypt from the left panel.
  2. Click the “Encrypt” button from the right-side toolbar.
  3. Click “Continue” to proceed. The software will recognize your file system and decide either FileVault or BitLocker will be applied to your disk.encrypt files through FileVault
  4. Enter your password and re-enter it again. For first-time encryption, both FileVault and BitLocker will generate a recovery key in case you forget your password. Keep the recovery key in a safe place.
  5. Click “Next”.
  6. Click “Start encrypting”. The encryption cannot be terminated by a user.click Start encrypting to encrypt files on Mac


This article provides you with comprehensive methods on how to password protect any files on Mac. You can either utilize free and native features provided by macOS or use a third-party tool like iBoysoft DiskGeeker.  

Share this article with others right now!




1. Open Disk Utility on your Mac.
2. Click the File on the top taskbar of
3. Select New Image > Image from Folder.
4. Locate the ZIP folder you want to lock and click the Choose button.
5. You can rename the folder from the window or keep it origin.
6. In Encryption section, choose 128-bit AES encryption (recommended) option.
7. Enter your password, re-enter it to verify, and click the Choose button.
8. From image format, select read-only option.
9. Click Save to confirm your action.


Yes, you can password protect a folder on Mac with Terminal. You can follow the steps:

1. Find the folder that you want to lock Right-click it and select the Get Info option.
2. Under General, select Where and copy the Path.
3. Launch Terminal on your Mac.
4. Enter cd and add a space, paste the Path, and hit Enter.
5. Allow Terminal to access your Folder document.
6. Type zip -er FolderProtected.zip “set” in Terminal.
7. Enter and re-enter the password, then hit Enter to confirm your actions.