Solved

Password validation check

Posted on 2012-03-15
6
243 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 15

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 15

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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 15

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now