Written byVain Rowe
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.
Table of Contents:
- 1. How to password protect files on Mac
- 2. How to password protect a folder with Terminal
- 3. How to Encrypt files on your Mac
- 4. FAQ
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.
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:
- Create a new folder and move all items into it for protection.
- Open Disk Utility on your Mac.
- Head over to the menu bar and click on File.
- Select New Image > Image from Folder.
- Select the folder you created and wanted to add a password to and click the Choose button.
- Choose the 128-bit AES encryption (recommended) option in Encryption section.
- Enter your password and re-enter it again to verify, and then click Choose button.
- Select the read/write option for later re-editing in the Image Format menu.
- 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:
- Create a new folder and put all the files you want to zip in it.
- Right-click the folder you want to zip.
- 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 difference 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.
- Open Disk Utility.
- Click File in the top menu bar and select New Image > Image from Folder.
- 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.
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:
- Open the PDF file you want to secure and click File in the top taskbar of the screen.
- Choose Edit Permissions in the drop-down menu bar.
- Choose Require Password To Open Document. No one can open the file unless he has the correct password.
- Enter Password and re-enter it again to verify it.
- 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.
- Click the Apply to apply a password to the PDF file.
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.
Step 5: Paste the path to the Terminal window.
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.
Step 7: You will be asked to enter your admin passwords twice and you won't see anything while you are entering the password.
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.
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?
- Select a partition or entire disk that you want to encrypt from the left panel.
- Click the “Encrypt” button from the right-side toolbar.
- Click “Continue” to proceed. The software will recognize your file system and decide either FileVault or BitLocker will be applied to your disk.
- Enter your password and re-enter it again. For the 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.
- Click “Next”.
- Click “Start encrypting”. The encryption cannot be terminated by a user.
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.
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.