tauri-plugin-sql icon indicating copy to clipboard operation
tauri-plugin-sql copied to clipboard

[Question/orFeatureRequest?] SQLCipher Encryption

Open tunecino opened this issue 3 years ago • 1 comments

Hi and thank you for everything you are doing. I just started using Tauri (+ this plugin) for a side Angular project and results were amazing so far.

One thing left to figure out, my app will be downloadable for free, with the condition to only use it in a single machine. My logical thinking for it is to encrypt the database using some per-device unique ID. So I was wondering if is it possible to use SQLCipher. Digging a bit into sqlx, I found this thread linking a great sample repo: https://github.com/launchbadge/sqlx/issues/2009

It seems possible by overriding libsqlite3-sys dependencies to use bundled SQLCipher:

# optional = false - force to build the package with sqlcipher feature enabled
libsqlite3-sys = { version = "0.24.1", optional = false, default-features = false, features = [
     "bundled-sqlcipher"
] }

But I know nothing about RUST or SQLCipher and may be totally wrong. Is it possible to use SQLCipher through this library? can it be initialized with a key from the main.rs file?

Any help on choosing the right direction will be appreciated. Thank you.

tunecino avatar Oct 22 '22 00:10 tunecino

I think we need to expose the .pragma() method for this to work 🤔

FabianLars avatar Oct 22 '22 21:10 FabianLars