Question
How can I ensure data is encrypted when using NSData.writeToFile:options:error: with the NSDataWritingFileProtectionComplete?
Background research: Enabling data encyption
According to Apple documentation:
Data protection is available on most iOS devices and is subject to the following requirements:
The file system on the user’s device must support data protection. This is true for newer devices, but for some earlier devices, the user might have to reformat the device’s disk and restore any content from a backup.
The user must have an active passcode lock set for the device.
The requirements state that user must activate passcode lock for the device, this is reinforced by the following end user documentation:
Enable data protection by configuring a passcode for your device:
- Tap Settings > General > Passcode.
- Follow the prompts to create a passcode.
- After the passcode is set, scroll down to the bottom of the screen and verify that the text "Data protection is enabled" is visible.
http://support.apple.com/kb/HT4175
Similar SO Questions:
How can I find out if the iPhone user currently has a passcode set and encryption enabled? seems like the answer to this question is no longer valid.