Created
June 12, 2018 15:19
-
-
Save tinybike/e5602d2dc474746f427cea39c545dbd0 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env node | |
var keythereum = require("keythereum"); | |
var password = "password"; | |
var params = { | |
keyBytes: 32, | |
ivBytes: 16 | |
}; | |
var options = { | |
kdf: "scrypt", | |
cipher: "aes-128-ctr", | |
kdfparams: { | |
dklen: 32, | |
n: 262144, | |
p: 1, | |
r: 8 | |
} | |
}; | |
keythereum.create(params, function (dk) { | |
keythereum.dump(password, dk.privateKey, dk.salt, dk.iv, options, function (keyObject) { | |
keythereum.exportToFile(keyObject, __dirname, function (response) { | |
console.log("successfully created new account:", response); | |
}); | |
}, function (err) { | |
console.error("error occured while creating address:", err); | |
}); | |
}, function (err) { | |
console.error("error occured while creating address:", err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment