albertobsd / keyhunt

privkey hunt for crypto currencies that use secp256k1 elliptic curve
MIT License
678 stars 407 forks source link

There is no valid data in the file/rmd file #194

Closed bane77111 closed 1 year ago

bane77111 commented 1 year ago

So i try to use rmd160 mode and using this script to covert addresses to .rmd :

import codecs
import sys

import base58

def addresses_to_hash160(filein):
    fileout = 'hash160_out.rmd'
    with open(filein) as inf, open(fileout, 'w') as outf:
        count = 0
        skip = 0
        for address in inf.readlines():
            address = address.strip()
            try:
                hash160 = base58.b58decode_check(address)  #
                hash160 = codecs.encode(hash160, 'hex').decode()[2:]
                outf.write(hash160)
                count += 1
            except:
                skip += 1
                print("skipped address:", address)

        print('processed :', count, 'addresses', '\nskipped   :', skip, 'addresses', )

argc = len(sys.argv)
argv = sys.argv

if argc == 1 or argc != 3:
    print('Usage:')
    print('\tpython3 ' + argv[0].replace('\\', '/').split('/')[-1] + ' addresses_in.txt hash160_out.txt')
elif argc == 3:
    addresses_to_hash160(argv[1])

But i get an error: There is no valid data in the file/rmd file

Is there any other way/script to covert addresses to rmd160?

Thanks in advance!

MisterTeo commented 1 year ago

Try:

https://github.com/Qalander/KeyHunt-Cuda/blob/main/addresses_to_hash160.py

bane77111 commented 1 year ago

Try:

https://github.com/Qalander/KeyHunt-Cuda/blob/main/addresses_to_hash160.py

But this gives you .bin file i dont think it will work

albertobsd commented 1 year ago

RMD160 hashes are 20 bytes, in hex this is 40 hexadecimal characters.

You are sending :2 to the file but this also include the checksum bytes.

You need to skipt also the last 4 bytes or 8 hexadecimal characters.