json-enc-dec
v0.0.1
Published
A simple JSON data encryption data designed to avoid others to get your datas.
Downloads
19
Maintainers
Readme
Encrypted JSON Data
MPOP Reverse II
This program is inspired by Bson, which is also encrypts json data for MongoDB. But in this program, you may only use json file or json object to encrypt.
How to install (NodeJS):
npm i json-enc-dec@latest
How to encrypt (NodeJS): .encrypt(jsonData, isFile)
const fs = require("fs")
const json = require("json-enc-dec")
// Non-file
console.log(json.encrypt({
"sample": "Hello World"
}, false))
// Using file
let file = fs.readFileSync("sample.json", "utf8")
console.log(json.encrypt(file, false))
Output:
691f61525e5h5d561f311f3f565d5d5g1d4b5g605d551f6b
How to decrypt (NodeJS): .decrypt(encryptedData)
const json = require("json-enc-dec")
console.log(json.decrypt("691f61525e5h5d561f311f3f565d5d5g1d4b5g605d551f6b))
Output:
{ sample: 'Hello World' }
This output is already in json objest, so that you may call it like:
const json = require("json-enc-dec")
console.log(json.decrypt("691f61525e5h5d561f311f3f565d5d5g1d4b5g605d551f6b).sample)
Output:
Hello World
Credits to the main idea of this program.
Credits also to the following
- BSON
- Salvador
- John Jeremy Antiguo
- Earl Shine Sawir
- John Paul Caigas
- Lester Navarra
- Mark Kevin Manalo
- John Roy Lapida Calimlim
- Mart Anthony Salazar
Note : I give credits not just for those who help me for this project, but also to those who help me to my entire journey in making this kind of project.