[odb-users] Encrypting the Sqlite DB

Boris Kolpackov boris at codesynthesis.com
Thu Mar 7 10:55:32 EST 2013


Hi Lavi,

Lavi Kwiatkowsky <lavik at codevalue.net> writes:

> https://github.com/OlivierJG/botansqlite3#readme Open source library 
> based on Botan encryption lib, requires a lot of messing around to get
> it to work in my opinion.

I did a bit of digging around and this seemed like the most promising
option to me. If not directly then at least as a base.

It appears that the SQLite folks have all the hooks necessary to
implement encryption in the vanilla SQLite, they are just disabled
(see the SQLITE_HAS_CODEC macro). So what botansqlite3 does is
essentially implement these hooks (just like the official "SEE")
and using the Botan encryption library to do the actual work.

So if I were to implement SQLite encryption, I would probably
use the same approach but maybe using OpenSSL or some standalone
implementation for encryption.


> To work with the second option was tricky to integrate with ODB but 
> I made it happen:
>
> [...]

I think a better approach would be to do it via the connection factory,
transparently to the client code. This earlier post explains the idea
(it talks about MySQL but exactly the same principle applies to all the
other databases, including SQLite):

http://www.codesynthesis.com/pipermail/odb-users/2012-January/000425.html

Boris



More information about the odb-users mailing list