php - preg_replace Filter for Passwords -


With PHP, I want to use a preg_replace () filter for the password, such as the only letters available for password US Is ASCII Typeable, Minus Control Code and Tap

Can I plug in preg_replace ()? What is RegEx to get?

Edit:

I have been advised to edit this question because I get it "now" and it will not be very popular And also will not allow any specific character, which can not be on my keyboard, just as long as they are not controlled by the code.

As others have said, do not restrict the set of characters only because the password is allowed only That does not have A, O, or ö in your keyboard, so there is no reason to stop those people (or how they are typed) using those letters. Are you going to store passwords (or at least as an encrypted string) in the form of cryptographic hash, are not you? If so, it does not matter that your database can safely store / safely store the actual characters in the password in any way, only the character output by your crypto algorithm. (And if not, saving the password in plain text is an away big problem, which characters may have a password or not - they do not!)

Instead of telling your users silently to implement your character set restrictions, you try to strip off the characters you dislike and try again and, this time, only use these characters: a, e, i, o , U. " Actually makes your proposed method cruel, because it means that if I try to use, then password should be against fäîry (not against light attack attacks, but lightweight dictionary attacks ), My actual password is unknown to me, Frye (If your password is a three-word word, directly in the dictionary and in general use, you will not be disturbed too). Hey!


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -