r/PHPhelp • u/Piano1987 • Jan 23 '24
Is there any valid reason to limit which characters are allowed for a password?
Had to work on a password reset feature today in our codebase and I noticed that we limit which characters are allowed to use in a password. Most of the stuff you find on a english keyboard is fine but still, why do that at all?
The whole thing gets hashed anyway so whats the point? Could there be characters that break the hash algorithm?
I asked my seniors but they couldn’t think of a reason why it was built that way. A dev who left last year told me that back when he started at the company they were still saving passwords in plain text. So my theory is that this character limitation stems from back then to make sure the database could handle the passwords and nobody bothered to remove it since then.
Is this a bad practice or does it not really matter?