Bu bulmaca ile uğraşırken telegramdan bir arkadaş sağolsun şu kodu verdi, blmacalarda vs. iş görür.
import binascii, hashlib, base58, string
from bitcointools import *
from itertools import permutations, combinations
def priv2addr(priv):
pub = privtopub(priv)
addr = pubtoaddr(pub)
return (addr)
def padhex(s):
return s[2:].rstrip('L').zfill(64)
def test_num(bigno):
hex_private_key = padhex(hex(bigno))
extended_key = "80"+hex_private_key.strip()
first_sha256 = hashlib.sha256(binascii.unhexlify(extended_key)).hexdigest()
second_sha256 = hashlib.sha256(binascii.unhexlify(first_sha256)).hexdigest()
final_key = extended_key+second_sha256[:8]
WIF = base58.b58encode(binascii.unhexlify(final_key)).decode()
found_address = priv2addr(WIF)
if (found_address == goal_address):
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print ("Number: " + str(bigno) + "\nKey: " + WIF + "\nWallet: " + found_address)
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
quit()
print ("Number: " + str(bigno) + "\nKey: " + WIF + "\nWallet: " + found_address)
goal_address = "Hedef address";
listofnumbers = [
102334452563515914899878097957496696762772407663,
452561023343515914899878097957496696762772407663,
351591023344525614899878097957496696762772407663,
102334351594525614899878097957496696762772407663,
]
for number in listofnumbers:
test_num(number)
print("\n\nDONE!!!");