DEV Community

loading...
Cover image for macOS encrypted folder

macOS encrypted folder

glennmen profile image Glenn Carremans ・2 min read

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...". Disk Utility File menu
  • 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. Disk Utility File menu
  • In following screen you can change encrypted folder name (Save As) and location (Where). Disk Utility File menu
  • 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. Disk Utility File menu
  • 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). Disk Utility File menu
  • If everything went well you should see this screen. Disk Utility File menu

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. Disk Utility File menu
  • Double click the .dmg file and it will request you to enter the password you created earlier. Disk Utility File menu
  • After that it will add the encrypted folder as a mounted disk in your Finder under "Locations". Disk Utility File menu
  • You can now view, edit, move, add or delete any of the files. Disk Utility File menu
  • 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. Disk Utility File menu

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.

Discussion (1)

pic
Editor guide
Collapse
shostarsson profile image
Rémi Lavedrine

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. 😉