forked from Qalander/KeyHunt-Cuda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pubkeys_to_xpoint.py
36 lines (30 loc) · 1006 Bytes
/
pubkeys_to_xpoint.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
import sys
def pubkeys_to_xpoint(filein, fileout):
with open(filein) as inf, open(fileout, 'wb') as outf:
count = 0
skip = 0
for x in inf.readlines():
x = x.strip()
if len(x) != 64:
if len(x) == 66:
x = x[2:]
elif len(x) == 130:
x = x[2:66]
else:
skip += 1
print("skipped pubkey:", x)
continue
try:
outf.write(bytes.fromhex(x))
count += 1
except:
skip += 1
print("skipped pubkey:", x)
print('processed :', count, 'pubkeys', '\nskipped :', skip, 'pubkeys', )
argc = len(sys.argv)
argv = sys.argv
if argc == 1 or argc != 3:
print('Usage:')
print('\tpython3 ' + argv[0].replace('\\', '/').split('/')[-1] + ' pubkeys_in.txt xpoints_out.bin')
elif argc == 3:
pubkeys_to_xpoint(argv[1], argv[2])