Passwords are the most basic information protection devices. But many people compromise the security of their data by choosing passwords that are easy for a human or a bot to guess. The table below summarizes one set of criteria for determining the strength of a password, and shows how to apply these criteria to two different example passwords.
|Score||Description||Ex 1||Ex 2|
|Length||Score points for each character in the password.|
|Basic Requirements||To qualify, must be at least chars long and also contain of the four basic character types (uppercase letters, lowercase letters, digits, and symbols*). Score two points for the length plus another two for each of the four types of characters it contains.||—|
|Uppercase||Add , where is the number of uppercase letters and .||—|
|Lowercase||Add , where is the number of lowercase letters and .||—|
|Digits||Add , where is the number of digits, but only if .||—|
|Symbols||Add , where is the number of symbol characters.||—|
|Middle Digits and Symbols||Add , where is the number of digits and symbols not in the first or last position.|
|Letters Only||If the password contains only letters, subtract point for each letter.||—||—|
|Digits Only||If the password contains only digits, subtract point for each digit.||—|
|Consecutive Uppercase||Subtract for each set of consecutive uppercase characters.||—|
|Consecutive Lowercase||Subtract for each set of consecutive lowercase characters.||—|
|Consecutive Digits||Subtract for each set of consecutive digits.|
|Sequential Letters||Subtract , where is the length of the longest case-sensitive sequence of letters longer than (e.g.
|Sequential Digits||Subtract , where is the length of the longest sequence of digits longer than (e.g.
|TOTAL SCORE||Add up all the above. Negative scores become . Scores over become .
* A symbol is any character that is not a letter or digit.
The input contains ten passwords, one per line. Write a program that reads each password, computes its total score based on the above criteria, and categorizes the password as
ECOO()123abcd9876 1234512345 ecoo2012
Very Strong (score = 100) Very Weak (score = 19) Good (score = 47)
Note: Only cases are shown in this sample.
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org