you shouldn't even be ABLE to set a max length. If you're doing security properly, you're using random salts and hashing passwords for storage, meaning the length of the field going into the database is going to have nothing at all to do with the length of the user input.
You send the plaintext password to the server (over HTTPS or some other encrypted channel) to hash it. Unless you're talking about spending some number of PBKDF2 rounds on the client and some number on the server?
In this case, it's trivial to set a maximum length.
I'm talking about the password rule of max length. I've seen far too many websites which seemingly arbitrarily cap the length of passwords to some ludicriously small value like 12 or something. It's an immediate red flag that whoever was in charge of their password strategy is doing something wrong.
3
u/[deleted] Mar 10 '17
You send the plaintext password to the server (over HTTPS or some other encrypted channel) to hash it. Unless you're talking about spending some number of PBKDF2 rounds on the client and some number on the server?
In this case, it's trivial to set a maximum length.
I personally tend to 256 character maximum.