title: How can I encrypt CoreData contents on an iPhone
body: <p>I have some information I'd like to store statically encrypted on an iPhone application. I'm new to iPhone development, some I'm not terribly familiar with CoreData and how it integrates with the views. I have the data as JSON, though I can easily put it into a SQLITE3 database or any other backing data format. I'll take whatever is easiest (a) to encrypt and (b) to integrate with the iPhone view layer.</p>
  
  <p>The user will need to enter the password to decrypt the data each time the app is launched. The purpose of the encryption is to keep the data from being accessible if the user loses the phone.</p>
  
  <p>For speed reasons, I would prefer to encrypt and decrypt the entire file at once rather than encrypting each individual field in each row of the database.</p>
  
  <p>Note: this <em>isn't</em> the same idea as <a href="https://stackoverflow.com/questions/929744/encrypting-sqlite-database-file-in-iphone-os">Question 929744</a>, in which the purpose is to keep the user from messing with or seeing the data. The data should be perfectly transparent when in use.</p>
  
  <p>Also note: I'm willing to use <a href="http://www.mobileorchard.com/tutorial-iphone-sqlite-encryption-with-sqlcipher/" rel="noreferrer">SQLCipher</a> to store the data, but would prefer to use things that already exist on the iPhone/CoreData framework rather than go through the lengthy build/integration process involved.</p>