question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ethers Version

5.6.8

Search Terms

wallet.encrypt

Describe the Problem

when I create a keystore,I can’t import the json file with metamask, but I can load ethers.Wallet.fromEncryptedJson

Code Snippet

async function createEncryWallet(privateKey, password, provider) {
    var data = ''
    var wallet = GetAccount(privateKey, provider)
    
    function callback(progress) {
        // console.log("Encrypting: " + parseInt(progress * 100) + "% complete");
    }
    let encryptPromise = wallet.encrypt(password, callback);

    encryptPromise.then(function(json) {
        return json
    })
    return await encryptPromise
}

Contract ABI

No response

Errors

key derivation failed - possibly wrong passphrase

Environment

node.js (v12 or newer)

Environment (Other)

“secp256k1”: “^4.0.3” “keccak”: “^3.0.2”

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ricmoocommented, Aug 19, 2022

This has been updated in v5.7.0.

Try it out and let me know if you have any problems.

Thanks! 😃

2reactions
ricmoocommented, Jun 22, 2022

Thanks! Yeah, don’t worry about a PR. I’ll test and make the change. Thanks for the research though. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wallet encryption - Bitcoin Wiki
Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master...
Read more >
Securing your wallet - Bitcoin.org
Encrypting your wallet or your smartphone allows you to set a password for anyone trying to withdraw any funds. This helps protect against...
Read more >
What Is Crypto Wallet, Encryption And Private-Public Keys
As I explained in the previous article, Crypto Wallet is a piece of software which can hold account like your physical wallet hold...
Read more >
Ethereum Wallet Encryption
In the Ethereum blockchain crypto wallets are internally stored in a special encrypted format known as "UTC / JSON Wallet (Keystore File)" or...
Read more >
Wallet encryption - BitcoinWiki
Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found