Pages:
Author

Topic: lattice-attack || how to run without error - page 4. (Read 3185 times)

full member
Activity: 706
Merit: 111
This is an example from the data.json file from https://github.com/bitlogik/lattice-attack


{"curve": "SECP256K1", "public_key": [66412380102939781024918160349386680014552536369061587637080774389860461092925, 43765600116551195273677149966008783624760986110490190619082891899095205821463], "known_type": "LSB", "known_bits": 6, "signatures": [{"r": 77527664235581399957092079345479688400475999610428178825522649055070157244692, "s": 27028479468528243957334746793835087615740874028178347534667218420099431266524, "kp": 51, "hash": 36925504434266069211917383521197840104244330385311344434522880060028429358956}, {"r": 1695214956238129249280118258814363243967244974939577175204794511553033886344, "s": 84915535421556974430475608108845062567200591001138706902138971666887762297461, "kp": 23, "hash": 76485972818364982894032873079629726025969313708578174583231327504986349400949}, {"r": 109269381046386034156037076068908319933850763940108273610325408412215759654951, "s": 48609197671516297208867726715248596584655415925682996149314879813291177259719, "kp": 49, "hash": 8857850795789766547675189849758610890848461200122419912004299328172940180927}, {"r": 41835540276419198058500360048414380626372941221767888918686846392248041576696, "s": 1825469084617584873286736453038639812754935222429578990673573348028125348352, "kp": 29, "hash": 11771613120662486178657899205469606751879506909643902145426207541353014498651}, {"r": 107103142771724135475440435595118756234545765813796109423691918131480012001322, "s": 76403726951992633295737606623610572293691262686449016257400538234410247449075, "kp": 44, "hash": 109029154205057617106956764551702586575882058359417649302233515615948131520073}, {"r": 54544573696288124190943111180088654937224138523771919858599448193516058012815, "s": 75774534848938869077595821409914703967303095416625781047518021857023231109081, "kp": 44, "hash":


Is this the public key its trying to look for [66412380102939781024918160349386680014552536369061587637080774389860461092925, 43765600116551195273677149966008783624760986110490190619082891899095205821463] ?

So I convert the r,s,z into decimal, I see the r and s. Which one is the z, is it the kp?

I'm trying to see what goes where.
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
@ecdsa123

You get all data what you need for make lattice ?



cobras:


here you have new transactions generate for pubkey

it has been designed from the original from blockchain.

check below:

Code:
#puzzle 120 bit
#pubkey: 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630
#orignal r 73510839094214084184271166420450064382033414643777332160226424786083490644490
#orignal s 10976594294804291513495419880246258022106887857042165878188703008731415727960
#orignal z 57033488418143403036276105049800667624117951758937049013745927841702009220581
#transaction no 1
r1= 64303877522016749211328019369486855559381583676185624818721878054372774312312
s1= 70875935156883017289107359601022834131678723222382391732673864919336300956832
z1= 35661757295778441922079074467255901080139542633440413895572608785090077596810
#ecdsa verify with pubkey : signature matches
#transaction no 2
r2= 113779420052094348549790625183876838964910120506875492617325148867041134611828
s2= 96745938684674252071471302417800048447980988178881028616577919694871256968444
z2= 98246022210272637262013100016624594634461243839177892990658396738754206074658
#ecdsa verify with pubkey : signature matches
#transaction no 3
r3= 73747527950084943081014066025721979101835505522277265880132019814117348403688
s3= 60853612463764314593593189942506162309685078640419983461023904463111781219874
z3= 67681371259005467470285887789884648655153421391057790433988472875579507892348
#ecdsa verify with pubkey : signature matches
#transaction no 4
r4= 75314523162015442440660600468028764137673617222885550022074746107917840302622
s4= 14569616503728591410238910269631849279226193629982420163055031991462228437199
z4= 78075666291674269562723582424350797980288665770729771649502233772300923016682
#ecdsa verify with pubkey : signature matches

how many none bit in sighs ?

for latticce i think alll sighs mast be same bits. But yours trans N2 is not  equeilto others transaction by lenght - r2 is bigger then r at other sighs



it is the same bits as original r

it is designed :
original transaction : nonce k->unknown   

first transaction: nonce + 10 | or nonce + 100 (sorry don;t remember)
second transaction: nonce + 20 | or nonce + 200 (sorry don;t remember)

third transaction: nonce + 30 | or nonce + 300 (sorry don;t remember)

fourth transaction: nonce + 40 | or nonce + 400 (sorry don;t remember)

where nonce is still the same from original



transaction has msb or lsb ?

you make gauss reduction for them ?

on this adress only  1 transaction for output transaction, doing something with input transaction and add them to lattice matrix  bad idia....

then you will modify  sighs from 256 bit to 100 ?




in this example : all 4 transactions have the same msb -   more than 240 bit



can you generate for puz 120,  89 sighns with nonce not more 2^248 ?

you can do it without msb or lsb





no one can, unless you know the privkey


but you can make reductions, it take times, and you have to write algorithm to this.
it is simple -> math and 128 cores, or GPU and coder which can implement algorithm in c++

at the moment i'm almost finish math equation for this.

yoy can find 128 core at https://vast.ai/

[moderator's note: consecutive posts merged]
member
Activity: 69
Merit: 53
@COBRAS
hello
This is puzzle 120 public calculated 100 sample with 120 bit random data
MSB 16 bits is must "0000" in nonce, tested with multiple 120 bit range my own sample private keys.

https://pastebin.com/RTg4PVv0
For LLL.reduction its no issue but BKZ.reduction will show error "infinite loop in babai"
Same in liner random.

This can't be fixed so far i know.
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
Code:
#puzzle 120 bit
#pubkey: 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630
#orignal r 73510839094214084184271166420450064382033414643777332160226424786083490644490
#orignal s 10976594294804291513495419880246258022106887857042165878188703008731415727960
#orignal z 57033488418143403036276105049800667624117951758937049013745927841702009220581
#transaction no 1
r1= 64303877522016749211328019369486855559381583676185624818721878054372774312312
s1= 70875935156883017289107359601022834131678723222382391732673864919336300956832
z1= 35661757295778441922079074467255901080139542633440413895572608785090077596810
#ecdsa verify with pubkey : signature matches
#transaction no 2
r2= 113779420052094348549790625183876838964910120506875492617325148867041134611828
s2= 96745938684674252071471302417800048447980988178881028616577919694871256968444
z2= 98246022210272637262013100016624594634461243839177892990658396738754206074658
#ecdsa verify with pubkey : signature matches
#transaction no 3
r3= 73747527950084943081014066025721979101835505522277265880132019814117348403688
s3= 60853612463764314593593189942506162309685078640419983461023904463111781219874
z3= 67681371259005467470285887789884648655153421391057790433988472875579507892348
#ecdsa verify with pubkey : signature matches
#transaction no 4
r4= 75314523162015442440660600468028764137673617222885550022074746107917840302622
s4= 14569616503728591410238910269631849279226193629982420163055031991462228437199
z4= 78075666291674269562723582424350797980288665770729771649502233772300923016682
#ecdsa verify with pubkey : signature matches

you need only one of this  transaction - outgoing transaction
member
Activity: 330
Merit: 34
i don;t understand

I can make valid new transactions from valid transaction but need pubkey and r,s,z from this transaction

if you give me pubkey and r,s,z then I will give you sample Smiley few transactions as valid
original RSZ from 120

     R: 00a285a9151ac1f9c40e88a2a80b79c702336536462a9390fd00dda999da45420a
     S: 1844883eb808df18a9138ee2c13439ecf716799edcf073772f2696e4f9384f58
     Z: 7e17cf7c5b7ccfaa4c7c05874e4fb4f12661662b8e33188e2e62b3739931ade5
PubKey: 02ceb6cbbcdbdf5ef7150682150f4ce2c6f4807b349827dcdbdd1f2efa885a2630
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
why randomnes?

example :

private key = 2**254
nonce = 2**200

and I have one r,s,z as r = nonce *G

I dont know k but know r,s,z and pubkey

then:
1. make new transaction for this pubkey as  k - 2**10 > it is nonce 2*190 -> new s , new z -> check in lattice -> not find k
2. make new transaction for this pubkey as  k - 2**20 > it is nonce 2*180 -> new s , new z -> check in lattice -> not find k
.....
20. new transaction for this pubkey as  k - 2**80 > it is nonce 2*120 -> new s , new z -> check in lattice -> : founded k:)
then calculate private key:)

Bro, I cant find a my crypt  fir getting  all rsz from 1 adress, but for one rsz this utill is good:

https://github.com/iceland2k14/rsz

waiting from you generated rsz data with nonce <=128 bit

ps

code for calculating how many bits in r:


file = open('r.txt', 'r+')
for address in file.readlines():

    num = int(address)
    length = len(bin(num))
    length -=2
    print ("total number of bits: ", length)
copper member
Activity: 821
Merit: 1992
Quote
i need : pubkey (x,y) , and transaction output as r s z
You need only pubkey. For lattice attack, your r,s,z can be faked, it will be as useful as something collected from some real transaction.

Quote
new r_new,s_new,h_new for the same pubkey as old_nonce minus 2**i bit
Quote
The randomness is the thing that can feed LLL to produce the key. If you have only one signature (you can always do that, just by starting from one fake random signature), you cannot just tweak that single signature and expect it to behave in the same way as two different signatures. They are still connected, because you only slightly tweaked it, so it looks like trying to solve x=2y equation by adding 2x=4y equation. It will not help you. Also, x+1=2y+1 will not help you either. You need something like x=y+1, then you will know that x=2 and y=1.
And that's why it would be better to start with 120-bit key, and make a lot of 240-bit signatures. You need some randomness to make it. I think getting it squared should be random enough to reveal the key, but this code still does not work for me, this "infinite loop in babai" is annoying and simply means that LLL found nothing, so other algorithms were used (and they failed somehow).
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
no problem.


now I writing my own attack:

example :

I have pubkey with one output r,s,z

so I know r,s,z

we all know that if r  (which is nonce*G) -> so if nonce is less 125 bit -> lattice standard reduction will find privatekey when we have only one output (one transaction)

so : We can make perform "new" transaction as below with loop:

 new r_new,s_new,h_new for the same pubkey as old_nonce minus 2**i bit
then test in lattice that r (as nonce*G is in 0 to 125 bit)Smiley
if not -> then minus 2**i bit and so on:)


You really can make code for this , and code for gauss reduction ?

P.s. I will provide rsz  for you any way
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
@garlonicon
 

It is possible make fake rsz for known pubkey ?

Can someone generate rsz for pubkey 120 for ex , in format of lattice-attack script or  bkz-preducate ?

Br


yes Cobras

we can make valid transactions for pubkey, only then when this pubkey has minimum one output

i need : pubkey (x,y) , and transaction output as r s z

then I make perform "gauss reduction for this pubkey", result will be:
pubkey (still the same)
new r,s,z valid for this pubkey (valid means : ecdsa verify)

I will make for 120, and simple with many transaction.

Little later today or tomorrow. Don go far away  from this thread
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
Quote
i don't think its bug
It is a bug, because the code should not inform you that "something went wrong", but should give you the exact reason of what was wrong, and also why it could be wrong. Scripts should not just crash if you feed them with invalid entries. They should tell you, what is the correct format and why something does not work. So, "infinite loop in babai" says nothing. It says that there is some loop and that loop is infinite. But there could be a lot of reasons, actually, an assertion saying that "value==something" was false in file "sample.py" on line 123 would be a lot better than that. Also, I think that signatures are random enough, they are just random 240-bit values that are not connected at all. Adding random 120-bit and multiplying the result by random 120-bit will shuffle and mix everything, no matter what was the key we started with. And we can get infinitely many signatures, so there always will be enough to try this kind of attack (also because there was an example with only six known bits that was solved correctly).

I have a communication with bitlogic (lattice-attack code)r previously. If you can explain what a bag I cab ask him for remove bag, or you can send him message directly.
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
@garlonicon

You know how to downgrade pubkey range ? I try, but with div or substraction but this like how to shut to the the galaxy from the gun. Task is finding very small range, for ex 2^80, need search this 2^80 in 2^119 so, about 549755813888 publick of 2^80  in range 2^119+2^119(total 1/2 of 2^150.

Substraction had same difficulty's. Then substract, after you get pubkey smaller then target pubkey, difficulties of pubkey start grow, against fail...

Huh


It is possible make fake rsz for known pubkey ?

Can someone generate rsz for pubkey 120 for ex , in format of lattice-attack script or  bkz-preducate ?

Br
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
Quote
i don't think its bug
It is a bug, because the code should not inform you that "something went wrong", but should give you the exact reason of what was wrong, and also why it could be wrong. Scripts should not just crash if you feed them with invalid entries. They should tell you, what is the correct format and why something does not work. So, "infinite loop in babai" says nothing. It says that there is some loop and that loop is infinite. But there could be a lot of reasons, actually, an assertion saying that "value==something" was false in file "sample.py" on line 123 would be a lot better than that. Also, I think that signatures are random enough, they are just random 240-bit values that are not connected at all. Adding random 120-bit and multiplying the result by random 120-bit will shuffle and mix everything, no matter what was the key we started with. And we can get infinitely many signatures, so there always will be enough to try this kind of attack (also because there was an example with only six known bits that was solved correctly).

Hello, did you try this code ? Maybe this code had no bag, and more "powerful" for this talk, because has 3;algorithm include lattice  

https://github.com/malb/bdd-predicate
copper member
Activity: 821
Merit: 1992
Quote
i don't think its bug
It is a bug, because the code should not inform you that "something went wrong", but should give you the exact reason of what was wrong, and also why it could be wrong. Scripts should not just crash if you feed them with invalid entries. They should tell you, what is the correct format and why something does not work. So, "infinite loop in babai" says nothing. It says that there is some loop and that loop is infinite. But there could be a lot of reasons, actually, an assertion saying that "value==something" was false in file "sample.py" on line 123 would be a lot better than that. Also, I think that signatures are random enough, they are just random 240-bit values that are not connected at all. Adding random 120-bit and multiplying the result by random 120-bit will shuffle and mix everything, no matter what was the key we started with. And we can get infinitely many signatures, so there always will be enough to try this kind of attack (also because there was an example with only six known bits that was solved correctly).
member
Activity: 69
Merit: 53
@garlonicon
i don't think its bug.
"infinite loop in babai"
I think it's like math divide by 0 on lattice attack.
First calculated sign must be higher int value like i have posted.
0xf000000000000000000000000000000000000000000000000000000000000000
Later sign can use divide by 14 or 10 etc, til int reach to 2 then can use random 128 bit int and all this is valid and give first 33 only non zero MSB rest all are 0 starting K on MSB.
i have tested with all possible combination no matter what i try i can't go lower then 33 kp requirement for 4 bit leaking.
copper member
Activity: 821
Merit: 1992
Quote
Only bitlogik lattice-attack is most powerful i can feel.
I tried it, but it is somewhat buggy. You can take 120-bit key and use two random 120-bit values to get as many 240-bit signatures as you need (because first you will add one random 120-bit number to another 120-bit number, and then you will multiply that by another 120-bit value, by choosing the right range, you can always make sure that the first 16 bits are zero). No matter how many 240-bit k-values in signatures I had, I could never reach any 120-bit key from that. LLL is going through that without printing any key, and then another algorithms have some bugs, because there are "infinite loop in babai" and other similar messages in their internal implementation.

So, I partially know how to attack 120-bit keys, but I cannot do that in practice (because this code is buggy, it would take some time to fix it).
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
@COBRAS
Its different attack with lowest nonce under 127 bit & his weakness.

Only bitlogik lattice-attack is most powerful i can feel.

For example if you have any private key under 128 bit. for example puzzle 120.
If you use liner random value or single known higher random(0xf000000000000000000000000000000000000000000000000000000000000000) to start with and divide it in each time till 100 sign is made.(after 51 sign can use 128 bit random to make sign.)
You just have 33 or less nonce kp to worry about, because rest is 0 on MSB
i tested on my single pc with 16 thread its not powerful to cover it.
need atlast 128 thread with 4/5 pc to finish whole range fast.

So, you need 128 or 4*128 thread ?

64 thread is possible, I think 128 possible too.

Your code work with less 128 but nonce, you tested it ?

P.s. then I try with 0000 msb and lsb, nothing found with his lattice attack.

R.
full member
Activity: 706
Merit: 111
I got the bitlogik lattice-attack to work    https://github.com/bitlogik/lattice-attack

So how do I go about attacking an public key or public keys?
member
Activity: 69
Merit: 53
@COBRAS
Its different attack with lowest nonce under 127 bit & his weakness.

Only bitlogik lattice-attack is most powerful i can feel.

For example if you have any private key under 128 bit. for example puzzle 120.
If you use liner random value or single known higher random(0xf000000000000000000000000000000000000000000000000000000000000000) to start with and divide it in each time till 100 sign is made.(after 51 sign can use 128 bit random to make sign.)
You just have 33 or less nonce kp to worry about, because rest is 0 on MSB
i tested on my single pc with 16 thread its not powerful to cover it.
need atlast 128 thread with 4/5 pc to finish whole range fast.
member
Activity: 873
Merit: 22
$$P2P BTC BRUTE.JOIN NOW ! https://uclck.me/SQPJk
I was attempting to use this but did get a lot if errors.

Linck with code and descryption for recovering private key from sighnatures. Code in python for work with 128 bit nonce only:

code: https://asecuritysite.com/ecc/ecd

desryption:

https://blog.trailofbits.com/2020/06/11/ecdsa-handle-with-care/

how to modify code for work with 256 bit sighnatures ?


I already told you to just change lines 17 and 18 to 256 and it will work https://asecuritysite.com/ecc/ecd

k1 = random.randrange(1, pow(2, 256))
k2 = random.randrange(1, pow(2, 256))

private key ot found.

only message"private kwy", but no second message "privatevkey found"

What private key it was looking for because it was random

yes random, you can replace generetated r,s from rundom to r,s from vitcoiin sighnature, after it will be not rundom.

but, rhis wersion for 128 bit nonce. btx is a 252-256 bit nonce
full member
Activity: 706
Merit: 111
I was attempting to use this but did get a lot if errors.

Linck with code and descryption for recovering private key from sighnatures. Code in python for work with 128 bit nonce only:

code: https://asecuritysite.com/ecc/ecd

desryption:

https://blog.trailofbits.com/2020/06/11/ecdsa-handle-with-care/

how to modify code for work with 256 bit sighnatures ?


I already told you to just change lines 17 and 18 to 256 and it will work https://asecuritysite.com/ecc/ecd

k1 = random.randrange(1, pow(2, 256))
k2 = random.randrange(1, pow(2, 256))

private key ot found.

only message"private kwy", but no second message "privatevkey found"

What private key it was looking for because it was random
Pages:
Jump to: