Since @frankenapps posted their answer, rusqlite
has added support for sqlcipher
in the master branch.
In your Cargo.toml
:
[dependencies]
rusqlite = { version = "0.32", features = ["bundled-sqlcipher"] }
use rusqlite::Connection;
const ENCRYPTION_KEY: &str = "your-encryption-key";
fn main() -> Result<(), Box<dyn Error>> {
let conn = Connection::open(path)?;
conn.pragma_update(None, "KEY", ENCRYPTION_KEY)?;
Ok(())
}