Skip to content

XzenTorXz/chacha8-native

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chacha8 native

Build Status

Node bindings for Chacha8 (used for the pow algorithm for cryptonight), based on https://github.com/calvinmetcalf/chacha-native, based on Chacha20 this implementation.

install

npm install chacha8-native

usage

const ChaCha8 = require('chacha8-native');

var key = new Buffer([0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
var iv = new Buffer([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
var data = new Buffer([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);

var hexCipher = new ChaCha8(key, iv).update(data).toString('hex');

console.log(hexCipher);

About

node bindings for chacha8 in c

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 44.3%
  • C++ 42.0%
  • C 11.6%
  • Python 2.1%