We have learned the basic C++ features needed to write structured programs so we can begin to focus more on program design and problem solution. The object of this assignment is to analyze a problem, design a solution, then write a program to solve it. You are to design and write a program to perform password strength analysis by looking up a password in a common password table and/or calculating its strength rating by calculating the "entropy" of a password.
1. Ask the user to enter any password to have its strength checked.
2. Make sure the entered password is not in a list of common passwords.
3. If the password is in the list, display its position in the list and reject it because it is a common password.
4. For passwords that are not rejected in the previous step:
5. For this program we will assume that passwords can consist of lower case, upper case, digits and special characters.
If the user presses 'enter' with an empty line, randomly generate and display a "Strong" password (Entropy >= 60 but <128), then calculate and output the actual entropy of the password.
E = log(RL) Or Log2(RL)
L = The Length Of The Password*
R = The Sum Of The Character Pools Represented In The Password According To The Following Table*:
Character Type | Pool Size (R) |
Lower case | 26 |
Upper case | 26 |
Digit | 10 |
Special Character | 32 |
All Character Types | 94 |
*For example:
NOTE: For this program we will assume that passwords can consist of lower case, upper case, digits and special characters.
Entropy | Rating |
< 28 | Very Weak; might keep out family members |
26 - 35 | Weak; should keep out most people, often good for desktop login passwords |
36 - 59 | Reasonable; fairly secure passwords for network and company passwords |
60 - 127 | Strong; can be good for guarding financial information |
128+ | Very Strong; often overkill |
Enter a password to determine its strength ('quit' to exit):
further
Password 'further' strength is: Weak
Enter a password to determine its strength ('quit' to exit):
Father
Password 'Father' strength is: Weak
Enter a password to determine its strength ('quit' to exit):
Furth3r
Password 'Furth3r' strength is: Reasonable
Enter a password to determine its strength ('quit' to exit):
F^rth3r
Password 'F^rth3r' strength is: Reasonable
Enter a password to determine its strength ('quit' to exit):
e3tf5$E3-=
Password 'e3tf5$E3-=' strength is: Strong
Enter a password to determine its strength ('quit' to exit):
charles
Password 'charles' ranks 218 in common password list.
Enter a password to determine its strength ('quit' to exit):
1qa2ws
Password '1qa2ws' ranks 5722 in common password list.
Enter a password to determine its strength ('quit' to exit):
1234qwer
Password '1234qwer' ranks 109 in common password list.
Enter a password to determine its strength ('quit' to exit):
quit