Windows generated wallet.json file with 100character password will not decrypt on debian
I generated a wallet using a 100 character password on my windows computer. I attempted to move the wallet to a debian virtual machine. JoinMarket wallet-tool.py asks for the password but no matter how i provide it, it will not accept it. I typed it manually 3 times and copy paste it many others.
I made a test wallet with a test password (small password "test") on debian, and copied it to windows. It loaded ok on windows.
I made a test wallet on windows same as above, and copied it back to debian. This one worked also.
I double checked transfer of the original wallet file with the 100 char password several times and transferred it a in binary, in ascii, and then finally just copy and paste the contents. into a file. They all produce the same result.
I made a new test wallet with a 100 character password on deb, and it worked ok on deb. When i transferred it to windows, it failed to accept the password.
It would appear there is an issue with aggressive passwords and switching the underlying os it was generated on.
There are no actual errors or log entries based on the failed password attempts that i was able to find. Steps to recreate:
- On windows: python wallet-tool.py generate.
- Provide it with a 100 character password (I used last pass to generate a password of mixed upper, lower and numeric characters only.)
- Provide the password again when prompted to confirm.
- Provide a name for the wallet file. (wallet.json from here on)
- On windows python wallet-tool.py wallet.json
- Confirm that it behaves normally.
- Copy the wallet.json to debian wallets directory.
- On Deb: python wallet-tool.py wallet.json
- Attempt to provide the password and observe the result.
- Do steps 1-9 replacing windows with debian and debian with windows for each step. (do the process in reverse, starting with debian and moving the file to windows).
Python Version on Windows: 2.7.11 Python Version on Debian: 2.7.9
Just recording my first thoughts if someone wants to pick this up (from IRC):
<waxwing> the evidence is pointing to it being a problem with btc.bin_dbl_sha256 ; a natural thing to do is check it vs hashlib.sha256().digest() with strings of length 100 <waxwing> and in particular compare the output on windows vs linux
Here are the first set of results. I hard coded two passwords into variables and passed through the hash functions and converted to hex after.
ElementaryOS btc.bin_dbl_sha256: 1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5 hashlib.sha256(hashlib.sha256().digest()).hexdigest() 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5
btc.bin_dbl_sha256: horse abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0 hashlib.sha256(hashlib.sha256().digest()).hexdigest() abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0
Debian btc.bin_dbl_sha256: 1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5 hashlib.sha256(hashlib.sha256().digest()).hexdigest() 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5
btc.bin_dbl_sha256: horse abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0 hashlib.sha256(hashlib.sha256().digest()).hexdigest() abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0
Windows btc.bin_dbl_sha256: 1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5 hashlib.sha256(hashlib.sha256().digest()).hexdigest() 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5
btc.bin_dbl_sha256: horse abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0 hashlib.sha256(hashlib.sha256().digest()).hexdigest() abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0
Next i will try input from the command line.
Round 2 with raw_input()
Debian: Long Pass1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr Short Passhorse btc.bin_dbl_sha256: 1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5 hashlib.sha256(hashlib.sha256().digest()).hexdigest() 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5
btc.bin_dbl_sha256: horse abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0 hashlib.sha256(hashlib.sha256().digest()).hexdigest() abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0
Windows:
Long Pass1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr Short Passhorse btc.bin_dbl_sha256: 1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5 hashlib.sha256(hashlib.sha256().digest()).hexdigest() 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5
btc.bin_dbl_sha256: horse abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0 hashlib.sha256(hashlib.sha256().digest()).hexdigest() abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0
round3 - using getpass
Deb: Long Pass Short Pass btc.bin_dbl_sha256: 1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr1234567890qazwsxedcr 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5 hashlib.sha256(hashlib.sha256().digest()).hexdigest() 136dde606689463733d38ae8da1aa38d050d7c45e4d0e693cabb24b7101306b5
btc.bin_dbl_sha256: horse abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0 hashlib.sha256(hashlib.sha256().digest()).hexdigest() abf7c256f7904063d634bbdcd36026b907f6256781ae15a7493e9541729f5fd0
Windows
Long Pass Short Pass btc.bin_dbl_sha256: cf29746d1b1686456123bfe8ee607bb16b3d6e9352873fd34fd7dfc5bbfb156c hashlib.sha256(hashlib.sha256().digest()).hexdigest() cf29746d1b1686456123bfe8ee607bb16b3d6e9352873fd34fd7dfc5bbfb156c
btc.bin_dbl_sha256: cf29746d1b1686456123bfe8ee607bb16b3d6e9352873fd34fd7dfc5bbfb156c hashlib.sha256(hashlib.sha256().digest()).hexdigest() cf29746d1b1686456123bfe8ee607bb16b3d6e9352873fd34fd7dfc5bbfb156c
and with this we identify the problem. getpass does not work on windows when pasting the password.
My windows wallet password appears to be null, or a CRLF character... and that is why when you type in the password it fails to match. WOW. Guess i better delete that wallet file and recover it onto the debian system. :) Some reading material. url