Solved

Password validation check

Posted on 2012-03-15
6
250 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 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

828 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