# sqlcipher-src
[](https://github.com/LucaCappelletti94/sqlcipher-src/actions/workflows/ci.yml)
[](https://github.com/LucaCappelletti94/sqlcipher-src/actions/workflows/codeql.yml)
[](https://codecov.io/gh/LucaCappelletti94/sqlcipher-src)
[](https://sonarcloud.io/summary/new_code?id=LucaCappelletti94_sqlcipher-wasm-src)
[](https://github.com/LucaCappelletti94/sqlcipher-src/actions/workflows/sqlcipher-release.yml)
[](https://crates.io/crates/sqlcipher-src)
[](https://docs.rs/sqlcipher-src)
[](https://github.com/LucaCappelletti94/sqlcipher-src/blob/main/Cargo.toml)
The [SQLCipher](https://github.com/sqlcipher/sqlcipher) amalgamation and the [libtomcrypt](https://github.com/libtom/libtomcrypt) crypto provider as C source for `-sys` crates.
Native builds compile `SOURCE_FILE` with their own crypto provider and flags:
```rust
let dir = sqlcipher_src::source_dir();
assert!(dir.join(sqlcipher_src::SOURCE_FILE).is_file());
assert!(dir.join(sqlcipher_src::HEADER_FILE).is_file());
```
The `sqlcipher` feature of [`sqlite-wasm-rs`](https://github.com/Spxg/sqlite-wasm-rs) builds from this crate for `wasm32-unknown-unknown`, pairing `SOURCE_FILE` with `libtomcrypt.c`.
The sources are generated from signed SQLCipher and libtomcrypt releases by `upgrade.sh` and ship as released, except that `SOURCE_FILE` skips SQLCipher's `.fini_array` finalizer on `__wasm__`, which cannot hold that section, until [sqlcipher/sqlcipher#622](https://github.com/sqlcipher/sqlcipher/pull/622) is released. CI runs SQLCipher's and `rusqlite`'s SQLCipher tests on them natively, and checks through `sqlite-wasm-rs` that files written natively and in Node, Chrome and Firefox open on both sides.
The crate is MIT, SQLCipher is BSD-3-Clause, SQLite is public domain, and libtomcrypt is public domain or WTFPL.