A question about passwords | characters used in them
A question about passwords | characters used in them
Why do so many companies and people say that your password has to be so long and complicated, just to have restrictions?
I am in the process of changing some passwords (I have peen pwnd and it’s the password I use for use-less-er sites) and suddenly they say “password may contain a maximum of 15 characters“… I mean, 15 is long but it’s nothing for a password manager.
And then there’s the problem with special characters like äàáâæãåā ñ ī o ė ß ÿ ç just to name a few, or some even won’t let you type a [space] in them. Why is that? Is it bad programming? Or just a symptom of copy-pasta?
With very few exceptions, yes. There should be no restrictions on characters used/length of password (within reason) if you're storing passwords correctly.
And if a site does have such restrictions, it could be an indication that they store passwords in plaintext, rather than hashed
A very high max of something like 500 characters just to make sure you don't get DOSed by folks hitting your endpoint with huge packets of data is about the most I would expect in terms of length restrictions. I'm not a security expert or anything though.
That's a misunderstanding of DDoS. 0 byte packets are actually worse than large packets.
Which is why most DDoS (at least was) is extremely slow 0 byte requests until the server throttles/crashes under the number of requests.
E: Consider this. Are you more likely to throttle a bandwidth of terabytes/petabytes with couple million 1gb requests; or break it entirely by sending >4294967295 0 byte requests that effectively never stop being requested from the server?
Right, that's why I put the "within reason" in my comment. You still need to guard against malicious inputs so ultimately there is some max length limit, but it should be way beyond what a reasonable password length would be.
The best way to handle passwords IMO, is to have the browser compute a quick hash of the password, and then the server compute the hash of that. That way the "password" that is being sent to the server is always the same length.
Underappreciated fact: Bcrypt has a maximum of 72 bytes. It'll truncate passwords longer than that. Remember that UTF8 encoding of special characters can easily take more than one byte.
That said, this is rarely a problem in practice, except for some very long passphrases.
Interesting: https://en.wikipedia.org/wiki/Bcrypt#Maximum_password_length
Makes me question if bcrypt deserves to be widely used. Is there really no superior alternative?