SQLite - 创建加密数据库。如何...? [英] SQLite - Creating encrypted databases. How the...?

查看:160
本文介绍了SQLite - 创建加密数据库。如何...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用SQLite2009 Pro企业管理器,可以创建加密的数据库,但在输入加密密钥后,它们不再可以打开。



我使用SQLabs的SQLiteManager创建一个加密的数据库,而这个可以打开后,可以从任何SQLite管理工具或代码完成,而不需要我输入的密钥。



那么,你怎么能创建一个加密的SQLite数据库呢?



我计划在Adobe Flex应用程序中使用数据库。



谢谢。

解决方案

SQLite支持集成加密,但默认的开源SQLite分发不支持加密。



SQLite的加密版本只能在不同的客户端或工具之间移植。SQLite开发人员自己分发一个商业版本的SQLite支持透明加密。当此模块用于加密时,加密在平台上工作,并且写入文件的每个字节都被加密。加密的SQLite文件中没有什么存储在磁盘上,甚至表明它是一个SQLite数据库。许多工具支持此实现,允许您放置商业sqlite.dll文件代替开源代码。



还有第三方扩展支持加密。例如,System.Data.SQLite支持加密,但利用.NET库这样做,因此加密的System.Data.SQLite只能由另一个客户端读取,也使用System.Data.SQLite(这是有意的,出于尊重核心SQLite开发人员及其商业产品)。



Adob​​e AIR 1.5支持加密。我不知道确切使用哪种机制,但我搜索,找不到答案。可能只能使用AIR读取AIR加密的数据库。我不知道确切的两种方式。然而,这里是学习使用加密数据库的一个好的起点是AIR:



http://probertson.com/articles/2008/11/18/air-1_5-encrypted-sqlite-database -how-to /


How can I create an encrypted SQLite database that actually stays encrypted or that I can open afterwards.

I used SQLite2009 Pro Enterprise Manager that "can" create encrypted databases, but after typing in the encryption key they are no longer openable.

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.

So, how the heck can you create an encrypted SQLite database please?

I plan to use the database in an Adobe Flex aplication.

Thank you.

解决方案

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.

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.

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 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 - 创建加密数据库。如何...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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