On Windows, you have Bitlocker. Cross-platform, you also have VeraCrypt (successor to TrueCrypt). But if you want to encrypt a folder on the fly in MacOS, then the quickest and easiest way is to use Disk Utility.

Disk Utility is a function built into the macOS operating system and can do things such as wiping and formatting macOS hard-drives and removable media such as USB sticks. But it can also take a folder on a macOS and encrypt it using the DMG format.

Table of Contents
    Photo of a hard drive with a padlock and chain around it

    The DMG Format

    If the DMG format sounds familiar to you then that’s probably because that is also the standard file format for macOS software installation files. DMG files are mountable disk images that compress the files inside them, much the same way a Zip file compresses Windows files in a folder.

    A dmg file of Skype app

    As well as compressing files, DMG can also encrypt them. Here’s how.

    Making An Encrypted Folder In Disk Utility

    Make a new folder on your computer and put all the files you want to encrypt into that folder.

    Folder called secret-files

    Now open Disk Utility which you will find by going to Applications–>Utilities.

    Disk Utility app in Utilities window

    Go to the menu at the top and choose File–>New Image–>Image From Folder.

    Image from Folder menu under File/New Images

    Now navigate to the location of your folder of secret files, which in my case is on the desktop. Highlight the folder and click “Choose”.

    Disk Utility window where you choose the file you'd like to encrypt

    In the box that pops up, confirm the following :

    Disk Utility popup window where you choose encryption level
    • The file name for the encrypted folder.
    • Where you want it saved.
    • The standard of encryption (128-bit is generally sufficient).
    • Set “Image Format” to “Read/Write”.

    When you set the encryption standard, a password box will pop up asking you to enter your desired password.

    Enter Password popup in disk utility

    If you already have a password you desire, type it in twice and click “Choose”. However, if you are not sure of your password, the little black key icon next to the “Verify” box is a Password Assistant. Click the key to open it.

    Letters & Numbers selected under Password menu

    Drop the menu down and choose what type of password you want. When you do, a password will auto-fill for you in the boxes provided.

    You can also specify how long the password will be and the Quality bar will update in real-time.

    Letters & Numbers Password suggestion window

    It’s worth pointing out that if you go for a random password option, you are going to need to copy and paste it somewhere to remember it. Or better still, use a password manager. The last thing you need is to be locked out of your own encrypted folder.

    When you have the password you want, close the Password Assistant and you will be back at this window.

    Save As popup in Disk Utility

    Click “Save” to begin the encryption process. How long it will take will depend on how large your encrypted folder is going to be.

    Creating folder disk image Disk Utility window

    When the DMG file has been created, the original unencrypted folder will still be there. It is not deleted by Disk Utility. So you may want to delete that folder, but as I said just now, make sure you have a copy of the password first. Otherwise, you will be permanently locked out.

    If you go to your newly created encrypted DMG file, and double-click on it, it will ask you for your password. Do NOT tick the Keychain option.

    Enter password prompt on encrypted folder