PIVX-Project / PIVX

Protected Instant Verified Transactions - Core wallet.
https://www.pivx.org
MIT License
528 stars 715 forks source link

BIP38 functionality broken #188

Closed pigfrown closed 7 years ago

pigfrown commented 7 years ago

If so, please list the steps to reproduce below:

  1. encrypt a wallet using pivx-cli bip38encrypt $WALLETADDRESS "password"
  2. Save returned encrypted key $CRYPTKEY
  3. decrypt encrypted key using pivx-cli bip38decrypt $CRYPTKEY "password"

Expected behavior

bip38decrypt should return the decrypted private key for the wallet

Actual behavior

bip38decrypt fails to decrypt

What version of PIVX Core are you using?

commit tagged v2.2.1

Machine specs:

The encrypted key passed to BIP38_Decrypt (in bip38.cpp) is not encoded correctly (it fails the encoding check around line 125)

presstab commented 7 years ago

Does your password contain any characters that are not included here?

QString specialChar = "\"@!#$%&'()*+,-./:;<=>?`{|}~^_[]\\";
QString validChar = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + specialChar;

The rpc version does not have the character catcher like the QT version does.

pigfrown commented 7 years ago

I literally used the password "password".

Can you not reproduce this on your setup? I would be happy to provide logs if not.

presstab commented 7 years ago

I think you did the decrypt command parameters out of order. It should be bip38decrypt password key

pigfrown commented 7 years ago

thanks, that fixed it!