Getting back a password from Polkawallet JSON File
#7
philsmd, thank you for your work on these scripts.

It looks like you wrote these scripts for a version 3 json wallet.  I'm trying to run it for a version 2 json wallet.

I first ran it on the version 3 wallet listed in your python script, and it found the password correctly.

Next, I ran it on the test version 2 wallet listed at lines 489 and 490 on this page (https://github.com/polkadot-js/common/bl...#L539-L540)

When I ran: python3 polkawallet dict.txt

I got the message: "ERROR: Scrypt N value not valid"

And, here I'm getting stuck.  The ENCODED string in a version 2 wallet appears to be longer than the ENCODED string in a version 3 wallet. 

And, in your script, here's how the value of script_n is getting populated:

scrypt_n = struct.unpack ("<I", raw_data[32:36])[0]

It appears that I need to unpack the script_n variable (and perhaps the other variables) from different positions in the ENCODED string, but I'm a bit lost.

Any chance you could update your script to work with version 2 wallets as well, or point me in the right direction?

Thanks!
Reply


Messages In This Thread
RE: Getting back a password from Polkawallet JSON File - by madbury - 03-13-2022, 11:00 PM