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

Wallet Details sometimes claims that a correct BIP38 passphrase is incorrect #48

Closed
andershjort opened this issue Dec 17, 2013 · 7 comments

Comments

@andershjort
Copy link

If I generate paper wallets with a BIP38 passphrase, for instance this one:

!"#€%&/()=?!"#€%&/()=?

.. and then copy / paste the encrypted private key to "Wallet details" and enter the same passphrase, sometimes I get "Incorrect passphrase for this encrypted private key", other times it just works. I cannot see a pattern for when it works or doesn't. It can give the error one time and then work fine right afterwards without me changing the input fields.

I can only reproduce this on OSX 10.8.5 / Safari 6.0.5 on my couple year old MacBook Air, have tried on two other OSX-configurations which both seemed fine, but since the error is periodical, I can not be sure it is related to this specific configuration.

I am guessing it is some kind of overflow / memory crash, that is not handled properly...?

I am using an offline copy of v.2.6.6

@cantonbecker
Copy link

On Dec 17, 2013, at 12:44 PM, andershjort wrote:

.. and then copy / paste the encrypted private key to "Wallet details" and enter the same passphrase, sometimes I get "Incorrect passphrase for this encrypted private key", other times it just works.

Hmm, is there any chance it has to do with the copy/paste clipboard, e.g. whether or not there's any whitespace captured during the copy (leading space, trailing space, or carriage return?)

When you said this was possibly intermittent and OS/browser related, this reminded me of how different OS/browsers handle copy/paste differently, especially when doing something like double-click to highlight entire phrase then copy/paste

I would be interested if you're ever able to replicate this problem by typing in the password during both encoding and decoding.


Canton Becker
canton@gmail.com • (505) 570-0635 • http://cantonbecker.com

@andershjort
Copy link
Author

I don't think it has to do with copy/paste. I have also entered the encrypted private key by hand a couple of times with the same result: Sometimes the decoding fails, sometimes it works for the same passphrase. And also sometimes it goes from fail to success or back without me touching the text input fields, only pressing "Decrypt BIP38" again.

@andershjort
Copy link
Author

Seems like it could be related to this:
cantonbecker#6 (comment)

@cantonbecker
Copy link

andershjort, since you said, "I can only reproduce this on OSX 10.8.5 / Safari 6.0.5 on my couple year old MacBook Air" I think this is highly likely. So far this is looking like something specifically related to 6.0.5. 6.1 doesn't produce the same problem.

That said, if you can come up with a particular test case that consistently produces the problem, that would be a great help. I'm pretty sure that you could hone down the particular problem so that it doesn't seem erratic/random. This is math after all, so it should be possible to come up with some test scenarios that fail 100% of the time. :)

@cantonbecker
Copy link

andershjort, I'm wrong. It is intermittent, with no discernible pattern.

Yup, you're on to something. It's intermittent for sure.

Using browser: OS X 10.7.5 / Safari 6.0.5 (7536.30.1)

Here are eight passes, encrypting the identical key with the identical password. The "6P...9q" is incorrect. The "6P..XA" is correct, what other browsers like Chrome and FF consistently come up with.

Pass 1: 6PRNXA7M57uqSYXX2TXHkfNJEVMiWarkPkqUv3AsZa5r41u3VpXHLkUD9q
Pass 2: 6PRNXA7M4qEppBJCHM2SEizfna7XTomzXwdCBrEG6Mjo3nU6iziS6vWWXA
Pass 3: 6PRNXA7M57uqSYXX2TXHkfNJEVMiWarkPkqUv3AsZa5r41u3VpXHLkUD9q
Pass 4: 6PRNXA7M4qEppBJCHM2SEizfna7XTomzXwdCBrEG6Mjo3nU6iziS6vWWXA
Pass 5: 6PRNXA7M4qEppBJCHM2SEizfna7XTomzXwdCBrEG6Mjo3nU6iziS6vWWXA
Pass 6: 6PRNXA7M57uqSYXX2TXHkfNJEVMiWarkPkqUv3AsZa5r41u3VpXHLkUD9q
Pass 7: 6PRNXA7M57uqSYXX2TXHkfNJEVMiWarkPkqUv3AsZa5r41u3VpXHLkUD9q
Pass 8: 6PRNXA7M4qEppBJCHM2SEizfna7XTomzXwdCBrEG6Mjo3nU6iziS6vWWXA

@artiomchi
Copy link

Ok, got some further progress on it. I've narrowed it down to the scrypt library, and managed to replicate it with minimal code.

Since no other library is required to replicate the test, I've opened an issue in the scrypt-js project, where we can follow-up, and hopefully find a fix.

cheongwy/node-scrypt-js#2

@pointbiz
Copy link
Owner

Duplicate of #56

FuzzyBearBTC added a commit to peercoin/bitaddress.ppc that referenced this issue Mar 12, 2015
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

4 participants