如何在 iPhone 上打开加密的 SQLITE 数据库?
问题应该很清楚:)
我遵循了本教程: http://mobileorchard .com/tutorial-iphone-sqlite-encryption-with-sqlcipher/
我很高兴知道在添加密钥后是否以及如何能够打开我的数据库。当我收到以下错误时:
“文件已加密或不是 数据库”
提前致谢!
Grtz,
Lewion
The question should be clear right :)
I followed this tutorial: http://mobileorchard.com/tutorial-iphone-sqlite-encryption-with-sqlcipher/
Would be glad to know if and how I'm able to open my db after adding the key to it. As I receive following error atm:
"file is encrypted or is not a
database"
Thanks in advance!
Grtz,
Lewion
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建新加密 SQLite 数据库或打开现有加密 > SQLite数据库,您必须在打开数据库后立即调用函数sqlite3_key或执行“pragma key=”命令,然后才能执行任何其他数据库操作。
我怀疑您尝试打开现有但未加密的 SQLite 数据库,并希望使用上述方法之一对其进行加密。这不起作用,但会导致您遇到的错误消息。
要加密现有的未加密的 SQLite 数据库,您必须使用函数 sqlite3_rekey 或“pragma rekey=”命令。
要更改现有加密 SQLite 数据库的加密密钥,您必须打开数据库,然后使用 sqlite3_key(或“pragma key =”),然后应用 sqlite3_rekey(或“pragma rekey =”)。
To create a new encrypted SQLite database or to open an existing encrypted SQLite database you have to call the function sqlite3_key or to execute a "pragma key=" command immediately after opening the database before performing any other database operation.
I suspect that you tried to open an existing, but not encrypted SQLite database and expected to encrypt it by using one of the above methods. This doesn't work but results in the error message you experienced.
To encrypt an existing not encrypted SQLite database you have to use function sqlite3_rekey or "pragma rekey=" command.
To change the encryption key of an existing encrypted SQLite database you have to open the database, then to use sqlite3_key (or "pragma key=") and then to apply sqlite3_rekey (or "pragma rekey=").