forked from Xh0st/keyspace64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyspace64.py
35 lines (30 loc) · 1.02 KB
/
keyspace64.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
# Keyspace Puzzle 64 Random
# Made by Andrei Melek
# https://github.com/xh0st/keyspace64
try:
import random
from bitcoin import *
# If required imports are unavailable, we will attempt to install them!
except ImportError:
import subprocess
subprocess.check_call(["python3", '-m', 'pip', 'install', 'bitcoin'])
while True:
low = 0x8000000000000000
high = 0xffffffffffffffff
val = str ( hex ( random.randrange( low, high ) ) )[2:]
result = val.rjust(48 + len(val), '0')
priv = result
pub = privtopub(priv)
pubkey1 = encode_pubkey(privtopub(priv), "bin_compressed")
addr = pubtoaddr(pubkey1)
n = addr
if n.startswith('16jY7qLJnxb'):
print ("found!!",addr,result)
k1 = priv
k2 = pub
k3 = addr
file = open('boom.txt', 'a')
file.write("Private key: " + k1 + '\n' + "Public key: " + k2 + '\n' + "Address: " + k3 + '\n\n')
file.close()
else:
print ("searching...",addr,result)