I recently discovered how to make an encrypted password protected folder on macOS, I thought that this might not be a well known feature and that it would be useful to share with the DEV community.
This is a feature build-in to macOS already so no third-party tools are needed. Apple first introduced this feature in macOS Mountain Lion.
So if you want to hide your "top secret files" or your cat pics from your colleagues/family read ahead because it is super easy.
Making an encrypted folder
- You will need to use Disk Utility, so open that with Spotlight or you can find it in your Applications folder.
- In the "File" menu go to "New Image" and choose "Image from Folder...".
- Your Finder will open, here you navigate into the "top secret files" folder that you want to encrypt, press "Choose" at the bottom of the Finder.
- In following screen you can change encrypted folder name (Save As) and location (Where).
- Next we want to change "Encryption" to "128-bit AES encryption (recommended)", this will open a new window where you can set the password that you want for your encrypted folder.
- I would also suggest to set "Image Format" to "read/write", this will enable you to add new files to the encrypted folder after that it has been made (a working directory).
- If everything went well you should see this screen.
This will give you a .dmg
file that can be moved or shared between devices, just don't forget the password.
Opening the encrypted folder
Opening the encrypted folder is even easier than making it!
- Go to the location where you saved the encrypted folder.
- Double click the
.dmg
file and it will request you to enter the password you created earlier. - After that it will add the encrypted folder as a mounted disk in your Finder under "Locations".
- You can now view, edit, move, add or delete any of the files.
- When you are done working in your encrypted folder and don't want other people to be able to access it just press the "eject" button behind the mounted disk.
The .dmg
will work as a mounted disk image, so any changes that you do on there will stay in the encrypted folder without needing to make a new one.
Top comments (1)
That is interesting indeed.
To have it on all my devices (Linux, MacOS and Windows), I am using Cryptomator.
Basically, it creates a folder image that is encrypted just as you described.
You should give it a try. 😉