What's the point of maximum password lengths?


Yesterday, I had a user message me asking why the passwords on my website were capped at 20 characters. I quickly found the "maximum password length" setting in the security options and saw that the default was 20. I went ahead and adjusted it to 255 for my website.
Before I made the adjustment, I briefly researched why maximum password lengths exist. It's clearly not about storage, because each password takes up exactly 73 characters in the database (13 for the salt and 60 for the hash.) The only other possible downside to infinite password lengths would be using up too much CPU hashing extremely long passwords, but I don't realistically see that being an issue with modern servers (you'd probably hit networking/POST limitations first.)
Furthermore, I found some people making very bold claims about the topic: "A maximum length specified on a password field should be read as a SECURITY WARNING... assume the worst and expect that this site is storing your password literally... avoid using this site like the plague if possible." (https://stackoverflow.com/questions/98768/should-i-impose-a-maximum-length-on-passwords)
And finally, I saw some suggestions that if there are back-end/network limitations for processing password lengths, it's best to silently truncate the input rather than returning an error message. After all, the password is hashed anyway, the user won't notice as long as the truncate length stays the same, and it's not like users would expect the first X characters to be non-sensitive information.
So, all of that said, does anyone know why there's a maximum password setting in Composr? I thought about posting this under Developing, but I'm going with Deploying because I'm not advocating for this option to be removed or anything, I'm just curious why it's there and what other people's thoughts about it are.


We should raise the default to some huge number though.
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


I've put the default for the next patch release up to 255

https://github.com/ocproducts/composr/commit/adb6534ae629fc3eca6a035bca1c138ffcf3519f
Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon
- If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
- If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
- If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
- If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.


Sorry I enjoy putting my two cents out there sometimes.



As Chris said, I would assume one of the more common cases would be password managers (LastPass, KeePass/KeePassX, KWallet/GNOME Keyring, etc.) I don't use them myself, but I know they're quite popular with the technical crowd. When configured properly, they should generate properly diffucult passwords, and they shouldn't store the passwords on the disk in plaintext or anything insecure like you're suggesting. They're written specifically for this purpose, after all.Joe said
I get security and all, but why the heck would someone want such a long password anyways? They'd have to write it down or copy and paste it all the time, or have the browser remember it.
From “Post #5,115”, 17th October 2018, 10:21 pm
The other common case would be if someone is following the advice of this XKCD and using easy-to-remember sentences of English words, which can theoretically be harder to brute-force in this day and age where everyone knows the common tricks about using numbers and symbols.
Or the user could always be writing their passwords down on a Rollodex like I do. Can't hack that, and if someone unauthorized gets a hold of it, you've got bigger problems with your security, particularly on Layer 1.



jacobgkau said
When configured properly, they should generate properly diffucult passwords, and they shouldn't store the passwords on the disk in plaintext or anything insecure like you're suggesting.
Right. I meant more along the lines of the user storing it on their computer. If it's incredibly long, chances are if they don't have it written in their Rolodex, it's stored in a text file on their computer.



Joe said
jacobgkau said
When configured properly, they should generate properly diffucult passwords, and they shouldn't store the passwords on the disk in plaintext or anything insecure like you're suggesting.
Right. I meant more along the lines of the user storing it on their computer. If it's incredibly long, chances are if they don't have it written in their Rolodex, it's stored in a text file on their computer.
From “Post #5,117”, 18th October 2018, 1:15 am
Right, I'm just responding to your suggestion that long passwords must be easy for attackers to eavesdrop. If you're not aware of how a password manager works, the user only remembers one password for the manager itself, and the manager generates and remembers the rest of the passwords, which could be 100+ characters for all the user cares. As I said, password managers wouldn't just store those in a "text file," it would be a database file that's then encrypted in some fashion, depending on the program. If someone were to obtain the database from the disk, they wouldn't be able to read the passwords without cracking the master password and potentially needing to obtain something else required for decryption, e.g. a private key, which might be stored on a flash drive or other device.
Other attack surfaces (keyloggers, clipboard monitors, etc.) would vary in effectiveness based on the specific program and how it operates. I can tell you they wouldn't be much of a threat on a Linux distribution running Wayland (since Wayland isolates applications from reading each others' input and output), but I could see your concern on a poorly-secured Windows machine.
If you're just talking about the edge case of users keeping passwords in a .txt file, I'm sure that happens with short passwords, too. I would think most people who go out of their way to use 20+ character passwords would know not to store them in plaintext, but maybe my expectations are too high.
Just my two cents, as well.



Still though, I like to keep my passwords not too short, but not too long to where I can't remember them!


Not all passwords have to be generated by a password manager, it's easy to add any exisiting ones that you already use. Password managers offer to generate more complex passwords than cPanel as they don't need to be remembered and can easily be checked and revealed if required. Also (again using LastPass as an example) your password vault is available across many devices and is more secure than any native browser password manager.