Encrypted Disk Image on Mac: Formats, Passwords and Everyday Use
An encrypted disk image is a file that opens as a drive once you enter its password. In Disk Utility, choose File > New Image, pick an image format and an encryption option. Use a sparse bundle for a vault that keeps growing and a read-only format for finished files. Apple says a forgotten password locks you out.
Steps use macOS 14 and later names. Menu wording can differ slightly between versions.
The basic steps for wrapping a folder are in how to password protect a folder on Mac and how to encrypt a folder on Mac. This guide covers the choices those pages skip.
Pick the image format
| Format | Apple's description | Use it when |
|---|---|---|
| Sparse Bundle Image (UDSB) | A read/write image that grows with the data stored in it. The data is stored in multiple files. | You keep adding files over time |
| Apple Sparse Image (ASIF) | A modern sparse read/write image. It uses disk space in proportion to the data it contains. | You want read/write and your macOS version offers it |
| RAW Image | Lets you add, remove or edit files after creation. | You need a plain read/write image |
| Read-only image (UDRO) | Cannot be changed after creation. Fast to create and quick to open. | You are archiving finished files |
| Read-only Compressed (ULFO) | A read-only image that stores data in a compressed format. | You are archiving finished files |
Create an encrypted image
-
Open Disk Utility
Press ⌘Space, type Disk Utility and press Return.
-
Choose the kind of image
Choose File > New Image > Blank Image for a vault you will fill over time. Choose Image from Folder to wrap a folder that already exists.
-
Name it and place it
Enter a file name, optional tags and a save location. For a blank image, also enter the Name that appears on the desktop and in the Finder sidebar once the image is mounted, and a Size.
-
Choose the formats
For a Mac with an SSD running macOS 10.13 or later, Apple says to choose APFS or APFS (Case-sensitive) as the Format. Then choose an Image Format from the table above.
-
Choose the encryption
Pick an option in the Encryption pop-up menu and enter the password twice. Apple warns: "If you forget this password, you won't be able to open the disk image and view any of the files."
-
Save, fill and eject
Click Save, then Done. Open the mounted image in Finder, copy your files in, then eject it.
-
Test it
Double-click the image file. Enter the password. Check that your files are there. Eject it again.
Apple's page does not list the individual encryption choices. The Terminal manual for hdiutil (run man hdiutil) lists AES-128 and AES-256 and says what the default is, so choose the option on purpose and write down which one you picked.
Convert, resize and change the password
Convert an image to make it read-only, switch formats or change its encryption. Open Disk Utility, choose Images > Convert, select the image and click Choose. Pick an Image Format. To change the encryption, use the Encryption pop-up menu. Enter a new name in Save As and click Save. Apple's example: if you made a read/write image but want to stop changes, convert it to a read-only format. Delete the old file only after you have tested the new one.
To resize, first eject the image. Apple says to choose Images > Resize, pick the image file, enter the new size and click Resize. Apple adds that not all image formats support writing and resizing.
The Apple Disk Utility pages used for this guide do not describe a menu item for changing an image's password. The hdiutil manual lists a chpass command for it, which prompts for the passwords:
hdiutil chpass ~/Documents/Vault.sparsebundle Open it, eject it, and the keychain question
- Opening. Double-click the image and enter the password. It appears as a drive.
- Ejecting is the lock. While the image is mounted, anyone at your Mac can read it. Eject it when you finish, and lock the screen when you leave.
- Remembering the password. If the password box offers to remember it in your keychain, leave that off when you want the image to ask each time.
Limits
- Image from Device has limits. Apple says you cannot create images of individual APFS volumes, or of APFS containers on Macs with Apple silicon or a T2 chip. Use Blank Image or Image from Folder.
- No recovery. A forgotten password means the data is gone.
- The file is visible. A file called
Private.dmgtells anyone that something is stored there. - Old backups. A plain copy made before you encrypted may sit in an old backup. See how to encrypt a Time Machine backup.
- Syncing. Putting an image in a cloud folder is a choice with trade-offs. See how to encrypt files before cloud sync.
- No Disk Utility? See password protect a folder on Mac without Disk Utility.
Frequently asked questions
What is the difference between a sparse bundle and a normal image?
Apple describes a sparse bundle as a read/write image that grows with the data stored in it, with the data stored in multiple files.
Can I change the password of an encrypted disk image?
The Apple Disk Utility pages used for this guide do not describe a menu item for it. The Terminal command hdiutil chpass is listed in the manual for hdiutil.
Can I recover a forgotten disk image password?
No. Apple says that if you forget the password, you will not be able to open the disk image and view any of the files.
Do I have to eject the image?
Yes, to lock it again. A mounted image is open to anyone using your Mac. Apple also says to eject an image before you resize it.
Will an encrypted image open on another Mac?
Apple's pages do not say. APFS needs macOS 10.13 or later, so test on the other Mac before you rely on it.
Can I make an image read-only after I fill it?
Yes. Use Images > Convert and choose a read-only format. Apple gives this as its example.
References
Your files. Your Mac. Locked.
Coming soon. Join the waitlist and we email the link.
Get early access