Post
Topic
Board Development & Technical Discussion
Merits 8 from 3 users
Re: Checking brainwallet
by
iceland2k14
on 07/05/2022, 17:09:31 UTC
⭐ Merited by o_e_l_e_o (4) ,ETFbitcoin (3) ,PawGo (1)
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/secp256k1

Code:
import 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}')