JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 165
  • Score
    100M100P100Q76242F
  • License ISC

Package for encrypting JSON

Package Exports

  • json-file-encrypt

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json-file-encrypt) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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