Encryption with Core Data in background

有些话、适合烂在心里 提交于 2020-02-07 03:42:25

问题


This question is different from questions here, because of the app being mostly in the background.

It is a requirement for our application that we keep the data store encrypted.

Our current implementation is using SQLite using SQLCipher. The plan is to move to Core Data.

I'm looking for a solution to keep the data encrypted, while still accessible in the background and is not restricting in terms of queries-NSPredicates and migration (schema change).

Below are all the options I've been looking into:

  • NSFileProtectionComplete - will not allow file access in the background
  • encrypted-core-data - This library does appear to be kept up-to-date. However, I've had second thoughts about using it in production after seeing the list of known issues. Has anyone used this recently?
  • NSIncrementalStore - This was the way that Apple engineers recommended that we follow. encrypted-core-data is using this method.
  • Transformable Attributes in core data - is this solution scalable for larger data sets?

Does anyone have a recommendation that meets all of the criteria and can be used in production apps?


回答1:


I ran some proof-of-concept apps using each of the above options. I ran numbers and bench-maked it against our existing solution (SQLCipher). Looks like using core data with incremental store (encrypted-core-data) came out to be the best.

After analyzing runtime performance times for read, write and search on DB with small and large sizes, encrypted-core-data turned out to be the most efficient and simpler to implement.



来源:https://stackoverflow.com/questions/31574660/encryption-with-core-data-in-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!