I have a SQLite database which contains confidential information. So my concern is how do I store it in iPhone so that it is secure and hackers can’t get to it. I looked into hardware encryption provided by ipad but could’t figure it out how to use that.Any Help is appreciated…
I have a SQLite database which contains confidential information. So my concern is how
Share
You may look at different approaches for soulution of your problem.
Encrypt values, stored in CoreData with md5 + salt encryption. You can generate special key, based on user device UUID and some additional “salt” to store data. Be careful, Apple is going to depreciate device personalization values in future. But on the other side, you may recieve special key by user authentification and recieving this key from post request. For encryption you can use built in framework:
#import <CommonCrypto/CommonDigest.h>. There are a lot of examples which you can find on the web.Encrypt whole sqlite file in documents folder. This can me quite tricky, and and have not faced this approach before.
EDIT:
This is code sample which you can use to receive encrypted with md5 data:
This is .h file
this is .m file:
So if you include this files to any place of your code, you can simply call this function:
btw: you should know, that MD5 function is just hash function, which returns you control sum of data. If you want to encrypt, you could look at AES256 encryption method. CommonCrypto also provides it. Approach depends on your goals.