TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What are valid reasons for limiting password length?

10 pointsby RobinUS2over 11 years ago
I personally get very frustrated if websites reject my 128 character random generated passwords with some error message like &quot;Password too long, maximum of 16 characters&quot;.<p>Are there any (legit) reasons for doing this? I couldn&#x27;t come up with one as they should hash them, and it doesn&#x27;t matter for the hash function whether the input is 1 or 1000 characters long. Performance loss is minimal.<p>It really feels like they are using encryption, instead of hashing. Which would be a major security issue.

9 comments

frou_dhover 11 years ago
If it was in fact 1-1000 then some nerd would be complaining about <i>muh 1024 convention</i>. Next, the 1MB guy.<p>I don&#x27;t see how where the line is drawn (and realistically it has to be drawn somewhere for a public service) necessarily implies anything about whether proper hashing is being done.
bdfh42over 11 years ago
I am sure you are quite correct - any limitation (within reasonable bounds for a web page control) is a strong indication that a web site is not hashing you password. At best they are encrypting it - and that is bad bad bad.
评论 #6784188 未加载
6thSigmaover 11 years ago
Websites that allow you to use a 128 character PW could very well be cropping it at whatever their max PW length is FWIW.
csixty4over 11 years ago
Depends what you mean by &quot;legit&quot;. I once asked a project manager if the client had and legally-mandated rules for passwords. The response from the client was (paraphrased) &quot;no legal requirement. Let&#x27;s go with 6-12 characters, at least one number and one symbol&quot;. I suggested a higher (or no) upper limit, but I was told to just give them what they wanted.<p>&quot;It&#x27;s what the client wants&quot; is a rather legit reason, whether the rules come from a legal standard for their industry or completely out of their rear end.
wnevetsover 11 years ago
Would the performance lost be minimal if my password is 1GB in size?
评论 #6782921 未加载
byoung2over 11 years ago
Maybe they are storing your password in plain text in a VARCHAR(16) field, which is a scary thought. It is also likely that enforcing a short password encourages users to choose passwords that are easy to remember...longer passwords would encourage users to write them down or keep them in a text file.
评论 #6783043 未加载
Wezcover 11 years ago
I never thought about your situation. As a kid web dev I used to limit password size for db issues as &#x27;byoung2&#x27; said: like using a VARCHAR(42) or something like taht depending on the way I store the hash! Anyway, next time I&#x27;ll think about you and allow user more space for password! :)
评论 #6784148 未加载
jeffblakeover 11 years ago
My bank required that I could only use a 6 character alphanumeric password when signing up. Kind of scary, but then again, it made me choose a super random PW like v3Ff78 whereas most all people in that situation would use their same password for everything, such as baseball. Thats my theory anyway
评论 #6785393 未加载
andrewcookeover 11 years ago
the only limit that comes to mind is 16kB (IIRC some servers limit at that) for an HTTP header parameter (since presumably it will be posted).<p>but as others have said, the reason is likely to be blind following of poorly thought-out specs.