FileVault 2

FileVault 2 is Apple’s full-disk encryption, used on OS X 10.7 and later with CoreStorage, and on APFS volumes since macOS 10.13. It is standard on many Macs, and unlocking needs the user password, recovery key or institutional key.

Overview

On Core Storage volumes FileVault 2 stores an encrypted volume key in the Core Storage metadata, wrapped by user and recovery keys; data is encrypted with AES-XTS. On APFS, encryption is native, with a keybag listing per-user and recovery key wraps. Unlocking requires a password or recovery key.

History

  • Introduced in Mac OS X Lion 10.7 (2011), replacing the older home-folder-based FileVault.
  • APFS native encryption arrived in macOS High Sierra (2017).

Structures

Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

Check Header

OffsetSizeTypeFieldNotes
0x82u16 LE–
0x488u64 LE–
0x581u8–
0x591u8–
0x604u32 LEBlock Size

Parse Family

OffsetSizeTypeFieldNotes
0x684u32 LECompressed
0x6C4u32 LEUncompressed
0x704u32 LEXml Offset
0x744u32 LEXml Size

Parse Family

OffsetSizeTypeFieldNotes
0x44i32 LESalt Length
0x44i32 LELength
0x184i32 LEKey Length
0x1C4i32 LEWrapped Length
0xA84i32 LEIterations

Parse Map

OffsetSizeTypeFieldNotes
0x88u64 LELogical
0x104u32 LEBlocks
0x208u64 LEPhysical
0x262u16 LEPv

Parse Volume

OffsetSizeTypeFieldNotes
0x804u32 LEXml Offset
0x844u32 LEXml Size

Read Encrypted Metadata

OffsetSizeTypeFieldNotes
0x82u16 LE–
0xA2u16 LEType
0x108u64 LETransaction

Read Header

OffsetSizeTypeFieldNotes
0xA84u32 LE–
0xB016bytes–
0x13016bytes–
0x14016bytes–
104 + copy * 88u64 LE–

Read Label

OffsetSizeTypeFieldNotes
0x88u64 LECount
0x208u64 LEPrimary
0x288u64 LESecondary

Read Label

OffsetSizeTypeFieldNotes
0xA2u16 LE–
0x108u64 LETransaction
0xDC4u32 LEDescriptor
0xE04u32 LEPlist Offset
0xE44u32 LEPlist Size

Verify Crc

OffsetSizeTypeFieldNotes
0x04u32 LEStored
0x44u32 LECrc

Aes Key Unwrap

OffsetSizeTypeFieldNotes
0x08bytes–
0x88bytes–

Looks Decrypted

OffsetSizeTypeFieldNotes
0x400512bytes–
0x4001u8–
0x4011u8–

Other fields read

Read inOffsetSizeTypeFieldNotes
Parse Map0x404u32 LECount
Verify Crci8u64 LECrc
Aes Key Unwrap0x08u64 BEValue

Constants

Core Storage Metadata

NameValueTypeNotes
HeaderSize512int
MetadataBlockSize8192int

The group’s plist: its PV list gives the PV indexes.

NameValueTypeNotes
ChunkBlocks64int

File Vault Decrypted Device

NameValueTypeNotes
Sector512int

Implementation limits

ClassNameValueNotes
Core Storage MetadataMaxMetadataBlocks1 << 17
File Vault Decrypted DeviceMaxChunkBytes1024 * 1024
File Vault KeysDefaultIv[0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6]
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.