Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to encrypt iOS files (e.g. PDFs) from user access?

Tags:

ios

Is there a way to secure files downloaded within an app to prevent them from being accessed by the user via a jail broken device, or something like iExplorer when the device is plugged into a computer ?

I'm primarily thinking of things like PDF files, and have considered encrypting them in someway and then storing the data in an sqlite database. The other thing I've looked into is 'NSDataWritingFileProtectionComplete' but that only seems to encrypt data when the phone is locked.

Any suggestions more than welcome. Thanks.

like image 399
AndyDunn Avatar asked Feb 27 '12 17:02

AndyDunn


2 Answers

You could use the CCCrypt library to encrypt your data.

These links should guide you in the right direction:

http://aptogo.co.uk/2010/07/protecting-resources/

http://www.raywenderlich.com/6475/basic-security-in-ios-5-tutorial-part-1

like image 181
bobbypage Avatar answered Oct 20 '22 20:10

bobbypage


If it's just PDF files, the easiest way to secure them is to password-protect the files. Your app can use the password to open them, but people who grab the files from the device won't be able to.

like image 33
user1021430 Avatar answered Oct 20 '22 19:10

user1021430