Skip to content

jal617b/sqlite-cipher.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


[![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.

connect(file, password)

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;"));
  

encrypt(from, to, password)

Encrypting an database. In the output file you can use any extension.

  
    var sqlite = require('sqlite-cipher');
    sqlite.encrypt('myDataBase.db', 'outputFile.extension', 'MyPassword');
  

decrypt(from, to, password)

Decrypting an database.

  
    var sqlite = require('sqlite-cipher');
    sqlite.decrypt('outputFile.extension', 'myDecrypted.db', 'MyPassword');
  

Using SQL

This module is it´s similar to sqlite-sync.js

See more HERE

Tutorials

English > Create database sqlite encrypted with node.js
Português > Banco de Dados sqlite criptografado em node.js

About

Module to handle encrypted sqlite databases

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%