by evunveot · 10y ago · 0 comments
This part confused me. How can truncating to 72 bytes be a more severe reduction in entropy than generating a 64-byte hash?
Let A be a 72 character long string, and B be A + X. Regardless of what X is, when bcrypted the result for A and B will be the same.
Assuming C, where len(C) < 72, I don't know if it is possible at all to chose some value of Y such that:
D:= C+Y
Entropy(bcrypt(D))< Entropy(bcrypt(C))
- Pre-hashing makes this less likely.
- Encoding the pre-hashed value to prevent NUL bytes is important.
But it's a bandaid solution, to be quite honest. We're better served by migrating to Argon2i, which doesn't have these quirks.And 512 bits is more than plenty.
Famous last words.
You're not getting through 512 bits of entropy unless your cryptographic methods are severely broken, so broken that having more bits would not meaningfully help.