sqlite-crypto

1.1.0 • Public • Published

SQLite Crypto

Using node-sqlite3, handles SQLite databases that need to be encrypted. It comes with SQLite so there's no need to install an external library.

Install

npm install sqlite-crypto

Usage

var crypts = require('sqlite-crypto');
 
// Initialize it.
var db = crypts.init({
    file: 'Path to your .db file relative to root', // Default '/db.db'
    password: 'supersecretpassword', // Default '6yhbVFT6AlSkDjFhG'
    algorithm: 'aes-256-ctr',
    encrypt_offset: 700, //Default 700. The time in milliseconds to wait before re-encrypting the database file. Helps avoid unnecessary decrypt/encrypt in rapid succession
});
 
//Run a query and get a promises. Promise returns errors, response.
db.run({
  sql: "SOME cray SQLs",
  method: "sqlite3 methods(like all, get, etc). Default is run"
}).then(function(error, response){
  console.log(errors);
  console.log(respnse);  
});

More information

See the node-sqlite3 API documentation in the wiki. Written by Mediafly Inc.

Readme

Keywords

Package Sidebar

Install

npm i sqlite-crypto

Weekly Downloads

1

Version

1.1.0

License

ISC

Last publish

Collaborators

  • ckelsey
  • mediafly_labs