2
votes

I am developing an app that stores PDF files. These files should be stored secure, i. e. encrypted. I also found some libraries that extend NSData with AES en/decryption. But then I read, that iOS supports hardware encryption via AES. Is the NSData library really necessary if they both provide AES256 encryption?

If there are differences, which way is more secure? Also.. how do I activate the hardware encryption? Or is this a global setting that applies to all apps? I guess that the files become decrypted after the device is unlocked? So if someone cracks my phone he has also access to the decrypted files? But if I do the encryption by myself and connect the decryption with a SHA hashed password that is stored in the keychain the files might still be inaccessible?

Edit:

Did I get it all wrong and my library (AQToolkit) is just some kind of API for the built-in hardware encryption and I am basically talking about the same thing?

1
if both of them implement the same algorithm then the security level is the same, using the system implementation you avoid the inclusion of the other library - tkanzakic
If you're in the US you can avoid a (perhaps theoretical) violation of the law by using encryption built-in to the device/OS, vs installing your own library. It is against the law to export encryption technology without a license, which is what you would be doing if you ship an encryption library. - Hot Licks
I don't expect you to answer all of them.. especially the first and last one are important. - Marc
I would suggest you to protect your PDFs with password and don't use any data encryption in your app - Oleg

1 Answers

1
votes

I heartily recommend RNCryptor, which uses Apple's own Security.framework guaranteeing hardware encryption/decryption if possible. It's incredibly easy to use in the default case (AES-256 with 10k iterations of PBKDF2). It's not an encryption library per se, but rather an Obj-C packaging of the open source Common Crypto C library. Check it out.