Checking encryption of Core Data sqlite file when Data Protection is enabled

Hi all,


I'm working on an app which relies on Data Protection to, well, protect the user's data from being accessed externally. We need to validate the encryption of the data, so we'd like to see the sqlite file in its encrypted state. However, if we download the app's container from Xcode, we get a regular sqlite file with all data in clear. We tried to get the same sqlite file throught iExplorer while the app is not running, and in this case we get a file of the same size, which sqlite3 can open correctly, but on which all queries do not return anything. Checking the file's contents with /usr/bin/strings shows that while the table names and schema is still visible, the actual data content is not.


This looks ok but we'd rather make sure that we're not missing something and that the file is actually encrypted in its "normal" state. How can we check that ?

Were you able to prove that Data Protection is working correctly? I'm working on an app and I'm using the Data Protection capability with Complete protection level. I've been trying to prove that it's working by setting up a repeating timer and accessing CoreData every 10 seconds after the device is locked, but I seem to be able to access it even after 3 minutes. With iExplorer until I unlock the device I can't seem to access any app content, but once I unlock it I can see the sql files. Since the device is unlocked I think this is expected.

Thanks!

Checking encryption of Core Data sqlite file when Data Protection is enabled
 
 
Q