4 ms·
Be warned that this makes your authentication system less secure because it caps the maximum entropy of the password to the entropy of the hash function.
by charcircuit 3y ago
Be warned that this makes your authentication system less secure because it caps the maximum entropy of the password to the entropy of the hash function.
- poizan42 3y agoYou need crazy long passwords for that to become the limiting factor. With random printable characters on the keyboard there are a bit less than 7 bits per character (unless a crazy amount of different accents are used). So you need passwords longer than 18 characters to surpass the entropy of even MD5.
- gpvos 3y agoWhat would you suggest instead?
- charcircuit 3y agoA simple change if you don't want to change it too much eg. moving away from passwords would be to use a sponge function instead of a hash and and squeeze out the same number of bits as the plaintext.
- tatersolid 3y agoA cryptographic sponge function has a fixed capacity just like a the fixed state size of a cryptographic hash function…
- charcircuit 3y agoGood point. How about splitting the password into chunks, then use a key streching algorthim on each chunk with difficulty tuned to be easier based off the total amount of chunks, and concatenating them.
- gpvos 3y agoThat sounds like the kind of homebrew crypto that one should never do in production. I'll stick to my boring but proven salted hashes, thanks.