sqlite-crypto v1.1.0 is a Node.js package that provides transparent encryption for SQLite databases using node-sqlite3. It bundles SQLite, eliminating the need for external libraries. Key features include configurable AES encryption (default aes-256-ctr), password protection, and an encrypt offset to reduce redundant decryption/re-encryption. The package wraps sqlite3 methods (run, get, all, etc.) and returns promises. However, it has very limited adoption (released 2018, last update 2020) and no security audit. Compared to alternatives like better-sqlite3 with SQLCipher, sqlite-crypto is less maintained and may have unknown vulnerabilities.
npm install sqlite-cryptoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates initializing an encrypted SQLite database, creating a table, inserting data, and querying rows using promise-based methods.
Use valid method strings: 'run', 'get', 'all', 'each'.
Handle both arguments in .then((error, response) => ...).
Consider migrating to better-sqlite3 with SQLCipher or sql.js with encryption.
Use a value >= 1000 for production to avoid re-encrypting too frequently.
Ensure you require('sqlite-crypto') correctly and call crypts.init() first. Check that the returned object has a run method.Create the table first using a CREATE TABLE statement with method 'run'.
Provide a string password: init({ password: 'mysecret' })