Archiving Protect SQLite Data without Encryption on iPhone

I am developing an iphone application that uses Core Data with SQLite datastore and lots of images in a resourceset. I want a "simple" way to obfuscate the SQLite database file structure and image files to prevent an accidental hacker / unscrupulous developer from accessing them. When the application is deployed, the database files and image files will become obfuscated. After running the application, it will read and not obfuscate the database file, write the un-obfuscated version to the "tmp" user directory for master data use, and read / delete image files as needed.

I would like to apply a simple algorithm to files that will somehow scramble / manipulate the file data so that the sqlite database data is not distinguishable when the db is opened in a text editor and that none of it is recognized by other applications (SQLite Manager, Photoshop etc.)

It seems from the information I read I could use NSFileManager, NSKeyedArchiver and NSData to accomplish this, but I'm not sure how to proceed. Been a software developer for years, but I'm new to all over CocoaTouch, Mac and iPhone. Also never had to protect / encrypt my data, so this is new.

Any thoughts, suggestions or links to solutions are appreciated.

+2


source to share


1 answer


You can gzip the zip file. Remove the extension and remove the header of the file, then it would be quite difficult to guess how it can be decrypted if someone got the gzipped database.



If you want to read again, open the gzip header first and unpack it. gzip is available on iPhone

+4


source







All Articles