Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web3.eth.accounts.decrypt() Error #2996

Closed
BruceChar opened this issue Aug 3, 2019 · 3 comments
Closed

web3.eth.accounts.decrypt() Error #2996

BruceChar opened this issue Aug 3, 2019 · 3 comments

Comments

@BruceChar
Copy link

System: windows 10
IDE: pycharm 2018

I just create an account with web3.eth.accounts.create() with infura ropsten network.
I want to decrypt the account ,but throw an error

encrypted key with test password '123':
{ address: '0x92c9A367a26D921a98D0B6341317a7657F4E6409', privateKey: '0xea7e35ffc8d3ad3d5870657f16ee9a3421f3f9f28b2266c174061a36f62258ad', signTransaction: [Function: signTransaction], sign: [Function: sign], encrypt: [Function: encrypt] } { version: 3, id: '0d698dba-21e1-435b-a315-b3d0c155a2f9', address: '92c9a367a26d921a98d0b6341317a7657f4e6409', crypto: { ciphertext: '3abe044db6e0f7260f2df060d9161b6a6c6d0664f8a99da060dbc188bd83c933', cipherparams: { iv: '699cef44278537277dd28b98032d9e5e' }, cipher: 'aes-128-ctr', kdf: 'scrypt', kdfparams: { dklen: 32, salt: '7385c823843df73a7f92c310c638e0b1d6c224aa3911cacaa30637584b6815b9', n: 8192, r: 8, p: 1 }, mac: 'f762058d38e2e984094c85450467a89b333db2ce52e2221fc8bb63046a7ea0b9' } }

then I call decrypt function, the actual-expected result show fowlling.
But the function privateKeyToAccount is run well.

Expected behavior

Actual behavior

Steps to reproduce the behavior

Error Logs

Versions

  • web3.js: 1.2.0
  • nodejs: 10.16
  • browser: chrom
  • ethereum node: ropsten
@BruceChar
Copy link
Author

WTF? The error log didnt show. So again:

E:\Project\BlockChain\model_wallet\node_modules\web3-eth-accounts\src\index.js:327
throw new Error('Key derivation failed - possibly wrong password');
^

Error: Key derivation failed - possibly wrong password
at Accounts.decrypt (E:\Project\BlockChain\model_wallet\node_modules\web3-eth-accounts\src\index.js:327:15)
at Contract.export_from_encrypt (E:\Project\BlockChain\model_wallet\acount\w3account.js:45:29)
at Object. (E:\Project\BlockChain\model_wallet\acount\w3account.js:58:5)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

@nivida
Copy link
Contributor

nivida commented Aug 4, 2019

This got fixed with #2938 and will be released with 1.2.1

@nivida nivida closed this as completed Aug 4, 2019
@BruceChar
Copy link
Author

Thanks

This got fixed with #2938 and will be released with 1.2.1

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants