bip38grs
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/bip38grs package

3.1.1 • Public • Published

bip38grs

js-standard-style

A JavaScript component that adheres to the BIP38 standard to secure your crypto currency private keys. Fully compliant with Node.js and the browser (via Browserify).

Why?

BIP38GRS is a standard process to encrypt Groestlcoin private keys that is impervious to brute force attacks thus protecting the user.

Package Info

Usage

Installation

npm install --save bip38grs

Async methods

Async methods are available, but using them will be slower, but free up the event loop in intervals you choose.

For benchmark results, please see the section in the README of the scryptsy library. Increasing the interval will decrease the performance hit, but increase the span between event loop free ups (UI drawing etc.) promiseInterval is the last optional parameter after scryptParams. There is no recommendation currently, as the performance trade off is app specific.

API

encrypt(buffer, compressed, passphrase[, progressCallback, scryptParams])

var bip38 = require('bip38grs')
var wif = require('wifgrs')

var myWifString = '5KGUthnCyV7hxAp4EJ3wixaVmmBMgwj1Rps9AStA9j2DeQaihtk'
var decoded = wif.decode(myWifString)

var encryptedKey = bip38.encrypt(decoded.privateKey, decoded.compressed, 'TestingOneTwoThree')
console.log(encryptedKey)
// => '6PRJZa3mD7BM9Y2vpnPCZWoPsFgRXW79u7A3LtW6MifAnakB5bJ5pZY9oE'

decrypt(encryptedKey, passphrase[, progressCallback, scryptParams])

var bip38 = require('bip38grs')
var wif = require('wifgrs')

var encryptedKey = '6PRJZa3mD7BM9Y2vpnPCZWoPsFgRXW79u7A3LtW6MifAnakB5bJ5pZY9oE'
var decryptedKey = bip38.decrypt(encryptedKey, 'TestingOneTwoThree', function (status) {
  console.log(status.percent) // will print the percent every time current increases by 1000
})

console.log(wif.encode(0x80, decryptedKey.privateKey, decryptedKey.compressed))
// => '5KGUthnCyV7hxAp4EJ3wixaVmmBMgwj1Rps9AStA9j2DeQaihtk'

References

Package Sidebar

Install

npm i bip38grs

Weekly Downloads

13

Version

3.1.1

License

none

Unpacked Size

19.3 kB

Total Files

5

Last publish

Collaborators

  • gruve-p