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

How to overcome 'salt must be a byte string error'? #9

Open
Rust64 opened this issue Aug 26, 2020 · 1 comment
Open

How to overcome 'salt must be a byte string error'? #9

Rust64 opened this issue Aug 26, 2020 · 1 comment

Comments

@Rust64
Copy link

Rust64 commented Aug 26, 2020

Good `morning,

I'm trying to recover my Multibit HD seed words using decrypt_bitcoinj_seed.py I don't know if anyone has used decrypt_bitcoinj_seed.py or not but I'm getting an error after it runs another python script in its arsenal called common.py with an error: raise TypeError('salt must be a byte string')

There are many opportunities for errors to be thrown in this python script, so if this one is overcome there could be others to follow. (Please see code at the bottom.) The code below shows the salt error.

C:\Python38\decrypt_bitcoinj_seed-master>py decrypt_bitcoinj_seed.py Traceback (most recent call last): File "decrypt_bitcoinj_seed.py", line 319, in <module> wallet = load_wallet(wallet_file, get_password) File "decrypt_bitcoinj_seed.py", line 132, in load_wallet key = pylibscrypt.scrypt(password.encode('utf_16_be'), salt, olen=32) File "C:\Python38\lib\site-packages\pylibscrypt\hashlibscrypt.py", line 49, in scrypt check_args(password, salt, N, r, p, olen) File "C:\Python38\lib\site-packages\pylibscrypt\common.py", line 49, in check_args raise TypeError('salt must be a byte string') TypeError: salt must be a byte string

Does anyone know how the salt would be edited so it becomes a byte string or is there a better alternative? Also, not that it matters since I have very little programming knowledge, why does the script need all the following to crack the seed words? - password, salt, N, r, p, olen The good news is the "check args" password script part passed. Here's the code I mentioned earlier about all the possibilities for errors to be thrown:

if not isinstance(password, bytes): raise TypeError('password must be a byte string') if not isinstance(salt, bytes): raise TypeError('salt must be a byte string') if not isinstance(N, numbers.Integral): raise TypeError('N must be an integer') if not isinstance(r, numbers.Integral): raise TypeError('r must be an integer') if not isinstance(p, numbers.Integral): raise TypeError('p must be an integer') if not isinstance(olen, numbers.Integral): raise TypeError('length must be an integer') if N > 2**63: raise ValueError('N cannot be larger than 2**63') if (N & (N - 1)) or N < 2: raise ValueError('N must be a power of two larger than 1') if r <= 0: raise ValueError('r must be positive') if p <= 0: raise ValueError('p must be positive') if r * p >= 2**30: raise ValueError('r * p must be less than 2 ** 30') if olen <= 0: raise ValueError('length must be positive')

If other errors arise, I will post them here; but I'm hoping it will just work and return my seed words!

@adangert
Copy link

adangert commented Aug 1, 2022

Run with Python2.7 and this should not be an error. I made a new issue

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