Often we require to set up passwords while making a new account on different platforms. There are certain things which can be done to make your password secure from potential threats. It is therefore recommended to keep certain things in mind and follow some practices in order to make your password fool-proof. This program checks the strength of your password on the following parameters:
- Password is atleast 8 characters long
- Password is atmost 16 characters long
- Password contains atleast one lowercase letter
- Password contains atleast one uppercase letter
- Password contains atleast one special character
- Password contains atleast one digit
- Password doesn't have 3 uppercase or 3 lowercase letters together (for instance, sequences such as '...UJL..' or '...asg...' are not allowed)
- Password doesn't have 2 consecutive digits one after the other (for instance, '....45...' is not allowed whereas '....46...' is allowed)
Now remember this program's function is to determine the strength of your password on the above parameters and not to restrict you from creating a password which violates one or more of these conditions. Hence for the purpose of strength categorization, we will create certain conditions and assign numerical values to denote the strength where higher the number, higher is the strength of the password. The program counts how many of the above conditions are met by the input password. Based on that:
- If count<2, strength = 0
- If count is between 2 and 4 inclusive, strength = 1
- If count is between 5 and 7 inclusive, strength = 2
- If all 8 conditions are met, strength = 3
Hence, strength of 3 denotes a highly secure password whereas a strength of 0 denotes a very weak password.