SQLCipher extension for sqlite3 on nodejs-mobile-cordova for Ionic 4 not encrypting

Hello guys i’d like to use the SQLCipher extension for sqlite3 on an Ionic 4 app running nodejs with nodejs-mobile-cordova cordova plugin.

So far I’ve been able to use the SQLCipher extension on nodejs for the pc but not on the phone.

The installation of the sqlite3 and extension is successful,

npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix`

but on runtime the db is always without encryption.

db.serialize(function() {
  db.run("PRAGMA KEY = 'secret'");
  db.run("PRAGMA CIPHER = 'aes-128-cbc'");
  db.run("CREATE TABLE messages(id INTEGER, user VARCHAR, msg TEXT)");

Any cordova sqlite plugins like do not work for me because i need full blob support.

Regards André

Hello @Andre_dos_Santos - Zetetic doesn’t actually develop or support node-sqlite3 so I’m not sure you’ll see much in the way of responses on this forum. It would be better to contact the developer of that library for support, either directly or via a GitHub issue.

If you’re in need of a commercially supported solution, we do offer a Cordova solution, but it is not a free package (it’s available only under the SQLCipher enterprise program). If you’re interested in learning more about that feel free to contact us.