79185767

Date: 2024-11-13 16:16:30
Score: 1
Natty:
Report link

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(())
}
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @frankenapps
  • Low reputation (0.5):
Posted by: Kfir