Applying iOS file protection to SQLite databases
Applying iOS file protection to SQLite databases
- Subject: Applying iOS file protection to SQLite databases
- From: Jens Alfke <email@hidden>
- Date: Wed, 15 Aug 2012 16:16:51 -0700
How can I enable full file protection (encryption) on iOS for SQLite databases?
The obvious, easy part is setting the NSFileProtectionComplete attribute on the SQLite database file after it's first created. Presumably this attribute will stick, because I don't think SQLite every recreates the file from scratch, it just updates it incrementally.
The problem is the side files created by SQLite. By default there is a "journal" file that exists temporarily during transactions, and if one enables the write-ahead log (WAL) feature, which really improves write performance, there are two side files (with "-shm" and "-wal" suffixes) that seem to exist permanently, which contain recently-added rows before they get merged into the main database file. How do I ensure that those files get the appropriate protection attributes too?
—Jens
PS: I posted this yesterday (in slightly different form) but it never showed up for me; apologies if this is a dup.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden