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?

3
  • 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
    Commented Jul 7, 2017 at 3:52
  • @Ismael the question isn't about password, but about owner recovery phrase, you usually use to recover your wallet Commented Jul 7, 2017 at 5:40
  • 1
    There is no standard seed phrase algorithm in Ethereum. You need to specify which algorithm you want (BIP39, Electrum, Brain Wallet, etc)
    – rustyx
    Commented May 2, 2018 at 8:50

1 Answer 1

-1

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

https://github.com/kvhnuke

https://www.myetherwallet.com

1
  • Can you provide some code example? Commented Jul 7, 2017 at 5:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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