Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Password validation check

Posted on 2012-03-15
6
Medium Priority
?
263 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 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
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

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…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

721 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