An encrypted disk image holds a whole UDIF or raw image in encrypted blocks. A password the owner chose unlocks a key that decrypts them, and this page describes only what can be read without it. Apple has not published these headers. The fields here come from the source of libdmg-hfsplus, and the numbers are big-endian. No real encrypted image was available when this page was written, so the layouts were checked only against hand-built files.
Version 2: encrcdsa
A version 2 image starts with the eight bytes encrcdsa. The header is
followed by the encrypted data, at the offset the header gives.
0Signatureencrcdsa8 bytes8Fields version, IV size, algorithm numbers, UUID, block size, data size and offset64 bytes72Padding608 bytes680Key derivation algorithm, iterations and salt48 bytes728Wrapped key the encrypted key blob and how it is wrapped104 bytesdata offsetEncrypted data the disk, in blocks of the stated sizevaries
| Offset | Size | Field |
|---|---|---|
| 0 | 8 | Signature, encrcdsa |
| 8 | 4 | Version, 2 |
| 12 | 4 | Encryption IV size |
| 16 | 8 | Two fields whose meaning is not documented |
| 24 | 4 | Key bits |
| 28 | 8 | Two fields whose meaning is not documented |
| 36 | 16 | UUID |
| 52 | 4 | Block size |
| 56 | 8 | Data size |
| 64 | 8 | Data offset |
| 72 | 608 | Padding |
| 680 | 4 | Key derivation algorithm |
| 684 | 4 | Key derivation PRNG algorithm |
| 688 | 4 | Key derivation iteration count |
| 692 | 4 | Salt length |
| 696 | 32 | Salt |
| 728 | 4 | Key blob IV size |
| 732 | 32 | Key blob IV |
| 764 | 4 | Key blob key bits |
| 768 | 4 | Key blob algorithm |
| 772 | 4 | Key blob padding |
| 776 | 4 | Key blob mode |
| 780 | 4 | Encrypted key blob size |
| 784 | 48 | Encrypted key blob |
Version 1: cdsaencr
A version 1 image keeps its header at the end of the file, 1,276 bytes long, ending in
the eight bytes cdsaencr. The encrypted data comes before it.
| Offset in the header | Size | Field |
|---|---|---|
| 0 | 48 | Padding |
| 48 | 4 | Key derivation iteration count |
| 52 | 4 | Salt length |
| 56 | 48 | Salt |
| 104 | 32 | Unwrap IV |
| 136 | 4 | Wrapped AES key length |
| 140 | 296 | Wrapped AES key |
| 436 | 4 | Wrapped HMAC key length |
| 440 | 300 | Wrapped HMAC key |
| 740 | 4 | Integrity key length |
| 744 | 48 | Integrity key |
| 792 | 484 | Padding, ending with cdsaencr |
What can be read
Without the password, only the fields above can be read. They say how the key was protected, not what it is. The disk inside cannot be identified or browsed, and the explorer does not ask for a password.