Skip to content

Decryption fails with null function or function signature mismatch #213

@manivasagant

Description

@manivasagant

@utelle I am getting Exception: null function or function signature mismatch while reading the encrypted DB.

Database: Encrypted with chacha20 using better sqlite3 multiple ciphers and trying to read from sqlit3mc WASM
Platform: Mac OS 15.5.
Available VFSes: (8) ['multipleciphers-unix-none', 'opfs-encrypted', 'opfs', 'unix-none', 'memdb', 'unix-excl', 'unix-dotfile', 'unix']

I am writing encrypted bytes into default VFS and opening DB with oo1.DB and using pragma commands to set key. Not sure what I am missing. I am new to this, so would greatly appreciate any guidance or help.

`async function openEncryptedDatabase(encryptedDbBytes, hexKey) {
try {
const capi = sqlite3.capi;
const oo1 = sqlite3.oo1;

const dbName = "zeus.db";

capi.sqlite3_js_posix_create_file(dbName, encryptedDbBytes, encryptedDbBytes.length);
let db = new oo1.DB(dbName, 'r');

db.exec("PRAGMA cipher = 'chacha20';");
db.exec("PRAGMA page_size = 4096;");
db.exec(PRAGMA key = "x'${hexKey}'";);

db.exec("SELECT * FROM sqlite_master;");
}`

Note: I am using latest precompiled bundle of sqlite3.wasm /JavaScript APIs from https://github.com/utelle/SQLite3MultipleCiphers/releases/download/v2.2.3/sqlite3mc-2.2.3-sqlite-3.50.3-wasm.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions