10

If targetting iOS 4, you can use the Data Protection APIs.

If you have 'Full' protection, does this encrypt the entire sandbox?

Specifically, If I downloaded say a .doc file to disk programatically will this be encrypted? Or is it only encrypted if I use the NSData data protection options?

John Topley
  • 113,588
  • 46
  • 195
  • 237
Luke Mcneice
  • 3,012
  • 4
  • 38
  • 50
  • I am guessing your client wants to protect something inside his .doc file? If so, then the answer is it will not be encrypted. NSDataWritingFileProtectionComplete and its derivates are to protect against user data being malused (hence the reliance on the user locking their device etc.). If the user unlocks the device then steals your customers .doc file, you are in the poo. If the data is sensitive, encrypt it. – Paul de Lange Feb 04 '13 at 14:18

4 Answers4

6

It's only encrypted if you use data protection. See App States and Multitasking, and Protecting Data Using On-Disk Encryption.

Community
  • 1
  • 1
Elias
  • 504
  • 3
  • 9
4

if somebody were to jailbreak your device and bypass your passcode, information protected by the Data Protection API would remain encrypted and therefore inaccessible, since your passcode—the important piece of the decryption key, is not known.

Data Protection is enabled automatically simply by setting a passcode on the device.

The catch, however, is that the Data Protection feature only secures data in applications that have been specifically designed to use the Data Protection APIs.

In terms of built-in applications, that’s only the Mail app, and third-party apps that actually make use of the Data Protection features are surprisingly rare;

GoodReader and Box.net come to mind as good examples, but many other file storage apps such as Dropbox do not provide this support, meaning that your cached data is no more secure than your physical possession of the device.

This means that if you’re concerned about storing confidential data with secure encryption you will need to look to exclusively using third-party apps that support the Data Protection APIs.

It’s also important to keep in mind that any apps that use iCloud storage cannot use Data Protection, as the two are mutually exclusive due to the requirement for background synchronization of iCloud data when the device is locked.

Even GoodReader, for example, notes that documents you choose to store in the “iCloud” section of the app will not be protected by the Data Protection encryption.

Of course even Data Protection is only as secure as the passcode on the device. Using the Apple Configurator you can configure requirements for more complex passcode policies on devices to help improve security in this regard, as well as enabling an automatic erase of the device after a specified number of failed attempts.

Read more at here

Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
  • Hi, when creating an app - can Data Protection be enabled by ticking "Data Protection" in when creating the App ID in the Apple Developer Portal? Or is there more than this which needs to be done? Thanks – guyh92 Oct 31 '13 at 09:05
4

My understanding is that you must use the data protection options. There was a WWDC 2010 talk on exactly this topic. See "Session 209 - Securing Application Data" which goes into detail. These videos are free and highly informative.

Login through developer.apple.com and then you can use the link in the page to get to the videos. FYI, the video contains all the example code you should need.

WWDC 2010 videos

Abizern
  • 146,289
  • 39
  • 203
  • 257
Robotic Cat
  • 5,899
  • 4
  • 41
  • 58
3

If I recall correctly, starting with iPhone 3GS, hardware encryption is on by default for data on the iPhone, and additional encryption is available if you implement -- though if you are distributing/selling through AppStore, and you're implementing your own custom encryption beyond what Apple provides, the terms of AppStore requires you to get US Dept of Commerce (if my memory is correct) approval because encryption is classified as munition.

A good starting document is http://www.apple.com/iphone/business/it-center/security.html

More info on this is available within (paid) iPhone Registered Developer website which for obvious reason, I couldn't reveal, and you'll have to discover/read yourself.

Hope the information helps, and please mark the response as answered if this helps, thanks.

Global nomad
  • 1,037
  • 12
  • 25