If you're working in Rust and you need to read a System.Data.SQLite: RC4
database,
or any of the other supported ciphers,
then that's not possible with the "bundled"
feature of rusqlite.
SQLite3MultipleCiphers is an extension for sqlite3 and can be used as a drop-in replacement for SQLite.
I personally had some trouble getting it to work, so now that I found out how you're supposed to do it, I decided to make a guide.
-
Download the
sqlite3mc-x.x.x-sqlite-x.x.x-win64.zip
from the SQLite3MultipleCiphers releases. -
Unarchive the downloaded zip and open the
dll
folder. -
Copy the
sqlite3mc_x64.lib
andsqlite3mc_x64.dll
files to your rust project folder, the folder with theCargo.toml
file. -
Rename the
sqlite3mc_x64.lib
tosqlite3.lib
, and leave the other file as it is. -
Install rusqlite without features enabled:
cargo add rusqlite
-
Add the code to use rc4:
let newconn = Connection::open("database.sqlite").unwrap();
newconn.pragma_update(None, "cipher", "rc4").unwrap();
newconn.pragma_update(None, "key", &"your_password").unwrap();
- Start your project:
cargo run
You should now be able to read and write to rc4 encrypted databases.