Data encryption with Core Data in iOS

后端 未结 3 1444
执念已碎
执念已碎 2021-01-01 00:59

I just need a confirmation on this.

Is it correct to say that, with the iPhone 3GS and above, any data written to the filesystem is encrypted using hardware encrypti

3条回答
  •  长发绾君心
    2021-01-01 01:35

    No, your assumption is not correct.

    From the NSPersistentStoreCoordinator class documentation:

    The default value is NSFileProtectionCompleteUntilFirstUserAuthentication for all applications built on or after iOS v5.0. The default value for all older applications is NSFileProtectionNone.

    To enable NSFileProtectionComplete, one would need to add the NSPersistentStoreFileProtectionKey with NSFileProtectionComplete to the options NSDictionary when calling the addPersistentStoreWithType:configuration:URL:options:error: method.

    Keep in mind that this file encryption is only enabled when the user has set a passcode.

提交回复
热议问题