forked from Xefrok/BitBruteForce-Wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seekanddestroy.py
90 lines (77 loc) · 2.59 KB
/
seekanddestroy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/python
'''
Change Cores=# of how many cores do you want to use (Script tested on i7-4500U 8 Cores - 5 K/s per Core. 3,456,000 Private Keys generated per day)
'''
import time
from datetime import datetime
import datetime as dt
import smtplib
import os
import multiprocessing
from multiprocessing import Pool
import os, binascii, hashlib, base58, ecdsa
def ripemd160(x):
d = hashlib.new('ripemd160')
d.update(x)
return d
r = 0
cores=6
def seek(r):
global num_threads
LOG_EVERY_N = 500
start_time = dt.datetime.today().timestamp()
i = 0
print("Core " + str(r) +": Searching Private Key..")
while True:
i=i+1
# generate private key , uncompressed WIF starts with "5"
priv_key = os.urandom(32)
fullkey = '80' + binascii.hexlify(priv_key).decode()
sha256a = hashlib.sha256(binascii.unhexlify(fullkey)).hexdigest()
sha256b = hashlib.sha256(binascii.unhexlify(sha256a)).hexdigest()
WIF = base58.b58encode(binascii.unhexlify(fullkey+sha256b[:8]))
# get public key , uncompressed address starts with "1"
sk = ecdsa.SigningKey.from_string(priv_key, curve=ecdsa.SECP256k1)
vk = sk.get_verifying_key()
publ_key = '04' + binascii.hexlify(vk.to_string()).decode()
hash160 = ripemd160(hashlib.sha256(binascii.unhexlify(publ_key)).digest()).digest()
publ_addr_a = b"\x00" + hash160
checksum = hashlib.sha256(hashlib.sha256(publ_addr_a).digest()).digest()[:4]
publ_addr_b = base58.b58encode(publ_addr_a + checksum)
priv = WIF.decode()
pub = publ_addr_b.decode()
time_diff = dt.datetime.today().timestamp() - start_time
if (i % LOG_EVERY_N) == 0:
print('Core :'+str(r)+" K/s = "+ str(i / time_diff))
#print ('Worker '+str(r)+':'+ str(i) + '.- # '+pub + ' # -------- # '+ priv+' # ')
pub = pub + '\n'
filename = 'bit.txt'
with open(filename) as f:
for line in f:
if pub in line:
msg = "\nPublic: " + str(pub) + " ---- Private: " + str(priv) + "YEI"
text = msg
server = smtplib.SMTP("smtp.gmail.com", 587)
server.ehlo()
server.starttls()
server.login("example@gmail.com", "password")
fromaddr = "example@gmail.com"
toaddr = "example@gmail.com"
server.sendmail(fromaddr, toaddr, text)
print(text)
f = open('Wallets.txt','a')
f.write(priv)
f.write(' ')
f.write(pub)
f.write('\n')
f.close()
time.sleep(30)
print ('WINNER WINNER CHICKEN DINNER!!! ---- ' +datetime.now().strftime('%Y-%m-%d %H:%M:%S'), pub, priv)
break
contador=0
if __name__ == '__main__':
jobs = []
for r in range(cores):
p = multiprocessing.Process(target=seek, args=(r,))
jobs.append(p)
p.start()