Created
May 8, 2017 14:43
-
-
Save bitgord/9352ecb74f9ea3375254589546f01466 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`"use strict"` | |
const keythereum = require('keythereum') | |
const c = console | |
// private key from bitcoin | |
let privateKey = "10f2fb3aaac742b2f6c2a0a830d5330846633c8a139696cca2c0e379944f62b2" | |
let password = "bla" | |
// --- | |
let options = { | |
kdf: "pbkdf2", | |
cipher: "aes-128-ctr", | |
kdfparams: { | |
c: 262144, | |
dklen: 32, | |
prf: "hmac-sha256" | |
} | |
} | |
var dk = keythereum.create() // creates a sample key | |
dk.privateKey = new Buffer(privateKey) | |
let keyObject = keythereum.dump(password, dk.privateKey, dk.salt, dk.iv, options) | |
c.log(keyObject) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment