SQLCipher WASM v0.2.3
Encrypted SQLite in the browser — SQLCipher + LibreSSL, compiled to WASM.
Files
| File | Description |
|---|---|
sqlcipher.js |
Emscripten glue (~94KB) |
sqlcipher.wasm |
Compiled binary (~1.4MB) |
sqlcipher-api.js |
Unified API — auto-detects OPFS / IndexedDB |
sqlcipher-oo1.js |
oo1 API shim (main thread, IndexedDB fallback) |
sqlcipher-worker.js |
Web Worker — OPFS or IndexedDB page cache |
sqlcipher-wasm-static.tar.gz |
Static libs for custom WASM builds |
Static libs (sqlcipher-wasm-static.tar.gz)
For custom WASM builds — contains:
sqlite3.c,sqlite3.h— SQLCipher amalgamation (patched)sqlcipher_wasm.c,opfs_vfs.c— WASM/VFS helperslibcrypto-wasm.a— LibreSSL libcrypto compiled for WASM (Emscripten)openssl/— LibreSSL headers
Quick start (unified API)
<script src="sqlcipher.js"></script>
<script src="sqlcipher-api.js"></script>
<script>
(async function() {
var db = await SQLCipher.open({filename: "app.db", key: "secret"});
console.log("Backend:", db.mode); // "opfs" or "indexeddb"
await db.exec("CREATE TABLE IF NOT EXISTS t (x TEXT)");
await db.exec("INSERT INTO t VALUES (?)", ["hello"]);
var rows = await db.select("SELECT * FROM t");
// data is durable — auto-flushed on every exec
await db.close();
})();
</script>See docs/oo1-api.md for the full API reference.