Forum Moderators: coopster
If you provide specific information about what you want to filter in the passwords we might be able to get some code flowing ;)
Read the third message in this thread [webmasterworld.com] for more details.
I am going to have to use that, well said
don't worry about what chars they use for their password unless you are forcing them to use a stronger password
I would say 10 is a bit short, make sure they don't use one that is too short
Yes, I immediately regretted having said that because I actually have never done that, and also realized that I never addressed the actual thread's question in the first place: storing passwords.
I'd have to agree with greg; I always hash the password, too, using MD5 [php.net] mostly, but there are others that would work just as nicely. If you are storing the passwords in a database, make sure you allow for enough bytes in the password column to hold a hash, which I believe is around 41 bytes (don't quote me on that, I'm not thinking straight today! ;))
$password_hash = md5( $_POST['pass'].'some secret string');
Otherwise, an attacker who obtains your database of MD5'd passwords can compare the stored hashes against a table of hashes for common passwords to "guess" what the true password really is.
For example:
echo md5('abc123'); // e99a18c428cb38d5f260853678922e03
If an attacker can access your user database and sees "e99a18c428cb38d5f260853678922e03" as the password hash, they could reasonably assume that "abc123" is the actual password. Since people tend to use the same password everywhere, you may have just given away a users bank password. Concatenating a secret string with the password before hashing it solves this problem.