TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why do some Services enforce a maximum password length?

2 点作者 saladoc超过 1 年前
Shouldn't the password length be irrelevant since they are hashed anyway? Is a service enforcing a maximum length a sign of plain text passwords being stored or are there legitimate reasons?

6 条评论

LinuxBender超过 1 年前
I can&#x27;t explain the artificially low restrictions some banks have beyond using outdated tech or poorly designed database schemas. If I had to guess it could having an upper limit based on some formula consisting of average number of registering users combined with hashing CPU cost. That is why OpenSSH has limits on how big of a RSA public key may be accepted. It was set to 32K, not sure what it is currently set to. Unlimited would be a DDoS vulnerability and could potentially get a CVE unless some other mitigating control were in place. But I don&#x27;t know if that same logic is being used for password hashing and limits, it&#x27;s just a guess. I could also think of a dozen ways to mitigate such risks and I am not a developer so maybe its something simpler like the answer for crypt [1] <i>answer was reused for this topic, was originally used for crypt using DES. I&#x27;ve been that chimp.</i><p>[1] - <a href="https:&#x2F;&#x2F;security.stackexchange.com&#x2F;a&#x2F;33471" rel="nofollow noreferrer">https:&#x2F;&#x2F;security.stackexchange.com&#x2F;a&#x2F;33471</a>
rzzzwilson超过 1 年前
As others have said, their are infrastructure reasons to limit password length. But that limit should be set at 128 characters or more. There&#x27;s no reason, apart from incompetence, why a password length is set to 12 that some banks use.
KRAKRISMOTT超过 1 年前
You have to limit the content length on the server side to prevent requests from choking up. So usually instead of having to sync up requirements between client and server, lazy devs just choose a simple number and enforce it globally. Especially for a lot of enterprise apps the login forms are scattered across multiple systems built by various devs. Some random contractor might just add a length validation for cargo cult. Also some databases require you to specify specific string length for entries and inexperienced devs may not understand that hashes have a constant length output.
navjack27超过 1 年前
The one I hate is for supplemental nutritional assistance program in America. Their login system has a limit on character types, length, and it expires after a couple months, and if you fuck up entering it too many times (3) you can only reset by calling them.<p>Edit: I entered it right three times on a day that their server was fucked up and now I can&#x27;t log into my account lol! Fuck that, I&#x27;m not calling... Well, unless for some reason that disables the card which it shouldn&#x27;t...
warrenm超过 1 年前
rzzzwilson nailed it[0] - there <i>has</i> to be a limit so it&#x27;ll fit in the POST to the server<p>That said, since you can POST absurdly-large quantities of data, that limit ought to be <i>huge</i><p>-------<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37995647">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37995647</a>
beardyw超过 1 年前
From prehistory when they were stored in plain text or just obfuscated.