Re: Why do you want to limit a password length
Hi Will
Algorithms like bCrypt limit password length to 72 characters, though many people use SHA256 to "pre-hash" the input in a futile attempt to increase security. Even algorithms which don't specify a max limit can adversely affect performance at higher numbers, thus forcing a sensible limit to be imposed by the developers.
I won't bore you with chapter & verse, but it essentially boils down to this.
If your password is chosen at random (ie - by a password manager, not a human) and you're allowed to use mix-alphanumeric (a-z, A-Z, 0-9), there's no appreciable security benefit between 15 characters and 500, even if the site uses something as weak/broken as MD5. 62^15 (62 possible characters - to the power of 15, the length) is such a monumental key space, it's already computationally infeasible to break. Adding another 15/30/50/100 characters is technically "more secure" but in terms of mitigating real-world risk, there really is no benefit at all.
But...
If a site limits the character set (for example, you can't use uppercase), the length must be increased to make up for the loss in entropy.
log2(26) = 4.7 bits of entropy per character (26 being a-z)
log2(52) = 5.7 bits of entropy per character (52 being a-z, A-Z)
To achieve 80 bits of entropy (very strong, sufficient for financial transactions etc), you'd need 17 characters with just lowercase... or 14 with upper & lower.
I recommend 50 characters because it strikes a balance between robust security & performance, as modern hardware can churn through a 50 character password almost as quickly as 15 characters.
Cheers