Work in progress! This package brings the easy-to-use encryption library libhydrogen to Node.js.
Install node-libhydrogen-binding as any other package:
npm install node-libhydrogen-binding
You can use it for encrypting and decrypting payload:
const hydrogen = require('node-libhydrogen-binding');
hydrogen.init();
const msg = "message";
const key = hydrogen.secretbox_keygen();
const msgId = 0;
const context = "testtest";
// encrypt
const ciphertext = hydrogen.secretbox_encrypt(msg, key, msgId, context);
// decrypt
const plaintext = hydrogen.secretbox_decrypt(ciphertext, key, msgId, context)
git submodule update --init
npm install --global --production windows-build-tools
(windows only)npm run build
ISC, same as libhydrogen.