Padavan
Padavan

Reputation: 1074

How to protect my application data in Documents directory

How can I protect files in my application "Documents" directory? Using iFunBox, or another application like it, anyone can to see, what application store in it's documents directory. So if I want to store some private data, or information about in-apps status, gold, achievments or something else just in .plist-files it will be not safelly. Maybe there is a best-practices for iOS application how to secure and protect their data?

Upvotes: 2

Views: 1716

Answers (2)

Rob Napier
Rob Napier

Reputation: 299345

It is not possible to truly secure data from the user. It is naturally secured from other applications, but the user is always able to get access to everything on-disk or in memory.

That said, if you have data that the user is not supposed to access, then you should not store it in Documents, since this is backed up via iTunes. You should store it in Library. See "The Library Directory Stores App-Specific Files" in the File System Programming Guide for details on each possible location and how it is treated by the system.

Upvotes: 3

Kunal Aggarwal
Kunal Aggarwal

Reputation: 301

Applications you make for iOS are sandboxed, i.e., the apps feel like they are the only thing on the system. As a result, they cannot access any place outside the app. You are restricted to using the Documents, Library folders which are visible to applications like iFunBox.

Your best bet is to hash out the data and then store them to files, so that if anyone tries to edit your files it results in a hash mismatch, that you can read in your application, and make your data secure.

Upvotes: 2

Related Questions