问题描述
我如何创建一个加密的 SQLite 数据库,该数据库实际上保持加密状态或之后可以打开.
How can I create an encrypted SQLite database that actually stays encrypted or that I can open afterwards.
我使用了可以"创建加密数据库的 SQLite2009 Pro Enterprise Manager,但在输入加密密钥后,它们无法再打开.
I used SQLite2009 Pro Enterprise Manager that "can" create encrypted databases, but after typing in the encryption key they are no longer openable.
我使用 SQLabs 的 SQLiteManager 创建了一个加密数据库,虽然这个数据库可以在之后打开,但可以通过任何 SQLite 管理工具或代码完成,而无需我输入的密钥.
I used SQLiteManager from SQLabs to create an encrypted database and while this one can be opened afterwards, this can be done from any SQLite management tool or code without requiring the key I entered.
那么,请问如何创建加密的 SQLite 数据库?
So, how the heck can you create an encrypted SQLite database please?
我计划在 Adobe Flex 应用程序中使用该数据库.
I plan to use the database in an Adobe Flex aplication.
谢谢.
推荐答案
SQLite 支持集成加密,但默认的开源 SQLite 发行版不支持加密.加密版本的 SQLite 只能在不同客户端或工具之间移植,前提是它们都使用相同的加密扩展.
SQLite supports integrating encryption but the default open-source SQLite distribution does not support encryption. Encrypted versions of SQLite are only going to be portable across different clients or tools if they all use the same encryption extension.
SQLite 开发人员自己分发支持透明加密的商业版本的 SQLite.当此模块用于加密时,加密跨平台工作,写入文件的每个字节都被加密.存储在磁盘上的加密 SQLite 文件中没有任何内容表明它是 SQLite 数据库.许多工具通过允许您放入商业 sqlite.dll 文件来代替开源文件来支持这种实现.
The SQLite developers themselves distribute a commercial version of SQLite that supports encryption transparently. When this module is used for encryption, the encryption works across platforms and every byte written to the file is encrypted. There is nothing in an encrypted SQLite file stored on disk to even indicate it's a SQLite database. Many tools support this implementation by allowing you to drop in the commercial sqlite.dll file in place of the open-source one.
还有支持加密的第三方扩展.例如,System.Data.SQLite 支持加密,但使用 .NET 库来这样做,因此加密的 System.Data.SQLite 只能由另一个也使用 System.Data.SQLite 的客户端读取(这是故意的,出于尊重核心 SQLite 开发人员及其商业产品).
There are also third party extensions that support encryption. For example, System.Data.SQLite supports encryption but utilizes .NET libraries to do so and thus an encrypted System.Data.SQLite can only be read by another client that also uses System.Data.SQLite (this is on purpose, out of deference to the core SQLite developers and their commercial product).
Adobe AIR 1.5 支持加密.我不确定使用哪种机制,但我搜索并找不到答案.AIR 加密数据库可能只能使用 AIR 读取.两种方式我都不确定.但是,这里是学习使用加密数据库的一个很好的起点是 AIR:
Adobe AIR 1.5 support encryption. I don't know for sure which mechanism is used though, I searched and couldn't find the answer. It's possible that an AIR encrypted database can only be read with AIR. I don't know definitively either way. However, here is a good starting point for learning about working with encrypted databases is AIR:
http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database-how-to/
这篇关于SQLite - 创建加密数据库.怎么……?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!