Given a password entered by the user, check its strength and suggest some password if it is not strong.
Criteria for strong password is as follows :
A password is strong if it has :
1. At least 8 characters
2. At least one special char
3. At least one number
4. At least one upper and one lower case char.
Input : keshav123 Output : Suggested Password k(eshav12G3 keshav1@A23 kesh!Aav123 ke(shav12V3 keGshav1$23 kesXhav@123 keAshav12$3 kesKhav@123 kes$hav12N3 $kesRhav123 Input :rakesh@1995kumar Output : Your Password is Strong
Check the input password for its strength if it fulfills all the criteria, then it is strong password else check for the absent characters in it, and return the randomly generated password to the user.
Suggested password geek@201K8 geek@201S8 gOeek@2018 geek@201N8 geek@2P018 geek@D2018 geUek@2018 geek@2Q018 geek@2F018 geekZ@2018
Time complexity : O(n).
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.
- Minimum characters required to make a password strong
- Program to check Strength of Password
- Program to check the validity of a Password
- Generating OTP (One time Password) in PHP
- How to validate a Password using Regular Expressions in Java
- A Program to check if strings are rotations of each other or not
- Write a program to print all permutations of a given string
- Write a program to reverse an array or string
- Program to validate an IP address
- Program to generate CAPTCHA and verify user
- Program to toggle all characters in a string
- Create Directory or Folder with C/C++ Program
- Program to find second most frequent character
- C Program to Swap two Numbers
- C Program to Sort an array of names or strings
- C Program to Check if a Given String is Palindrome
- Program to print all palindromes in a given range
- C++ Program to remove spaces from a string
- Remove comments from a given C/C++ program
- Program to add two binary strings
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.