以下函数接受用户输入密码和传入keystore的存储路径,返回私钥
var fs = require("fs"); var keythereum = require("keythereum"); function
CreateAccount(passwd, path){ var params = { keyBytes: 32, ivBytes: 16 }; var dk
= keythereum.create(params); var options = { kdf: "pbkdf2", cipher:
"aes-128-ctr", kdfparams: { c: 262144, dklen: 32, prf: "hmac-sha256" } }; var
keyObject = keythereum.dump(passwd, dk.privateKey, dk.salt, dk.iv, options);
keythereum.exportToFile(keyObject, path); return dk.privateKey.toString("hex");
关注问我技术公众号,加小问,拉您入技术交流群:


友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信