Skip to content

Instantly share code, notes, and snippets.

@tinybike
Created June 12, 2018 15:19
Show Gist options
  • Save tinybike/e5602d2dc474746f427cea39c545dbd0 to your computer and use it in GitHub Desktop.
Save tinybike/e5602d2dc474746f427cea39c545dbd0 to your computer and use it in GitHub Desktop.
#!/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