ryancdotorg / brainflayer

A proof-of-concept cracker for cryptocurrency brainwallets and other low entropy key algorithms.
https://rya.nc/brainflayer
909 stars 459 forks source link

added '-z' key to search using random hex privkey mode #157

Closed denisix closed 3 years ago

denisix commented 3 years ago

Hello, Ryan!

First of all, thank you for such an amazing work, actually it's really how you have improved algo and secp256k1 to get so high fantastic hashrate speed! This commit is about to search using random hex private key, instead of -I option that provides an ability to iterate in exact key space. I did a test using pregenerated key and it was found successfully, but maybe some errors (sorry, i'm not c/gcc geek), so please review :)

Thank You!

Napulsnik commented 3 years ago

Hello, Ryan!

First of all, thank you for such an amazing work, actually it's really how you have improved algo and secp256k1 to get so high fantastic hashrate speed! This commit is about to search using random hex private key, instead of -I option that provides an ability to iterate in exact key space. I did a test using pregenerated key and it was found successfully, but maybe some errors (sorry, i'm not c/gcc geek), so please review :)

Thank You!

Hello. How do I specify the exact keyspace?

denisix commented 3 years ago

Hi Ryan,

The main idea was to have an opposite option to search in random key space :)

Thanks!

On Mon, 26 Apr 2021, 01:14 Napulsnik, @.***> wrote:

Hello, Ryan!

First of all, thank you for such an amazing work, actually it's really how you have improved algo and secp256k1 to get so high fantastic hashrate speed! This commit is about to search using random hex private key, instead of -I option that provides an ability to iterate in exact key space. I did a test using pregenerated key and it was found successfully, but maybe some errors (sorry, i'm not c/gcc geek), so please review :)

Thank You!

Hello. How do I specify the exact keyspace?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryancdotorg/brainflayer/pull/157#issuecomment-826398415, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3FET675QBZ2UZVYHWFLZTTKSH4HANCNFSM43RWPJSA .

Napulsnik commented 3 years ago

Hi Ryan, The main idea was to have an opposite option to search in random key space :) Thanks! On Mon, 26 Apr 2021, 01:14 Napulsnik, @.***> wrote: Hello, Ryan! First of all, thank you for such an amazing work, actually it's really how you have improved algo and secp256k1 to get so high fantastic hashrate speed! This commit is about to search using random hex private key, instead of -I option that provides an ability to iterate in exact key space. I did a test using pregenerated key and it was found successfully, but maybe some errors (sorry, i'm not c/gcc geek), so please review :) Thank You! Hello. How do I specify the exact keyspace? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#157 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3FET675QBZ2UZVYHWFLZTTKSH4HANCNFSM43RWPJSA .

I'm not Ryan dude :-) I ran your variant, but the result is only public keys without private ones.

denisix commented 3 years ago

I'm not Ryan dude :-)

Oh, I'm sorry :)

Just did a test, created test wallet using passphrase 777:

$ python3 addressgen/genaddress.py -p 777
ECDSA private key (random number / secret exponent)
    eaf89db7108470dc3f6b23ea90618264b3e8f8b6145371667c4055e9c5ce9f52
...
Bitcoin Address (uncompressed, length=34):
    164694JJjkWpSJH3HufCEK5AdJvUiG9Ucd

converted address 164694JJjkWpSJH3HufCEK5AdJvUiG9Ucd to h160: 376e2aa31fa2ea7d2414e1dcd3a2835abba265bb5f9388ee

wrote to a test.hex file:

$ cat test.hex                                                                                                                                              
376e2aa31fa2ea7d2414e1dcd3a2835abba265bb5f9388ee

then created bloom-filter:

$ ./brainflayer/hex2blf test.hex test.blf
[*] Reading existing bloom filter from 'test.blf'...
[*] Loading hash160s from 'test.hex'  100.0%
[*] Loaded 1 hashes, false positive rate: ~2.298e-167 (1 in ~4.351e+166)
[*] Writing bloom filter to 'test.blf'...
[+] Success!

then on brainflayer.c on line 744 made some changes to test this key:

} else if (zopt) { // randomize mode

      unsigned char ps[32] = {234, 248, 157, 183, 16, 132, 112, 220, 63, 107, 35, 234, 144, 97, 130, 100, 179, 232, 248, 182, 20, 83, 113, 102, 124, 64, 85, 233, 197, 206, 159, 82};

      for (i = 0; i < Bopt; ++i) {
        for (int x = 0; x < 32; x++) {
          batch_priv[i][x] = ps[x];
          //batch_priv[i][x] = rand();
        }
      }

and started brainflayer with this bloom and -z:

./brainflayer/brainflayer -v -b test.blf -z

on the console i see

376e2aa31fa2ea7d2414e1dcd3a2835abba265bb:u:sha256:eaf89db7108470dc3f6b23ea90618264b3e8f8b6145371667c4055e9c5ce9f52

where is the last part eaf89db7108470dc3f6b23ea90618264b3e8f8b6145371667c4055e9c5ce9f52 - is the ECDSA private key according to addressgen tool.

ryancdotorg commented 3 years ago

The libc rand() function is not suitable for this, it only has a 64 bit state, and if I'm reading the documentation correctly it will produce the same sequence of values every time it's run.

If you really want to search random keys (my position remains that it is a waste of electricity to do so, and that you'd be better off solo mining or buying lottery tickets with whatever you'd have spent on power), it would be better to simply pick a random starting value and run in incremental mode from there.

Incremental key search is significantly faster than searching a set of arbitrary private keys because it can avoid having to do computationally expensive elliptic curve point multiplication operations and instead simply do simple addition of two points.

denisix commented 3 years ago

Thanks for the answer.

On Fri, 30 Apr 2021, 23:01 Ryan Castellucci, @.***> wrote:

The libc rand() function is not suitable for this, it only has a 64 bit state, and if I'm reading the documentation https://man7.org/linux/man-pages/man3/rand.3.html correctly it will produce the same sequence of values every time it's run.

If you really want to search random keys (my position remains that it is a waste of electricity to do so, and that you'd be better off solo mining or buying lottery tickets with whatever you'd have spent on power), it would be better to simply pick a random starting value and run in incremental mode from there.

Incremental key search is significantly faster than searching a set of arbitrary private keys because it can avoid having to do computationally expensive elliptic curve point multiplication operations and instead simply do simple addition of two points.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryancdotorg/brainflayer/pull/157#issuecomment-830349143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3FET46NJNJSITEE6UJBITTLMEDPANCNFSM43RWPJSA .

kuw13 commented 3 years ago

Can i install brainflayer in windows ! Do you have how to install in lenix ! Thanks

Sent from my iPhone

On Apr 30, 2021, at 11:09 PM, Den @.***> wrote:

 Thanks for the answer.

On Fri, 30 Apr 2021, 23:01 Ryan Castellucci, @.***> wrote:

The libc rand() function is not suitable for this, it only has a 64 bit state, and if I'm reading the documentation https://man7.org/linux/man-pages/man3/rand.3.html correctly it will produce the same sequence of values every time it's run.

If you really want to search random keys (my position remains that it is a waste of electricity to do so, and that you'd be better off solo mining or buying lottery tickets with whatever you'd have spent on power), it would be better to simply pick a random starting value and run in incremental mode from there.

Incremental key search is significantly faster than searching a set of arbitrary private keys because it can avoid having to do computationally expensive elliptic curve point multiplication operations and instead simply do simple addition of two points.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryancdotorg/brainflayer/pull/157#issuecomment-830349143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3FET46NJNJSITEE6UJBITTLMEDPANCNFSM43RWPJSA .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

kuw13 commented 3 years ago

They always seek for help but don’t help !

Any help here to how installing brainflayer on windows or kali lenix !

Sent from my iPhone

On May 8, 2021, at 7:48 PM, Mansour Al mutairi @.***> wrote:

Can i install brainflayer in windows ! Do you have how to install in lenix ! Thanks

Sent from my iPhone

On Apr 30, 2021, at 11:09 PM, Den @.***> wrote:

 Thanks for the answer.

On Fri, 30 Apr 2021, 23:01 Ryan Castellucci, @.***> wrote:

The libc rand() function is not suitable for this, it only has a 64 bit state, and if I'm reading the documentation https://man7.org/linux/man-pages/man3/rand.3.html correctly it will produce the same sequence of values every time it's run.

If you really want to search random keys (my position remains that it is a waste of electricity to do so, and that you'd be better off solo mining or buying lottery tickets with whatever you'd have spent on power), it would be better to simply pick a random starting value and run in incremental mode from there.

Incremental key search is significantly faster than searching a set of arbitrary private keys because it can avoid having to do computationally expensive elliptic curve point multiplication operations and instead simply do simple addition of two points.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ryancdotorg/brainflayer/pull/157#issuecomment-830349143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3FET46NJNJSITEE6UJBITTLMEDPANCNFSM43RWPJSA .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ryancdotorg commented 3 years ago

@kuw13 neither windows or kali linux are supported platforms, and i do not intend to add support for them. Also, please do not comment on unrelated issues.

kuw13 commented 3 years ago

Thanks for your answer. Do you have for linux ubuntu tutorial ! I just download it

Sent from my iPhone

On May 10, 2021, at 4:58 AM, Ryan Castellucci @.***> wrote:

 @kuw13 neither windows or kali linux are supported platforms, and i do not intend to add support for them. Also, please do not comment on unrelated issues.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.