[GH-ISSUE #2334] Add support for cracking brainwallets #1561

Closed
opened 2026-10-15 04:20:12 +07:00 by bsakaguchi · 10 comments
Owner
Originally created by @magnumripper on GitHub (Nov 14, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2334 Originally assigned to: @kholia on GitHub. From Luis Rocha: http://www.openwall.com/lists/john-users/2016/11/11/6 https://www.youtube.com/watch?v=foil0hzl4Pg http://fc16.ifca.ai/preproceedings/36_Vasek.pdf https://github.com/ryancdotorg/brainflayer
bsakaguchi 2026-10-15 04:20:12 +07:00
Author
Owner

@PracaGrande commented on GitHub (Nov 18, 2016):

Further references:
http://www.nicolascourtois.com/bitcoin/paycoin_BrainWallet3br.pdf
GPU implementation of ECC computation : http://eecm.cr.yp.to/pc109-20090901.pdf

<!-- gh-comment-id:261639264 --> @PracaGrande commented on GitHub (Nov 18, 2016): Further references: http://www.nicolascourtois.com/bitcoin/paycoin_BrainWallet3br.pdf GPU implementation of ECC computation : http://eecm.cr.yp.to/pc109-20090901.pdf
Author
Owner

@kholia commented on GitHub (Jun 21, 2017):

Walkthrough from Luis Rocha himself -> https://countuponsecurity.com/2016/11/20/blockchain-brainwallet-cracking/

<!-- gh-comment-id:310048593 --> @kholia commented on GitHub (Jun 21, 2017): Walkthrough from Luis Rocha himself -> https://countuponsecurity.com/2016/11/20/blockchain-brainwallet-cracking/
Author
Owner

@kholia commented on GitHub (Jul 15, 2018):

Resources for generating brain wallets (there are a bunch of them with different algorithms),

<!-- gh-comment-id:405067646 --> @kholia commented on GitHub (Jul 15, 2018): Resources for generating brain wallets (there are a bunch of them with different algorithms), * https://brainwalletx.github.io/ * https://www.bitaddress.org - SHA256(passphrase)
Author
Owner

@solardiz commented on GitHub (Oct 15, 2018):

Also relevant is the discussion with Ryan, the author of Brainflayer, here: https://en.bitcoin.it/wiki/User_talk:Ryanc

In particular: "The same system that can do 10 warpwallet keys per second can do about 600k traditional brainwallet keys per second. The reason for this is that it's not just sha256 vs scrypt+pbkdf2 - the public key generation step must be taken into account and it is much, much slower than sha256."

So if we speed up SHA-256 or/and scrypt (e.g., with our SIMD code or in OpenCL), we're still limited by performance of "the public key generation step" as well.

Brainflayer supports different KDFs with the -t option:

    -t keccak passphrases to be hashed with keccak256 (some ethereum tools)

    -t priv raw private keys - this can be used to support arbitrary deterministic wallet schemes via an external program. Any trailing data after the hex encoded private key will be included in brainflayer's output as well, for reference. See also the -I option if you want to crack a bunch of sequential keys, which has special speed optimizations.

    -t warp salts or passwords/passphrases for WarpWallet

    -t bwio salts or passwords/passphrases for brainwallet.io

    -t bv2 salts or passwords/passphrases for brainv2 - this one is very slow on CPU, however the parameter choices make it a great target for GPUs and FPGAs.

    -t rush passwords for password-protected rushwallets - pass the fragment (the part of the url after the #) using -r. Almost all wrong passwords will be rejected even without a bloom filter.

If we're to work on this issue, we'd need to decide which KDFs to implement.

<!-- gh-comment-id:429838730 --> @solardiz commented on GitHub (Oct 15, 2018): Also relevant is the discussion with Ryan, the author of Brainflayer, here: https://en.bitcoin.it/wiki/User_talk:Ryanc In particular: "The same system that can do 10 warpwallet keys per second can do about 600k traditional brainwallet keys per second. The reason for this is that it's not just sha256 vs scrypt+pbkdf2 - the public key generation step must be taken into account and it is much, much slower than sha256." So if we speed up SHA-256 or/and scrypt (e.g., with our SIMD code or in OpenCL), we're still limited by performance of "the public key generation step" as well. Brainflayer supports different KDFs with the `-t` option: ``` -t keccak passphrases to be hashed with keccak256 (some ethereum tools) -t priv raw private keys - this can be used to support arbitrary deterministic wallet schemes via an external program. Any trailing data after the hex encoded private key will be included in brainflayer's output as well, for reference. See also the -I option if you want to crack a bunch of sequential keys, which has special speed optimizations. -t warp salts or passwords/passphrases for WarpWallet -t bwio salts or passwords/passphrases for brainwallet.io -t bv2 salts or passwords/passphrases for brainv2 - this one is very slow on CPU, however the parameter choices make it a great target for GPUs and FPGAs. -t rush passwords for password-protected rushwallets - pass the fragment (the part of the url after the #) using -r. Almost all wrong passwords will be rejected even without a bloom filter. ``` If we're to work on this issue, we'd need to decide which KDFs to implement.
Author
Owner

@prodnet commented on GitHub (Oct 18, 2018):

You omitted voluntarily the options ? :

-t sha256 (default) - classic brainwallet    
-t sha3   - sha3-256
<!-- gh-comment-id:430993404 --> @prodnet commented on GitHub (Oct 18, 2018): You omitted voluntarily the options ? : ``` -t sha256 (default) - classic brainwallet -t sha3 - sha3-256 ```
Author
Owner

@prodnet commented on GitHub (Oct 18, 2018):

Walkthrough from Luis Rocha himself -> https://countuponsecurity.com/2016/11/20/blockchain-brainwallet-cracking/

Resources for generating brain wallets (there are a bunch of them with different algorithms),

* https://brainwalletx.github.io/

* https://www.bitaddress.org - SHA256(passphrase)

Yes, It would be a very good idea if the -t options from Brainflayer can be implemented

<!-- gh-comment-id:430996866 --> @prodnet commented on GitHub (Oct 18, 2018): > Walkthrough from Luis Rocha himself -> https://countuponsecurity.com/2016/11/20/blockchain-brainwallet-cracking/ > Resources for generating brain wallets (there are a bunch of them with different algorithms), > > * https://brainwalletx.github.io/ > > * https://www.bitaddress.org - SHA256(passphrase) Yes, It would be a very good idea if the -t options from Brainflayer can be implemented
Author
Owner

@solardiz commented on GitHub (Oct 18, 2018):

IIRC, the list of Brainflayer -t options that I copied in here came from its README.md on its GitHub page. I did not omit any options on purpose.

We currently have no intent to actually work on this issue anyway. My update was just in context of an internal discussion prompted by a user's re-request for this feature. It's just to keep things written down in case we revisit this issue later.

<!-- gh-comment-id:431103547 --> @solardiz commented on GitHub (Oct 18, 2018): IIRC, the list of Brainflayer `-t` options that I copied in here came from its README.md on its GitHub page. I did not omit any options on purpose. We currently have no intent to actually work on this issue anyway. My update was just in context of an internal discussion prompted by a user's re-request for this feature. It's just to keep things written down in case we revisit this issue later.
Author
Owner

@prodnet commented on GitHub (Oct 18, 2018):

Why has this implementation not been done, given that it has been requested many times?

<!-- gh-comment-id:431113297 --> @prodnet commented on GitHub (Oct 18, 2018): Why has this implementation not been done, given that it has been requested many times?
Author
Owner

@solardiz commented on GitHub (Oct 18, 2018):

It hasn't been requested many times - I only recall two. If yours is separate, then three, but I don't know if you're the same or a different person than the one who has been pinging several JtR developers individually about this earlier this month and was suspiciously insistent. Other reasons why we haven't approached this task and currently have no intent to are both ethical and technical. The ethical aspects surrounding this functionality are non-trivial - there are reasons both for and against having this in JtR. The technical aspects are not trivial either - we may speed up the KDF portion, but for SHA-256 it's pretty fast anyway, and Brainflayer presumably spends more time on "the public key generation step" instead. Optimizing that step isn't something the particular JtR developer who could have worked on this issue would work on. With the effort we'd realistically put into this, we'd probably end up with speeds just slightly better than Brainflayer's, and also leverage JtR's OpenMP and --fork support, and perhaps more importantly its built-in cracking modes (generation of candidate passwords). That could be fine. But like I said, upon recent discussion we currently have no intent to proceed.

<!-- gh-comment-id:431117158 --> @solardiz commented on GitHub (Oct 18, 2018): It hasn't been requested many times - I only recall two. If yours is separate, then three, but I don't know if you're the same or a different person than the one who has been pinging several JtR developers individually about this earlier this month and was suspiciously insistent. Other reasons why we haven't approached this task and currently have no intent to are both ethical and technical. The ethical aspects surrounding this functionality are non-trivial - there are reasons both for and against having this in JtR. The technical aspects are not trivial either - we may speed up the KDF portion, but for SHA-256 it's pretty fast anyway, and Brainflayer presumably spends more time on "the public key generation step" instead. Optimizing that step isn't something the particular JtR developer who could have worked on this issue would work on. With the effort we'd realistically put into this, we'd probably end up with speeds just slightly better than Brainflayer's, and also leverage JtR's OpenMP and `--fork` support, and perhaps more importantly its built-in cracking modes (generation of candidate passwords). That could be fine. But like I said, upon recent discussion we currently have no intent to proceed.
Author
Owner

@kholia commented on GitHub (Oct 18, 2018):

I strongly agree with @solardiz here. I am also OK with closing this issue with WONTFIX label.

<!-- gh-comment-id:431183063 --> @kholia commented on GitHub (Oct 18, 2018): I strongly agree with @solardiz here. I am also OK with closing this issue with WONTFIX label.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1561
No description provided.