0

We need to store various data (accesstokens, receipts). In bytes this is relatively small (20000 symbols or so).

We don't want the user to be able to read and tamper this data because we to some extent don't want any smart users to bypass our systems in some way.

We don't want this data to be stored after app is deleted. Therefore keychain seems inappropriate. This is wanted because it seems sensible that the user should get a clean install every time they install the app.

hfossli
  • 22,616
  • 10
  • 116
  • 130
  • is it for iphone / ipad? – user2071152 Mar 18 '14 at 10:22
  • you don't want to use NSFileManager? https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/nsfilemanager_class/reference/reference.html also, looks at this answer http://stackoverflow.com/a/16407980/503527 – Nitin Alabur Mar 18 '14 at 10:23
  • @user2071152: yes, for iOS 6 and above – hfossli Mar 18 '14 at 10:49
  • @VoteforNarendraModi I could use NSFileManager, but I'm not entirely sure about how to make it safe without too much fuzz. – hfossli Mar 18 '14 at 10:50
  • You can store the data in NSLibrary folder of application bundle. – user2071152 Mar 18 '14 at 10:50
  • @user2071152 I'm not asking about how and where to store plain data. In the description I'm asking how to do this in a safe manner where data is encrypted and not too easy to tamper. Just like keychain except for that we need the data to be wiped along with the application if user deletes app. – hfossli Mar 18 '14 at 10:54

1 Answers1

3

If you want to have the data secure you should use Core Data with apples Data Protection on the DB file.

In addition to that you should encrypt the data itself too.

UPDATE:

You may want to give this a look for encrypting the data: RNCryptor

And this for Data Protection: Data Protection

VaaChar
  • 688
  • 8
  • 20
  • Sounds like a valid way to go. Do you know about any wrappers for doing this in a simple manner? Just like having a wrapper for keychain: https://github.com/nicklockwood/FXKeychain ? Would be awesome – hfossli Mar 18 '14 at 10:52