Pages:
Author

Topic: Pollard's kangaroo ECDLP solver - page 41. (Read 60095 times)

member
Activity: 348
Merit: 34
August 30, 2021, 08:23:39 AM
guys lets say 32 divisors will return 32 keys , one of will be guaranteed for lower range but what about other all keys , i guess they all are also valid ~~ so my question is all other keys are random in 256 range or what?
No random
Pure calculated area in n order
Let me give you examples in details
jr. member
Activity: 48
Merit: 11
August 30, 2021, 08:18:38 AM
guys lets say 32 divisors will return 32 keys , one of will be guaranteed for lower range but what about other all keys , i guess they all are also valid ~~ so my question is all other keys are random in 256 range or what?
all keys are valid but are in the other 31 ranges. The difficulty is that we do not know where which key is located, so we are looking for all 32 keys in our range.
jr. member
Activity: 81
Merit: 2
August 30, 2021, 07:28:52 AM
guys lets say 32 divisors will return 32 keys , one of will be guaranteed for lower range but what about other all keys , i guess they all are also valid ~~ so my question is all other keys are random in 256 range or what?
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
August 30, 2021, 05:51:34 AM
Please remind me of the link to the script that allows you to convert the saved [Suspicious link removed]) so that you can see the kangaroo's  data in a readable form ?

Thank you very mach
https://gist.github.com/PatatasFritas/a0409df4306fb1bb81f9a53e70151ddc
This script?


Yes, Thank you very mach !!!
jr. member
Activity: 48
Merit: 11
August 30, 2021, 05:14:50 AM
Please remind me of the link to the script that allows you to convert the saved [Suspicious link removed]) so that you can see the kangaroo's  data in a readable form ?

Thank you very mach
https://gist.github.com/PatatasFritas/a0409df4306fb1bb81f9a53e70151ddc
This script?
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
August 28, 2021, 08:19:27 PM
Please remind me of the link to the script that allows you to convert the saved files(.ws) so that you can see the kangaroo's  data in a readable form ?

Thank you very mach
jr. member
Activity: 37
Merit: 1
August 28, 2021, 04:22:31 PM
Thank you for this great explanation!
How does this "Kangaroo program actually finds the private key from only the public key? isn't that impossible?
full member
Activity: 1232
Merit: 242
Shooters Shoot...
August 27, 2021, 10:37:16 AM
Hey guys can anyone help me? i'm noob to all this.


Start:10000000000000000
Stop :1FFFFFFFFFFFFFFFF
Range width: 2^64
DP size: 15 [0xFFFE000000000000]
[20.33 MK/s][GPU 0.00 MK/s][Count 2^33.38][Dead 1][10:02 (Avg 07:25)][12.4/37.8MB]
Key# 0 [1S]Pub:  0x0230210C23B1A047BC9BDBB13448E67DEDDC108946DE6DE639BCC75D47C0216B1B
       Priv: 0x1A838B13505B26867
Done: Total time 10:02
 / / / /
i got this small private key part (1A838B13505B26867) what is this exaclty? does this belongs to the public key i put in my work file?
another question also, does the private key starts with that 1A838B13505B26867. . . . or they mean it end at . . ..1A838B13505B26867 ?
Thank you guys for help.
Ok.
The Priv: 0x1A838B13505B26867 is the actual entire private key. You could also look at it as:
000000000000000000000000000000000000000000000001A838B13505B26867

and it is the private key of Pub:  0x0230210C23B1A047BC9BDBB13448E67DEDDC108946DE6DE639BCC75D47C0216B1B

Look at the start and stop range in your search:
Start:10000000000000000
Stop :1FFFFFFFFFFFFFFFF
and now the priv key:
priv  :1A838B13505B26867

So everything matches up. You searched in a range and found a private key in that range, by using the private key's pub address.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
August 27, 2021, 09:59:20 AM
i got this small private key part (1A838B13505B26867) what is this exaclty? does this belongs to the public key i put in my work file?
another question also, does the private key starts with that 1A838B13505B26867. . . . or they mean it end at . . ..1A838B13505B26867 ?
Thank you guys for help.

Exactly where in the private key is the fragment "1A838B13505B26867" located in?

You can only input beginning parts of public (edit: after re-reading the README it is actually supposed to be private) keys inside the Kangaroo input file, there is no way to search based on private key parts.
jr. member
Activity: 37
Merit: 1
August 27, 2021, 07:57:27 AM
Hey guys can anyone help me? i'm noob to all this.


Start:10000000000000000
Stop :1FFFFFFFFFFFFFFFF
Range width: 2^64
DP size: 15 [0xFFFE000000000000]
[20.33 MK/s][GPU 0.00 MK/s][Count 2^33.38][Dead 1][10:02 (Avg 07:25)][12.4/37.8MB]
Key# 0 [1S]Pub:  0x0230210C23B1A047BC9BDBB13448E67DEDDC108946DE6DE639BCC75D47C0216B1B
       Priv: 0x1A838B13505B26867
Done: Total time 10:02
 / / / /
i got this small private key part (1A838B13505B26867) what is this exaclty? does this belongs to the public key i put in my work file?
another question also, does the private key starts with that 1A838B13505B26867. . . . or they mean it end at . . ..1A838B13505B26867 ?
Thank you guys for help.
jr. member
Activity: 81
Merit: 2
August 16, 2021, 08:48:01 AM
compress to uncompress
Code:
import binascii

p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F

def decompress_pubkey(pk):
    x = int.from_bytes(pk[1:33], byteorder='big')
    y_sq = (pow(x, 3, p) + 7) % p
    y = pow(y_sq, (p + 1) // 4, p)
    if y % 2 != pk[0] % 2:
        y = p - y
    y = y.to_bytes(32, byteorder='big')
    return b'\x04' + pk[1:33] + y

with open('add.txt') as f:
  for line in f:
    line=line.strip()
    print(binascii.hexlify(decompress_pubkey(binascii.unhexlify(line))).decode(),file=open("uncomp.txt", "a"))

uncompress to compress

Code:
def cpub(x,y):
 prefix = '02' if y % 2 == 0 else '03'
 c = prefix+ hex(x)[2:].zfill(64)
 return c
with open('add.txt') as f:
  for line in f:
    line=line.strip()
    x = int(line[2:66], 16)
    y = int(line[66:], 16)
    pub04=cpub(x,y)

    print(pub04,file=open("comp.txt", "a"))




cool , will try it today
member
Activity: 348
Merit: 34
August 15, 2021, 06:13:49 AM
compress to uncompress
Code:
import binascii

p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F

def decompress_pubkey(pk):
    x = int.from_bytes(pk[1:33], byteorder='big')
    y_sq = (pow(x, 3, p) + 7) % p
    y = pow(y_sq, (p + 1) // 4, p)
    if y % 2 != pk[0] % 2:
        y = p - y
    y = y.to_bytes(32, byteorder='big')
    return b'\x04' + pk[1:33] + y

with open('add.txt') as f:
  for line in f:
    line=line.strip()
    print(binascii.hexlify(decompress_pubkey(binascii.unhexlify(line))).decode(),file=open("uncomp.txt", "a"))

uncompress to compress

Code:
def cpub(x,y):
 prefix = '02' if y % 2 == 0 else '03'
 c = prefix+ hex(x)[2:].zfill(64)
 return c
with open('add.txt') as f:
  for line in f:
    line=line.strip()
    x = int(line[2:66], 16)
    y = int(line[66:], 16)
    pub04=cpub(x,y)

    print(pub04,file=open("comp.txt", "a"))

jr. member
Activity: 40
Merit: 7
August 13, 2021, 11:15:00 PM
i have a script to convert compressed keys to uncompressed

Code:
import binascii

p_hex = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F'
p = int(p_hex, 16)
compressed_key_hex = '0250863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B2352'
x_hex = compressed_key_hex[2:66]
x = int(x_hex, 16)
prefix = compressed_key_hex[0:2]

y_square = (pow(x, 3, p)  + 7) % p
y_square_square_root = pow(y_square, (p+1)/4, p)
if (prefix == "02" and y_square_square_root & 1) or (prefix == "03" and not y_square_square_root & 1):
    y = (-y_square_square_root) % p
else:
    y = y_square_square_root

computed_y_hex = format(y, '064x')
computed_uncompressed_key = "04" + x_hex + computed_y_hex

print computed_uncompressed_key

 but i need script where i can convert uncompressed keys to compressed

i guess that will be pretty simple to make as we need to take x value and add 02 or 03 in front of x. right?

but need working code where i can upload file of uncompressed keys and get all compressed keys :p

edit:

i wrote these code to convert uncompressed to compress but output file is blank.

Code:
from fastecdsa import curve
from fastecdsa.point import Point
import bit

G = curve.secp256k1.G
N = curve.secp256k1.q

def pub2point(line, file):
    x = int(line[2:66], 16)
    if len(line) < 70:
        y = bit.format.x_to_y(x, int(line[:2], 16) % 2)
    else:
        y = int(line[66:], 16)
    return Point(x, y, curve=curve.secp256k1)
    if (y % 2 == 0):
        prefix = "02"
    else:
        prefix = "03"
        hx = hex(x)[2:].zfill(64)
        hy = hex(y)[2:].zfill(64)
        file.write(prefix+hx+"\n") # Writes compressed key to file    
    

    
with open("1.txt", "r") as f, open("output.txt", "w") as outf:
    line = f.readline().strip()
    while line != '':
          pub2point(line, outf)
          line = f.readline().strip()

i guess something is missing or i am doing it wrong
full member
Activity: 706
Merit: 111
August 13, 2021, 06:08:58 PM
What are the requirements for using this, I'm using python 3 on windows and still getting errors.

Did you install fastecdsa and bit modules from PyPI first?  Huh

I finally got it to work for me, you're code, this one https://gist.github.com/ZenulAbidin/286a652b160086b3b0f184a886ba68ca
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
August 11, 2021, 03:18:14 AM
can some one explain x = (i * G)

so if G  = X: 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
               Y: 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8

and i    = 11B

how we will calculate x? , i was unable to understand how can we do 2 lines hex G multiplication.

Basically, first you factor i in powers of two like this:

i = 11b = 3 (decimal) = 2 + 1

Then you calculate G, 2G, 4G etc using repeated point doubling and store the results (see https://en.bitcoin.it/wiki/Elliptic_curve_cryptography for the algorithm as well as the one for point addition), then you use point addition add these results depending on the factors of i above.
jr. member
Activity: 81
Merit: 2
August 10, 2021, 11:57:27 PM
can some one explain x = (i * G)

so if G  = X: 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
               Y: 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8

and i    = 11B

how we will calculate x? , i was unable to understand how can we do 2 lines hex G multiplication.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
August 10, 2021, 05:21:05 AM
~snip

You should put both with statements on a single line so you can read them both at the same time:

Code:
#begin copy from my scipt
from fastecdsa import curve
from fastecdsa.point import Point
import bit

G = curve.secp256k1.G
N = curve.secp256k1.q

def pub2point(pub_hex):
    x = int(pub_hex[2:66], 16)
    if len(pub_hex) < 70:
        y = bit.format.x_to_y(x, int(pub_hex[:2], 16) % 2)
    else:
        y = int(pub_hex[66:], 16)
    return Point(x, y, curve=curve.secp256k1)


def point2pub(R):
    if (R.y % 2 == 0):
        prefix = "02"
    else:
        prefix = "03"
    hx = hex(R.x)[2:].zfill(64)
    return hx

#end copy

def sub(hex1, hex2):
    P = pub2point(hex1)
    Q = pub2point(hex2)
    R = P - Q
    return R

with open("file1.txt", "r") as f1, open("file2.txt", "r") as f2:
    line1 = f1.readline().strip()
    line2 = f2.readline().strip()
    while line1 != '' and line2 != '':
          print(point2pub(sub(line1, line2)))
          line1 = f1.readline().strip()
          line2 = f2.readline().strip()    
    


Make sure you check the indenting, especially if you are pasting this to console since it will choke the interpreter.
jr. member
Activity: 81
Merit: 2
August 10, 2021, 12:48:52 AM
i managed to make this script to do the job but this one only doing subtraction for line 1 of file1 and line 1 of file2 , not doing subtraction for all lines .

maybe need to fix the code

Code:
with open("file1.txt", "r") as f1:
    line1 = f1.readline().strip()

         
def key1(line1):
    x = int(line1, 16)
    return (x)
     
     

with open("file2.txt", "r") as f2:
    line2 = f2.readline().strip()

   
def key2(line2):
    y = int(line2, 16)
    return (y)
   
def add(f1, f2):
    P = key1(line1)
    Q = key2(line2)
    R = P - Q
    hx = hex(R).zfill(64)
    print(hx+"\n")
   

add(f1, f2)
jr. member
Activity: 81
Merit: 2
August 09, 2021, 10:01:48 PM
need help in python

i have 2 files and each file have 32 lines hex values
so i want to

subtract line 1 of "file1.txt" with line 1 of "file2"
subtract line 2 of "file1.txt" with line 2 of "file2"

vice versa and print  output.
i am using code like this but don't know what i am doing wrong



Code:
with open("file1.txt", "r") as f:
    line = f.readline().strip()
    while line != '':
          hex1 = f.readline().strip()

with open("file2.txt", "r") as f:
    line = f.readline().strip()
    while line != '':
          hex2 = f.readline().strip()
   
   
def add(file1.txt, file2.txt):
    P = (hex1)
    Q = (hex2)
    R = hex(P - Q)
    hx = hex(R).zfill(64)
    print(hx)
   


i am not sure but surely @NotATether is hero here , he will help you out
jr. member
Activity: 40
Merit: 7
August 09, 2021, 01:53:15 PM
need help in python

i have 2 files and each file have 32 lines hex values
so i want to

subtract line 1 of "file1.txt" with line 1 of "file2"
subtract line 2 of "file1.txt" with line 2 of "file2"

vice versa and print  output.
i am using code like this but don't know what i am doing wrong



Code:
with open("file1.txt", "r") as f:
    line = f.readline().strip()
    while line != '':
          hex1 = f.readline().strip()

with open("file2.txt", "r") as f:
    line = f.readline().strip()
    while line != '':
          hex2 = f.readline().strip()
   
   
def add(file1.txt, file2.txt):
    P = (hex1)
    Q = (hex2)
    R = hex(P - Q)
    hx = hex(R).zfill(64)
    print(hx)
   
Pages:
Jump to: