Skip to content

cs8425/node-pogo-signature

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-pogo-signature

signature (aka "unknown6") protobuf builder + encryption for node (now in native javascript!)

includes some easy (still undocumented) signature building helper libs - will document soon

currently implemented + working in:

encrypt usage

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

simply passes input and iv through the encrypt method found in the native module. returns (or via callback for async method) the raw encrypted bytes.

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.

basic 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 crypto = require('crypto');
var pogoSignature = require('node-pogo-signature');

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

var encryptedSignature = pogoSignature.encryptSync(dump, iv);
console.log('sync output length: ', encryptedsignature.length);
console.log('sync output iv: ', encryptedsignature.slice(0, 32).toString('hex'));

// or, async w/ a callback

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 original encrypt.c goes to friends @ /r/pkmngodev (repo is gone)

About

🔓 "unknown6" signature builder + 100% pure JS encryption!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.8%
  • Protocol Buffer 1.2%