Library for Encrypt payloads in Node.js, using built-in Node Native Crypto. Uses AES 256(GCM mode) cipher with simetric Cryptography.
$ npm i encrypto-object
- (Using typescript) Cryptograph payload and creating cryptogram:
import EncryptoObject from 'encrypto-object';
(async ()=>{
const cryptogram = await new EncryptoObject().setData({testing: "1234"}).serialize();
console.log(cryptogram)
// The console output will be something like: OHV6bGR0N1JNVDc4dDk0YnYwT0VlVGRxN2tqL3gxL3U3WWIrUmlScW5OVWVqZXUyMHBYeTJuUW03T3FJQ3JmNlZuWUdzWVQxemd4UUl4WWRGQ1kwSWE2ZWdUcGVCSXM9I0pNMi9aajYrUWxSRFBoNUVWUi92M1E9PSNMbTBTT1VZUmZBMWRuWGUwZE5US0ZBPT0
)();
- (Using typescript) Opening payload and creating instance:
import EncryptoObject from 'encrypto-object';
(async ()=>{
// cryptogram = OHV6bGR0N1JNVDc4dDk0YnYwT0VlVGRxN2tqL3gxL3U3WWI ...
const loader = await new CryptoObject().deserialize(cryptogram);
)();
More docs will be provided soon.
$ npm install -g jest
$ npm test
$ npm run lint
The MIT License