System.Data.SQLite: RC4 Chipher #3680
-
Hi, Is there support for System.Data.SQLite: RC4 chipher? I really need it cause I am trying to open a database from another app that was written in C# which uses System.Data.SQLite. I know the chipher itself is bad, but I cannot change the chipher! I tried it out, but it doesn't seem to work. Here's the code I tried: use std::str::FromStr;
use sqlx::{sqlite::SqliteConnectOptions, ConnectOptions};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), sqlx::Error> {
let passphrasr = "ENTER_CODE_HERE";
let mut conn = SqliteConnectOptions::from_str("sqlite://PATH_TO_FILE")?
.pragma("cipher", "'rc4'")
.pragma("key", format!("'{}'", passphrasr.replace('\'', "''")))
.connect()
.await?;
sqlx::query(r#"SELECT * from song;"#).execute(&mut conn).await?;
println!("* Hello, world!");
Ok(())
} It gave me the When using nodejs better-sqlite3-multiple-ciphers package it does open correctly when using the same pragma's. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
As the README for better-sqlite3-multiple-ciphers explains, it uses the SQLite3MultipleCiphers extension, which is... the exact same thing you linked at the beginning. The "extension" (since it can't actually load as an extension as it needs a few changes to SQLite itself) works as a drop-in replacement for SQLite3: https://utelle.github.io/SQLite3MultipleCiphers/docs/installation/install_overview/#drop-in-replacement-for-sqlite You would use this with the I can't guarantee that any of this will work without a lot of extra fiddling. You might be better off with the NodeJS lib. |
Beta Was this translation helpful? Give feedback.
Welp, I ended up using
rusqlite
and made some changes to let it bundle sqlite3mc as a feature.For anyone who also needs Sqlite3MultipleCiphers support, please refer to:
rusqlite/rusqlite#1726
You should just be able to use my branch and be fine