Skip to content

trampi/node-libhydrogen-binding

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

EXPERIMENTAL: node-libhydrogen-binding

Build Status

libhydrogen native bindings for Node.js

Work in progress! This package brings the easy-to-use encryption library libhydrogen to Node.js.

Usage example

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)

API Documentation

Check the wiki

Building

  • git submodule update --init
  • npm install --global --production windows-build-tools (windows only)
  • npm run build

License

ISC, same as libhydrogen.

About

A lightweight, secure, easy-to-use crypto library suitable for constrained environments.

Resources

License

Stars

Watchers

Forks

Packages

No packages published