简体   繁体   English

在iOS中打开加密的sqlite3

[英]Open encrypted sqlite3 in iOS

I have an encrypted sqlite3 with AES128 encryption 我有一个使用AES128加密的加密sqlite3

And I used the libsqlite3.0 to fetch the data to my app ... 然后我使用libsqlite3.0将数据提取到我的应用中...

so how to open it ?? 那么如何打开它呢?

thanks in advance 提前致谢

The links you provided talk about encrypting storage across the whole device; 您提供的链接讨论了整个设备上的存储加密。 However if the goal is that the user not be able to open the database file directly then will not help you, as the only thing that protects against is your data being accessed in the event the device is stolen. 但是,如果目标是用户不能直接打开数据库文件,那么将无济于事,因为唯一的防御就是在设备被盗的情况下访问您的数据。 It also relies on the user to set it up, the app cannot mandate that the device storage is encrypted. 它还依赖于用户进行设置,应用无法强制要求对设备存储进行加密。

sqlcipher ios-tutorial sqlcipher ios教程

You have one of three cases: 您有以下三种情况之一:

  1. The individual entries are encrypted 各个条目已加密
  2. The entire file is encrypted 整个文件被加密
  3. The database is encrypted with SqlCipher or another encrypting version of SQLite 使用SqlCipher或SQLite的另一个加密版本对数据库进行加密

If #1 you'll be able to retrieve entries but they will be gibberish. 如果为#1,则可以检索条目,但它们会变得乱七八糟。 Decrypt after retrieval. 检索后解密。

If #2 or 3 then the DB will not open with standard SQLite. 如果为#2或3,则该数据库将无法使用标准SQLite打开。

If #2 you simply decrypt the file (using onboard encryption services) and then access "normally". 如果是#2,则只需解密文件(使用板载加密服务),然后“正常”访问。

If #3 you must install SqlCipher (or whichever encrypting DB was used). 如果为#3,则必须安装SqlCipher(或使用哪种加密数据库)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM