I'm trying to understand an implementation detail of Apple's data protection in iOS: I know about the per-file encryption and the various key encryption classes and keybags; however, I don't understand how that works for file transfer over USB (e.g. for iTunes backups).
When backing up data to iTunes over USB, does the iOS device decrypt the file internally, or is it sent in its encrypted form, and iTunes performs the decryption (using the various class keys contained in the Escrow Keybag)?
The former possibility seems more plausible, since in newer versions of iOS, the Escrow Keybag is supposedly encrypted with a key only known to the iOS device, so I suspect that the procedure looks something like this:
- The host authenticates to the iOS device with its host key
- The host transfers the encrypted Escrow Keybag to the iOS device
- The iOS device decrypts the Escrow Keybag, thereby gaining access to the class keys of all security classes without the user having to unlock the device
- iTunes requests some files for backup purposes, writes others to synchronize music etc, and all encryption and decryption happens on the iOS device, using the keys provided by the Escrow Keybag.
Can anybody confirm that, or point out where I am mistaken?