For my iOS 6+-only app, I would like to enable the On-Disk Encryption offered from iOS.
I read this guide and I saw the "Protecting the User's Data" video of the WWDC 2012 (Session 714). However, I could not make it work.
Here are the steps I followed:
1- In the iOS Dev Center, I created a new App ID with:
2- In Xcode, I added an Entitlements file with the key:
3- On the device, I activated a passcode lock.
If I'm not wrong, this should be all. I now expect that while the device (in my case: an iPhone 5) is locked, protected files are inaccessible. But... if I use iExplorer, I can easily access the files created by my app, even when the device is locked. But this is exactly what I want to avoid. Did I forgot something?
The reason you can access files without unlocking your device is that an escrow keybag has been created. This is explained in Apple's iOS Security Guide (pdf):
If you reboot your phone, you will not be able to access files without unlocking it once.
If you want that files to be available only when device is unlocked(+about 10 seconds of grace period), set file protection to NSFileProtectionComplete. Be sure to implement delegate methods to know when data will become [un]available.