Hi
I am intertested in deriving my wallet address and private key from values I can remember, that way I do not need to be copying key files to different devices. Can someone please comment of on the security of my approach?
var keythereum = require("keythereum");
var password = 'this is a long password that should be memorable'; // what should be the minimum length if only alpha numeric?
var salt = '[email protected]';
var iv = ???; // can the iv be a constant? will the private key be reproducible if it dynamic? what format should it be?
var options = {
kdf: "pbkdf2",
cipher: "aes-128-ctr",
kdfparams: {
c: 262144,
dklen: 32,
prf: "hmac-sha256"
}
};
var privateKey = keythereum.deriveKey(password, salt, options);
var keyObject = keythereum.dump(password, privateKey, salt, iv, options);
keythereum.exportToFile(keyObject, '/home/username/.ethereum/keystore/');
Thanks for any and all criticism and commentary!
Comments
If this is similar to a Bitcoin "brain wallet" it's a horrible idea.
Google "bitcoin brain wallet" to see why, it's pretty well documented.
I think this idea of wallet that you can recover from memorable information is not horrible only if the implementation is secure, it seems bitcoins brain wallet was indeed very insecure.
This post describes some of the approaches and challenges around deriving keys from memorable information. It seems like if you use a salt and a configurably slow key derivation function you can expect some level of security. crypto.stackexchange.com/a/1665