json-encrypt
v2.1.1
Published
Encrypt your JSON API
Downloads
73
Maintainers
Readme
Encrypt your JSON API page
HOW TO EASILY USE IT?
const je = require('json-encrypt')
To encrypt json data:
je.encrypt(json)
To decrypt json data:
je.decrypt(json_encrypted)
EXAMPLE
ENCRYPT JSON
var json = [
{
name:"Tegar Santosa",
gender:"male"
},
{
name:"Santi Puspa",
gender:"female"
},
]
console.log(je.encrypt(json))
Result:
0a979b1b4a2ff874a1e02a68e345f8bc7a8610dedd5f8d218443b94502942c93aa6656640ac79841998ee2efe41616b296cfa4b10cbf1bd891e41aaa113529f8424259792c97b2e442f7007c4bc1d68c742dc81c59b173310a7ee6bb2233a76e
DECRYPT JSON
console.log(je.decrypt(je.encrypt(json)))
OR
console.log(je.decrypt('0a979b1b4a2ff874a1e02a68e345f8bc7a8610dedd5f8d218443b94502942c93aa6656640ac79841998ee2efe41616b296cfa4b10cbf1bd891e41aaa113529f8424259792c97b2e442f7007c4bc1d68c742dc81c59b173310a7ee6bb2233a76e'))
Result:
[
{
name:"Tegar Santosa",
gender:"male"
},
{
name:"Santi Puspa",
gender:"female"
},
]