iceland2k14 / bsgs

Find PrivateKey of corresponding Pubkey(s) using BSGS algo
MIT License
111 stars 61 forks source link

Using only X for searching #14

Closed Mezantrop74 closed 3 years ago

Mezantrop74 commented 3 years ago

Hello. Why don't you use only the X coordinate for the search to save calculation time?

Mezantrop74 commented 3 years ago

For example, I'm looking like this. `# -- coding: utf-8 --

import os import random import bit from binascii import hexlify from tqdm import tqdm

start = 0x8000000000000000 end = 0x8fffffffffffffff p = 0 r = 0 pbar = tqdm(initial = p)

with open ("pubkey.txt","r") as all_keys: for line in all_keys: list = all_keys.read().split()

list = set(list)

while True: kr = random.randrange(start, end) priv = bit.Key.from_int(kr) pubk = hexlify(priv.public_key).decode()[2:] if pubk in list: print ("Hex: ",hex(kr)) f=open("WIN.txt","a") f.write(hex(kr) + "\n") f.close pbar.update(1) `

iceland2k14 commented 3 years ago

It is already using the X for searching. All X are inside the bPfile and they are filled in bloom for quick search. Y is checked only for the Final Found Key before printing it.