核心数据在后台加密 [英] Encryption with Core Data in background

查看:173
本文介绍了核心数据在后台加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与此处的问题不同,因为应用程序主要在后台。

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.

我们目前的实现是使用SQLite使用SQLCipher。该计划是转移到核心数据。

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

我正在寻找一种解决方案来保护数据加密,而在后台仍可访问,并不限制于查询 - NSPredicates和迁移(模式更改)。

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 - 不允许文件访问在后台

  • 加密核心数据 - 此库似乎保持最新。但是,在看到已知问题。有人最近有人使用过吗?

  • NSIncrementalStore - 这是苹果工程师建议我们遵循的方式。加密核心数据正在使用此方法。

  • 可变形属性在核心数据中 - 这个解决方案是否适用于更大的数据集?

  • 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?

推荐答案

我运行了一些概念验证应用程序,以上选项。我按照现有的解决方案(SQLCipher)运行数字和台式机。
看起来像使用增量存储( encrypted-core-data )的核心数据出来是最好的。

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.

在分析小型和大型数据库的读取,写入和搜索的运行时性能时间后, encrypted-core-data 证明是最有效和更简单的实现。

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.

这篇关于核心数据在后台加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆