I wanted to recover with foremost or scapel the a girlfriends iPhone 4, because she had deleted all the videos of her daughter.

What I have got:

  • A backup of the iPhone with iTunes without password.
  • DD image of rdisks0s1 16 GB mountable on Linx. Everything is there.
  • A copy of all files with WinSCP uncrypted. System.kb ... phone was jailbreaked and DFU mode and with an early verison of the Geckotool.
  • deviceinfos (EMF,dataVolumeUID,key835,key89A,key89A,...)
  • Keychain decrypted

What I havent got:

  • I cant bring the thinks togehter and I gave back the phone, because she needed it.
  • When I try to run iphone_Dataprotection EMF_decrypt it says "Keybag locked". Is there a way to unlock the keybag without the IPhone? In the tool I used was not the command to bruteforece. Just the possibiltiy to mount the filesystem to mnt1 & mnt2 and device infos.

Is here somebody who can show me a way to decrypt the image?

closed as unclear what you're asking by Xander, user45139, WhiteWinterWolf, M'vy, RoraΖ Sep 14 '15 at 11:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


This is actually harder than you might think. An iPhone's automatic data protection encrypts each file with a random key, and stores a copy of the key encrypted with the appropriate class key (from the keybag, where it is encrypted with the phone's UID key and the user's passcode) in the file header in the filesystem.

Upon deleting a file, the file header in the filesystem is cleared, so the encrypted key is lost, effectively accomplishing a cryptographic erasure of that one file. Therefore, something like Photorec on the disk image will get you nothing. Even recovery of the class keys is useless, because the wrapped file encryption key has been lost.

Of course, to gain full NSA-resistant security when doing cryptographic erasure on flash, you have to store the key on a section of the flash that doesn't have overprovisioning or copy-on-write or any of the other handy flash translation layer features that might leak old data. The key for the whole filesystem is stored in just such a special area, called Effacable Storage, but the wrapped per-file keys are not, so perhaps desoldering the flash and dumping it chip by chip might let you recover the wrapped keys. Of course, you'd still need the iPhone's UID key to decrypt the transparently-encrypted filesystem header that was decrypted for free before you desoldered the chips...

At some point here you bash your brains out on the wall and die.

(A corollary to all this is that wiping the free space on an iPhone is pointless, because it's already been cryptographically erased.)

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