-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
94,830 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
Module 3 Collisions/2 Tesnet - Improved/Colission.py.bak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Sun Jul 17 17:47:46 2022 | ||
|
||
@author: CY0xF | ||
""" | ||
import bit | ||
import time | ||
import binascii | ||
import random | ||
import re | ||
import secp256k1 as ice | ||
|
||
from multiprocessing import Event, Process, Queue, Value, cpu_count | ||
|
||
|
||
#============================================================================== | ||
|
||
eth_address_list = [line.split()[0].lower() for line in open("eth_address.txt",'r')] | ||
eth_address_list = set(eth_address_list) | ||
|
||
group_size = 500000 | ||
#============================================================================== | ||
|
||
def CynegeticIO_Collision(cores='all'): # pragma: no cover | ||
|
||
try: | ||
available_cores = cpu_count() | ||
|
||
if cores == 'all': | ||
cores = available_cores | ||
elif 0 < int(cores) <= available_cores: | ||
cores = int(cores) | ||
else: | ||
cores = 1 | ||
|
||
counter = Value('L') | ||
match = Event() | ||
queue = Queue() | ||
# manager = Manager() | ||
|
||
# eth_address_dict = manager.dict({line.split()[0]:k for k, line in enumerate(open("eth2021_1_22_.txt",'r'))}) | ||
|
||
workers = [] | ||
for r in range(cores): | ||
p = Process(target=generate_key_address_pairs, args=(counter, match, queue, r)) | ||
workers.append(p) | ||
p.start() | ||
|
||
for worker in workers: | ||
worker.join() | ||
|
||
except(KeyboardInterrupt, SystemExit): | ||
exit('\nSIGINT or CTRL-C detected. Exiting gracefully. BYE') | ||
|
||
|
||
private_key, address = queue.get() | ||
print('\n\nPrivate Key(hex):', hex(private_key)) | ||
wif_key = ice.btc_pvk_to_wif(private_key, False) | ||
# wif_key = bit.format.bytes_to_wif(binascii.unhexlify((hex(private_key)[2:]).zfill(64))) | ||
print('Private Key(wif): {}\n' 'ETH Address: {}'.format(wif_key, address)) | ||
|
||
#============================================================================== | ||
def generate_key_address_pairs(counter, match, queue, r): # pragma: no cover | ||
st = time.time() | ||
# k = 0 | ||
N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 | ||
key_int = random.SystemRandom().randint(1,N) | ||
|
||
P = ice.scalar_multiplication(key_int) | ||
current_pvk = key_int + 1 # because sequential increments adds G, 2G, 3G, .... | ||
|
||
print('Starting thread:', r, 'base: ',hex(key_int)) | ||
|
||
while True: | ||
try: | ||
if match.is_set(): | ||
return | ||
|
||
with counter.get_lock(): | ||
counter.value += group_size | ||
|
||
|
||
Pv = ice.point_sequential_increment(group_size, P) | ||
|
||
for t in range(group_size): | ||
this_eth = ice.pubkey_to_ETH_address(Pv[t*65:t*65+65]) | ||
if this_eth in eth_address_list: | ||
# if this_eth.startswith('0x00'): | ||
match.set() | ||
queue.put_nowait((current_pvk+t, this_eth)) | ||
return | ||
|
||
if (counter.value)%group_size == 0: | ||
print('[+] Total Keys Checked : {0} [ Speed : {1:.2f} Keys/s ] Current ETH: {2}'.format(counter.value, counter.value/(time.time() - st), this_eth)) | ||
|
||
|
||
P = Pv[-65:] | ||
current_pvk += group_size | ||
|
||
except(KeyboardInterrupt, SystemExit): | ||
break | ||
|
||
|
||
#============================================================================== | ||
|
||
|
||
if __name__ == '__main__': | ||
print('[+] Starting.........Wait.....') | ||
CynegeticIO_Collision() | ||
|
Binary file not shown.
Oops, something went wrong.