6 ms·
I found this part interesting: > Notice that when the key is, say, 40 bytes long, it’s padded with zeros to make it 64 bytes long. So the actual entropy of tha
by sleavey 5y ago
I found this part interesting:
> Notice that when the key is, say, 40 bytes long, it’s padded with zeros to make it 64 bytes long. So the actual entropy of that key is equivalent to the 40-byte long key. But if the key is longer than 64 bytes, it’s effectively being shortened to 20 bytes. So its entropy is lower. If you want to maximize the complexity of the key, and you’re the one choosing the key, go for something around, but never more than, 64 bytes.
Perhaps that's why some sites have a maximum character limit for passwords. (Although I suspect many are just doing it wrong.)
- wyager 5y agoThere is no sound technical or security justification for having a maximum character limit, up to some obscenely long limit to prevent the user wasting server resources by submitting giant forms. Also, no one should be using raw HMAC to do password checking. At the very least use something like PBKDF2.
- trinovantes 5y agoAt this point, I just automatically assume any website that has a maximum character limit and weird character restrictions is storing the password in plaintext
- jaywalk 5y agoSometimes the character restrictions are due to overly aggressive web application firewalls.
- tdumitrescu 5y agoSetting a reasonable limit closes off a potential DoS vector. That's why our security team had us add a limit. (Sure, in practice rate limiting should also be in place, defense in depth.)