Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default value of NSFileProtectionKey

What is the default value of the attribute NSFileProtectionKey?

There are four possible values, but which one is the default one?

NSFileProtectionNone
NSFileProtectionComplete
NSFileProtectionCompleteUnlessOpen
NSFileProtectionCompleteUntilFirstUserAuthentication

I did not find the answer in the NSFileManager iOS reference doc.

like image 693
Vincent Avatar asked Jan 15 '15 10:01

Vincent


2 Answers

Just to provide the reference:

https://www.apple.com/business/docs/iOS_Security_Guide.pdf

Protected Until First User Authentication

(NSFileProtectionCompleteUntilFirstUserAuthentication): This class behaves in the same way as Complete Protection, except that the decrypted class key is not removed from memory when the device is locked. The protection in this class has similar properties to desktop full-volume encryption, and protects data from attacks that involve a reboot. This is the default class for all third-party app data not otherwise assigned to a Data Protection class.

...

Data Protection in apps

The iOS Software Development Kit (SDK) offers a full suite of APIs that make it easy for third-party and in-house developers to adopt Data Protection and help ensure the highest level of protection in their apps. Data Protection is available for file and database APIs, including NSFileManager, CoreData, NSData, and SQLite.

...

User-installed apps that do not opt-in to a specific Data Protection class receive Protected Until First User Authentication by default.

like image 159
jesse Avatar answered Sep 22 '22 14:09

jesse


It seems that the default value is NSFileProtectionCompleteUntilFirstUserAuthentication

like image 25
Vincent Avatar answered Sep 19 '22 14:09

Vincent