Bitcoin Forum
June 22, 2024, 03:39:37 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to overcome 'salt must be a byte string error'?  (Read 132 times)
Multihd (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
August 26, 2020, 01:17:49 PM
Merited by vapourminer (1)
 #1

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 is 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!
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
August 30, 2020, 10:22:08 AM
Merited by vapourminer (1)
 #2

What argument are you calling it with?
Do you provide the salt? If yes, how do you do that?


Does anyone know how the salt would be edited so it becomes a byte string
Use:
Code:
b'ThisIsABinaryString'


Providing the source coude would make it easier for us tho.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 01, 2020, 01:13:01 AM
 #3

C:\Python38\decrypt_bitcoinj_seed-master>py decrypt_bitcoinj_seed.py
Don't use Python3... I believe that "decrypt_bitcoinj_seed" will only work with Python 2...

As per the install instructions on github:
Python 2.7 – visit the download page here: https://www.python.org/downloads/windows/, and click the link for the latest Python 2 release

Unfortunately, there are quite a few differences between Python2.7 and Python3 that "broke" a LOT of things... so there are numerous old scripts that just don't play nicely with Python3. Undecided

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!