ethereumjs / keythereum

Create, import and export Ethereum keys
MIT License
609 stars 163 forks source link

Incorrect scrypt kdf defaults? #55

Closed wjmelements closed 5 years ago

wjmelements commented 6 years ago

Should the defaults for scrypt kdf be

p = 1
r = 8

instead of

p = 8
r = 1

Just looking at my own keystore, these defaults looked flipped.

wjmelements commented 6 years ago

@tinybike do you know who could verify this?

tinybike commented 5 years ago

@wjmelements Good question... I have keystore files with examples of both. It does look like the current version of geth defaults to p=1, r=8 for geth account new. However, I see examples with p=8, r=1 in the docs, for example https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition#scrypt. My guess is that p=1, r=8 is preferable (since the point of scrypt is to be memory hard) but I'm not sure.

Since keythereum is supposed to be congruent with geth, it's probably sensible to change this. Might be worth also pinging https://gitter.im/ethereum/go-ethereum to ask about this though.