Prepopulated Cordova Database


#1

As part of a cordova mobile app, I have a database which contains information that I do not want to share with to the public (unless they access it through the app one record at a time). My client also wants this accessed in offline mode so the entire database needs to be bundled with the app when the user first downloads it.

Can I use SQLCipher to allow the database records to be only available from within the mobile app? So if somebody had a jailbroken iPhone or opened an Android .apk file, they would not be able to copy and use the database.

If the above is not possible, would it be possible to allow the app to come with a blank encrypted database. This would then be populated with records by connecting to a remote server upon the user’s first launch of the program.

Please let me know if anything needs further clarification.


#2

Hello @DeclanM

SQLCipher does not allow for you to control which fields are encrypted, it encrypts the entire database, both the content and schema in full. You could either ship an encrypted database of the information you wish to protect, or have your application download the sensitive information to an encrypted database that you create on the fly within the application. For more information on the design of SQLCipher, please review this page. Also, you may find the SQLCipher specific API documentation helpful.