Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

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:

  1. The host authenticates to the iOS device with its host key
  2. The host transfers the encrypted Escrow Keybag to the iOS device
  3. 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
  4. 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?

share|improve this question
add comment

1 Answer

Your hypothesis is most likely correct.

The Data Protection APIs indicate that data can be in one of three states:

  1. Unencrypted all the time
  2. Unencrypted after first PIN code entered after boot
  3. Unencrypted while unlocked (re-encrypts 10s after screen lock)

This information (along with the info you pointed out in your question) indicates that most likely iTunes is verified and determined to be trusted, then the data is unlocked/unencrypted for transport over USB by the device itself.

It is of course possible that Apple is using entirely different APIs to access the data for syncing, but it seems most likely that their APIs are at least similar to the system provided data protection APIs, if they aren't using exactly those.

More information on Data Protection is in the notes/video from WWDC 2012 Session 714 "Protecting The Users Data"

share|improve this answer
    
this would tie in with my understanding of it. iTunes is authorised on an per installation basis the first time a given device is connected to it, but I don't think it has direct access to the device encryption keys, so backups would be decrypted on device and then transferred. –  Rоry McCune Aug 14 '13 at 16:00
    
Also, you are allowed to set your own password for locally encrypted backups in iTunes (or you used to be anyway) which would again indicate that the data is encrypted on the computer you are syncing with, not coming across the wire in encrypted form. –  Jeff Aug 14 '13 at 16:14
1  
@Jeff — As far as I know, the backup encryption passcode is actually set on the device, so the data that arrives from the device is already encrypted. If you set a backup passcode you can't change or remove it without knowing the original code (or restoring the device to factory settings) –  Joel L Aug 14 '13 at 17:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.