Securing Data in iOS
blog.chariotsolutions.com
blog.chariotsolutions.com
1. Using iOS keychain. The nice thing about it is that it's transparent to the user and easy to explain - "we store it he same way Mail app stores your email password".
2. Asking the user to enter a pass phrase and use it as an encryption key. The key here is to resist the urge to hash the phrase to turn it into a key, and instead use a well known key derivation function for the same purpose.
With regard to the second point, one added benefit of SQLCipher over a roll-your-own solution is that SQLCipher automatically applies PBKDF2 derivation. It handles most of the security under the hood so that the application doesn't need to worry about it.
- Items are stored with a protection class that makes them only available when the device is unlocked. (see Section 2.14) - A strong passcode of 6 alphanumeric digits is enforced (reduces the risk of brute-force attacks)
The second point is as relevant as the first. The paper goes on to say:
according to [App10b]: ... The standard simple code of 4 numeric digits would be brute-forced in less than 9 minutes. Based on the assumption that the counter for wrong tries in the iOS can be bypassed, as it is not hardware-based. [BS11b] provides a tool for passcode bruteforce attacks.
Forensic toolkits, like the one from Elcomsoft (http://www.elcomsoft.com/eift.html), are able to recover numeric pass codes and extract data in less than an hour, even on newer devices.
With a weak passcode, which most people use, the keychain does not offer much protection against dedicated attackers with device access.