RSQLite icon indicating copy to clipboard operation
RSQLite copied to clipboard

Support encrypted databases

Open JeremyPasco opened this issue 1 year ago • 12 comments

Hi, I'm looking for a way to read encrypted sqlite databases. There are many different ciphers allowing encryption of sqlite databases. One project support multiple ciphers: https://github.com/utelle/SQLite3MultipleCiphers

I am not a C programmer but as far I understand, SQLite3MultipleCiphers is a fork of sqlite and could be integrated in RSQLite instead of the original sqlite source code.

I guess this would allow users to decrypt database through simple dsn specification. For example, accessing a sqlite dabase encrypted with sqlcipher is as simple as appeding the following to the dsn: ?_cipher=sqlcipher&_key=<passphrase>.

Edit: DNS is a exposed by some libraries in other langages, but after investigation they all translate internally DNS variables to PRAGMA statements or sqlite functions. MultipleCiphers doesn't handle translation by itself.

I would perfectly understand that dropping sqlite for one of its forks may not be relevant here but maybe providing documentation on how to get it done may be usefull to some devs?

I would gladly investigate the topic if you find it relevant. Could you just just provide me clues on how to compile this package against an sqlite fork like SQLite3MultipleCiphers?

JeremyPasco avatar Dec 08 '23 16:12 JeremyPasco