It may look too simple/generic. But it comes very handy for such kind of curative works....
The 3 Files required for this code can be obtained from this link
https://github.com/iceland2k14/secp256k1import secp256k1 as ice
btc = [line.split()[0] for line in open("btc_address.txt",'r')]
print(f'{"-"*60}\n Read complete for Address File. ')
btc = set(btc)
passkeys = [line.split()[0] for line in open("TinyButMighty.txt",'r')]
print(f'{"-"*60}\n Read complete for Input PassWord File\n{"-"*60}')
def chk(line, k, P):
ac = ice.pubkey_to_address(0, True, P)
au = ice.pubkey_to_address(0, False, P)
a3 = ice.pubkey_to_address(1, True, P)
ab = ice.pubkey_to_address(2, True, P)
if ac in btc or au in btc or a3 in btc or ab in btc:
with open('FoundTreasure.txt', 'a') as f:
f.write(f'PassWord = {line} Privatekey = {hex(k)} \n')
m = 0
for line in passkeys:
hexkey = ice.get_sha256(bytes(line, 'utf8')).hex()
kk = int(hexkey, 16)
P = ice.scalar_multiplication(kk)
chk(line, kk, P)
m += 1
if m % 10000 == 0:
print(f' {m} Line checked from File. Current line PVK : {hexkey}', end='\r')
print(f'{" "*130}\r {m} Line checked from File. ', end='\r')
print(f'\n\n Work Done !!\n{"-"*60}')