1

I've generated keystore file by means of keythereum

function generateAddress(cb) {
  var params = { keyBytes: 32, ivBytes: 16 };

  var dk = keythereum.create(params);

  keythereum.create(params, function (dk) {
    var options = {};
    var password = generatePassword();
    keythereum.dump(password, dk.privateKey, dk.salt, dk.iv, options, 
      function (keyObject) {
        cb(keyObject, password);
      }
    );
  });
}

function generatePassword() {
    var length = 8,
        charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
    retVal = "";
    for (var i = 0, n = charset.length; i < length; ++i) {
        retVal += charset.charAt(Math.floor(Math.random() * n));
    }
    return retVal;
}

How to programmatically extract recovery phrase from generated keystore file or get it during the process of generation?

  • The password is not stored in the keystore file, it is only used to derive an encryption key to encrypt the private key. Look at the source of the dump function at github.com/ethereumjs/keythereum/blob/…. – Ismael Jul 7 '17 at 3:52
  • @Ismael the question isn't about password, but about owner recovery phrase, you usually use to recover your wallet – Viktor Baranov Jul 7 '17 at 5:40
  • There is no standard seed phrase algorithm in Ethereum. You need to specify which algorithm you want (BIP39, Electrum, Brain Wallet, etc) – rustyx May 2 '18 at 8:50
-1

MyEtherWallet has the functionality you're looking for. It's open source at:

https://github.com/kvhnuke

https://www.myetherwallet.com

  • Can you provide some code example? – Viktor Baranov Jul 7 '17 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.