I have been encrypting core-data fields using 'SecKeyWrapper' class provided in one of Apple's document. The SecKeyWrapper class is non-ARC. I'm wondering if this is still the best way to encrypt core-data fields or is there newer/better solution available ?
Thank you
Similar to other full-disk encryptions, iPhone encryption also protects data that is at rest. This means that all the data that is stored in the device is protected when the device is not in use.
Yes. Apple's iPhone, iPod touch, and iPad smart devices all support basic built-in encryption while a passcode is enabled. Macs also support their own form of data encryption. The encryption on Apple's iOS and iPadOS devices, such as the iPhone, iPod touch, and iPad, is called Data Protection.
Core Data doesn't encrypt the data you store in the persistent store, but it is possible to enable encryption.
To disable data encryptionIn the Search box, enter Data Encryption Management, and then choose the related link. On the Home tab, in the Process group, choose Disable Encryption.
In iOS 5 and later Core Data by default uses NSFileProtection to protect persisted data.
For apps built for iOS 5.0 or later, persistent stores now store data by default in an encrypted format on disk. The default protection level prevents access to the data until after the user unlocks the device for the first time. You can change the protection level by assigning a custom value to the NSPersistentStoreFileProtectionKey key when configuring your persistent stores. For additional information about the data protection that are new in iOS 5.0, see “Data Protection Improvements.”
If you want to modify the default file protection behavior for your Core Data store, change the value for the key NSPersistentStoreFileProtectionKey to a different NSFileProtectionKey value in your store options dictionary.
Example:
NSDictionary *storeOptions = @{NSPersistentStoreFileProtectionKey : NSFileProtectionComplete};
if (![coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[self storeURL] options:storeOptions error:&error]){
[self presentError:error];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With