6 ms·
What is your expectation for allowed password length and why?
by psim1 7y ago
What is your expectation for allowed password length and why?
- Hamuko 7y agoI find 64 characters a pretty reasonable expectation.
- wishinghand 7y agoIt’s not so much why the OP thinks they’re entitled to arbitrary password length, it’s that the UI/UX does nothing to inform the user of this. And also the bytes they save restricting password length to 32 instead of 128 or 256 would be a few dollars rounding error in the end of the Year budget.
- abfan1127 7y agoproper hashing yields no saving of bytes.
- wishinghand 7y agoYou're right, I forget about that. Which is why I'm not a backend programmer.
- masklinn 7y agoI fucking hope they don’t save any bytes doing that given that’d mean the passwords are stored in clear text. Though given what we’ve seen so far once people started taking a look that’s not out of the realm of possibility.
- deleted 7y ago[deleted]
- DangerousPie 7y agoI am really struggling to come up with a situation where this would actually matter. I guess if for some reason the first 32 characters of my password got leaked but not the next 32? But why would that ever happen, and who wouldn't change their password in that situation anyway?
- Dylan16807 7y ago32 characters might be safe, but we could make the same argument for 16 characters, yet there is a huge vulnerability there: Someone might have a perfectly secure series of words as a password, but only the first three words survive truncation. Now they can be brute-forced easily. It's bad form in general to truncate a password.
- saimiam 7y agoI usually sha256sum a string whose format I know to generate the 64 char password. My expectation of password length is that I should simply paste the result into the password field and not have to think about it any more. Why: len(sha256sum(str)) = 64.
- nicky0 7y agoFor me it's not the maximum length which is the issue. It's the silently accepting input which is too long.
- cmcd 7y agoYou are only storing the hash of the password so there is no reason to have arbitrary length constraints like 32. Why not make it several thousand characters?
- masklinn 7y agoYep. You do want a limit though as you don’t want random attackers to DOS your login server by feeding megabytes you your kdf.
- txcwpalpha 7y agoThere is actually a reason (though 32 seems pretty short. Something like 256 is probably more reasonable). Several thousand characters (or worse, unlimited length) opens up your attack to a form of DDoS where you can exploit the fact that password hashing is a computationally heavy operation. See here: https://arstechnica.com/information-technology/2013/09/long-passwords-are-good-but-too-much-length-can-be-bad-for-security/ https://arstechnica.com/information-technology/2013/09/long-... > Django does not impose any maximum on the length of the plaintext password, meaning that an attacker can simply submit arbitrarily large—and guaranteed-to-fail—passwords, forcing a server running Django to perform the resulting expensive hash computation in an attempt to check the password. A password one megabyte in size, for example, will require roughly one minute of computation to check when using the PBKDF2 hasher. This allows for denial-of-service attacks through repeated submission of large passwords, tying up server resources in the expensive computation of the corresponding hashes.
- tomtomtom777 7y agoIsn't this mitigated by hashing the password on the client (in addition to hashing it on the server).
- GordonS 7y agoBut couldn't an attacker just skip the client-side hashing?
- masklinn 7y agoA few hundred to thousand characters, because you don’t want to send megabytes of garbage to your KDF and that’s more or less the only reason to limit password length. Also if you put a limit, don’t silently truncate.