[![NPM](https://nodei.co/npm/sqlite-cipher.png?downloads=true&downloadRank=true)](https://nodei.co/npm/sqlite-cipher/)
Module to handle encrypted sqlite databases ## Install To install this module open your prompt or terminal and run:
$ npm install sqlite-cipher
#Usage You can open encrypted database file or create a new also encrypted. And you can encrypt or decrypt an existent file.
Opening a encrypted database file or creating a new.
var sqlite = require('sqlite-cipher');
sqlite.connect('myEncrypedFile.myextension','MyPassword');
sqlite.run("CREATE TABLE COMPANYS(ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL);");
sqlite.insert("COMPANYS",{NAME:"My COMPANY"}, function(inserid){
console.log(inserid);
});
console.log(sqlite.run("SELECT name FROM COMPANYS;"));
Encrypting an database. In the output file you can use any extension.
var sqlite = require('sqlite-cipher');
sqlite.encrypt('myDataBase.db', 'outputFile.extension', 'MyPassword');
Decrypting an database.
var sqlite = require('sqlite-cipher');
sqlite.decrypt('outputFile.extension', 'myDecrypted.db', 'MyPassword');
This module is it´s similar to sqlite-sync.js
See more HERE
English > Create database sqlite encrypted with node.js
Português > Banco de Dados sqlite criptografado em node.js