Skip to content

"unknown6" bindings for node (repo previously titled node-pogo-u6)

Notifications You must be signed in to change notification settings

ProLoDs/node-pogo-signature

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-pogo-signature

signature (aka "unknown6") encryption bindings for node

todo

  • look into native js implementation of encrypt.c
  • start writing signature builder (in progress)
  • submit PRs to node apis with signature patches

may include some signature building utils soon

install

on npm install the module will self-build. the c/c++ code is located within the /src directory.

you may require the node-gyp package installed globally to build:

npm install node-gyp -g

usage

module.encrypt(<Buffer> input, <Buffer> iv, <function> callback)
Info:

simply passes input and iv through the encrypt method found in the native module.

the callback's err is truthy when input validation occurs (note: iv must be 32 bytes long)

Arguments:
  • input (Buffer): a protobuf-encoded signature message to encrypt
  • initVector (Buffer): a 32-byte random initialization vector to encrypt the data against
  • cb(err, encryptedSignature) (Func): a callback function to execute when encryption by the moldue has been completed. success when err is null. encryptedSignature is a buffer containing the encrypted information.

example

the following will read an input buffer read directly from a file, in the real world this will most likely come from an encoded protobuf structure you generated with your api requests.

var pogoSignature = require('node-pogo-signature');

var dump = fs.readFileSync('./signatureBinary.bin');
var iv = crypto.randomBytes(32);


pogoSignature.encrypt(dump, iv, function(err, result) {
	if (err) return console.error(err);

	console.log('output length: ', result.length)
    console.log('output iv: ', result.slice(0, 32).toString('hex'));
});

notes

  • contribute whatever you can
  • credit for encrypt.c goes to friends @ /r/pkmngodev (repo is gone)

About

"unknown6" bindings for node (repo previously titled node-pogo-u6)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.8%
  • Other 1.2%