3 ms·
Why do you have a limit on the length of a field? So it can fit in a database, i.e. with a certain number of bytes?
by paulddraper 10y ago
Why do you have a limit on the length of a field?
So it can fit in a database, i.e. with a certain number of bytes?
- desdiv 10y agoWithout a limit on password length, an attacker can DOS you by forcing you to run your KDF on gigabyte-sized strings.
- geocar 10y agoThey're only denying service to themselves if you run the KDF locally.
- paulddraper 10y agoGiga byte sized strings? Oh, no. That doesn't make sense. You need to limit by Giga grapheme strings.
- toast0 10y agoSome limits are technical (and in that case the hard limit is often bytes, but sometimes code units or code points, or broken if you told MySQL utf8 instead of bytes or utf8mb4), but in many cases, the limits are for aesthetic purposes: a post title or a username often is often required to be fairly short to look nice; in an ascii or latin1 world, those limits are usually expressed in terms of characters, but graphemes might be the right thing to limit in a unicode world.
- kmill 10y ago"Your username must be 1-4cm when printed with 12pt Times New Roman." I kind of like the idea of minimum length in cm as a password requirement.
- martin-adams 10y agoWhat about "Your username must be no longer than 3 seconds when spoke out loud" or, "Your username must not take more than 0.001ml of ink when printed at 12pt"
- Sean1708 10y agoIf that's why you have a limit then please go and change that immediately. No, this post is talking about having a minimum length on the password for safety reasons (i.e. a limit on the minimum entropy). You're right that a minimum byte length will ensure this, but what happens when your user types in n-1 "things" but their password gets accepted anyway. That's only a minor thing but (and I'm not entirely sure whether this is possible) what about when your user types in n "things" but the password doesn't get accepted because it's actually only n-1 bytes. Now the password won't be accepted and the user has no idea why. I agree that these are relatively trivial things, but the point is that it's not as simple as "just use the byte length".