Solved

Password validation check

Posted on 2012-03-15
6
252 Views
Last Modified: 2012-06-21
I would like to check a user's password as they enter it to make sure it has Capital letters, numbers and a special characters. I have the code to pass  and check the information as it is being entered. but is there a easy way to find out if at least one on the characters being passed in the form filed is a Capital letter, number and a special character?
0
Comment
Question by:overcolor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 500 total points
ID: 37728773
yes, its simple, just implement a check like this where you are checking for the password validation

<cfif NOT RefindNoCase("^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$",form.passwd)>
Password must be at least 4 characters, no more than 8 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit.
</cfif>
0
 
LVL 16

Assisted Solution

by:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 500 total points
ID: 37728786
or for more detailed this is the one

<cfif not refindnocase("(?=^.{6,10}$)(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&amp;*()_+}{&quot;:;'?/&gt;.&lt;,])(?!.*\s).*$",form.passwd)>
It expects atleast 1 small-case letter, 1 Capital letter, 1 digit, 1 special character and the length should be between 6-10 characters. The sequence of the characters is not important. This expression follows the above 4 norms specified by microsoft for a strong password.
</cfif>
0
 

Author Comment

by:overcolor
ID: 37730494
Now you just changed my thought process, is there a way to tell them if there password is Week, Good or Strong as they type their password using this code. Should I ask this in a new question on Expert-exchange?
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 52

Expert Comment

by:_agx_
ID: 37730566
(no points...)

If you do use a big combined regex, be sure to understand it.  I'm not so hot with regex's so I usually use smaller ones so I know they work they way they want.

I think the "weak,strong,.." question should be a new thread. But I think the answer depends on your criteria. Anyway you might want to check cflib.org and see what it has to offer in the area of password functions, like

http://www.cflib.org/udf/passwordCheck
http://www.cflib.org/udf/MakePassword

Good luck!
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 37730956
yeah, open a new question related to this question regarding checking weak, strong, we can guide u
0
 

Author Comment

by:overcolor
ID: 37731837
I did open a new question, can you please check for it "Check for password strength as the person creates it"

Thank you

In the mean time, I'm going to play with this current post..
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question