json-file-encrypt

2.1.2 • Public • Published

json-file-encrypt 2

json-file-encrypt is a node.js module for encrypting json files, with minimal effort. It uses sha256 and AES 256.

Usage

Require the module:

const jfe = require("json-file-encrypt");

Note: Decryption functions will return false if the key is incorrect / the decryption failed.

Class based usage

//create Instance with "test Key" as the key
let key1 = new jfe.encryptor ("test Key");
 
//Encrypt a string:
let encrypted = key1.encrypt("some string"); //returns encrypted string
 
//Decrypt an encrypted string
let data = key1.decrypt(encrypted);

Direct usage

//encrypt a string
let encrypted = jfe.encrypt("key", "string data");
 
//decrypt a encrypted string
let original = jfe.decrypt("key", encrypted);

Readme

Keywords

none

Package Sidebar

Install

npm i json-file-encrypt

Weekly Downloads

417

Version

2.1.2

License

ISC

Unpacked Size

2.84 kB

Total Files

3

Last publish

Collaborators

  • 0x81