Weak Password
Introduction
An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.
Requirements
A password strength policy should contain the following attributes:
Minimum 8 characters in length
Contain both upper and lowercase alphabetic characters (e.g. A-Z, a-z)
Have at least one numerical character (e.g. 0-9)
Have at least one special character (e.g. ~!@#$%^&*()_-+=)
Solution
Regex:
This regex is common for all programming languages and make sure it has validated..The below regex has a minimum length of 8 characters, contain at least a capital letter, a small letter, a number, and a special character.
Modification in rules?
Let' say you want minimum x characters small letters, y characters capital letters, z characters numbers, Total minimum length w. Then try below regex
References
Last updated
Was this helpful?