Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Password validation check

Posted on 2012-03-15
6
Medium Priority
?
267 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
  • 3
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 2000 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 2000 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
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…
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

877 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