A password is said to be strong if it satisfies the following criteria:
- It contains at least one lowercase English character.
- It contains at least one uppercase English character.
- It contains at least one special character. The special characters are: !@#$%^&*()-+
- Its length is at least 8.
- It contains at least one digit.
Given a string, find its strength. Let a strong password is one that satisfies all above conditions. A moderate password is one that satisfies first three conditions and has length at least 6. Otherwise password is week.
Input : "GeeksforGeeks!@12" Output : Strong Input : "gfg!@12" Output : Moderate
Strength of password:-Strong
This article is contributed by Apurva Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to check the validity of a Password
- Strong Password Suggester Program
- How to validate a Password using Regular Expressions in Java
- Minimum characters required to make a password strong
- C Program to Check if a Given String is Palindrome
- Python program to check if a string is palindrome or not
- Program to check if input is an integer or a string
- Program to check for ISBN
- Program to check if a number belongs to a particular base or not
- Program to check for a Valid IMEI Number
- Program to check if all characters have even frequency
- Python program to check if a string contains all unique characters
- Python program to check if given string is vowel Palindrome
- Program to check if two strings are same or not
- Python program to check if given string is pangram
- Java program to check whether a string is a Palindrome
- Program to check if the String is Null in Java
- Program to check if the String is Empty in Java
- Program to check if a String in Java contains only whitespaces
- C++ program to check whether a String is a Pangram or not
Improved By : Yash_R