iancoleman / bip39

A web tool for converting BIP39 mnemonic codes
https://iancoleman.io/bip39/
MIT License
3.41k stars 1.42k forks source link

Selectable PBKDF2 iterations are not practically useful #598

Open crwatkins opened 2 years ago

crwatkins commented 2 years ago

I noticed in the last release that the ability to select the number of PBKDF2 iterations had been added. My initial reaction was that #510 was a really bad idea and should be reverted.

I considered that this web tool could be used in a number of different ways, including as:

  1. A reference implementation for developers to test against
  2. A sandbox to allow for experimentation
  3. A tool for end users to create keying material for wallets, including entropy collection

As @kristovatlas said about this site

...you have the unlucky position of having created a reference implementation.

My biggest concern is the developers might get the wrong idea that this is a good thing. It is not.

However, as a sandbox, sure. As a tool for end users, I think it is quite dangerous, but I'm not all that concerned because of how difficult it would be for users to actually use it to send and receive funds.

When generating cryptographic keys, the most important ingredient is sufficient entropy. During the initial design of BIP39 there was much concern about BIP39 becoming a "brainwallet" and people using human generated phrases for input (instead of the mnemonic). As far as I can tell, that has not happened. All wallets and devices that I know of try very hard to generate sufficient quality entropy for the generation of the mnemonic.

The documentation on the web tool is misleading at best and plain incorrect otherwise.

This is not true.

While technically true, this is not practically true. If you are already using commonly recommended amounts of entropy, brute force attacks already consume more energy than available in our universe. Multiplying that by some number of iterations is silly.

In summary, modifying the number of iterations is of extremely limited practical value, if any. I believe the way this feature was implemented and documented gives developers the wrong impression that it might be useful to them.