1

From what I understand, to enable data encryption for Core Data the device needed to enable/turn on Passcode and included this key in the optional dictionary for the addPersistentStoreWithType: method. I did enable Passcode for my device and this code in the project:

NSPersistentStore *store = [self.managedObjectContext.persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
                                                                   configuration:nil
                                                                             URL:self.storeURL
                                                                         options:@{ NSPersistentStoreUbiquitousContentNameKey : @"iCloudStore",
                                                                                    NSPersistentStoreFileProtectionKey : NSFileProtectionComplete}
                                                                           error:&error];

But when I opened the sqlite data file directly using a software called Liya (downloaded from Mac app store), I was able to see the data in the sqlite database. I saved the sqlite database file from my device to my Mac using iTunes filesharing.

Since data were encrypted, should I not be able to see data directly using tools such as Liya at all?

1 Answer 1

2

The encryption only works on the device. Files you copy off the device via iTunes or Xcode always get decrypted. When you pair your device with iTunes it creates a copy of all the encryption keys from the phone on your computer. That is necessary so iTunes can create backups and sync while your phone is locked.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.