[Solved] CMSC204 Assignment #1- Passwords Checker

$25

File Name: CMSC204_Assignment_#1-_Passwords_Checker.zip
File Size: 376.8 KB

SKU: [Solved] CMSC204 Assignment #1- Passwords Checker Category: Tag:
5/5 - (1 vote)

Concepts tested by this program:

ArrayList

static

Read Files

Javadoc

JUnit Tests

Exceptions

Create an application that will check for valid passwords. The following rules must be followed to create a valid password.

  1. At least 6 characters long
  2. 10 or more characters is a strong password, between 6 and 9 characters is a weak (but acceptable) password.
  3. At least 1 numeric character
  4. At least 1 uppercase alphabetic character
  5. At least 1 lowercase alphabetic character
  6. At least 1 special character
  7. No more than 2 of the same character in a sequence

[email protected] OK

[email protected] not OK

[email protected] OK

Operation:

When the application begins, the user will be presented with a screen that states the above instructions for creating a password, two text entry boxes for typing in a password, and three buttons.

If the user wants to check a single password, they will type in the password in both boxes and select the Check Password button.

If the user wants to read in and check a list of passwords, they will select the Check Passwords in File button, be presented with a file explorer, and select the file to read from. Those passwords that failed the check will be displayed, with their error message.

Specifications:

The Data Element

String

The Data Structure

ArrayList of Strings

Utility Class

  1. Create a PasswordCheckerUtility class based on the Javadoc given you.
  2. The PasswordCheckerUtility class will have at least three public methods:
  • isValidPassword:

This method will check the validity of one password and return true if the password is valid and throw one or more exceptions if invalid.

  • isWeakPassword:

This method will che throw an exception.

  • getInvalidPasswords

This method will check an ArrayList of passwords and return an ArrayList with the status of any invalid passwords (weak passwords are not considered invalid). The ArrayList of invalid passwords will be of the following format:

<password><blank><message of exception thrown>

  • For each password requirement, you must have a static private method that validates the password for that requirement and throws an exception if invalid.
  1. Create a separate exception classes for each exception listed in PasswordCheckerUtility Javadoc.

Hints:

  • The GUI will check for the length of the password first, since that is the easiest and fastest check. Once the password fails one rule, there is no need to check the rest of the rules.
  • To check for a special symbol, use the regular expression construct. Check the whole password, not just an individual character, using the following :

Pattern pattern = Pattern.compile([a-zA-Z0-9]*);

Matcher matcher = pattern.matcher(str);

return (!matcher.matches());

The GUI (provided):

The GUI has been provided, however you need to:

  • The GUI will ask the user to enter the password and to re-type the password. If the two are not the same, inform the user.
  • Use methods of PasswordCheckerUtility to check validity of one password when user clicks on Check Password button.
  • Use methods of PasswordCheckerUtility to check validity of a file of passwords when user clicks on Check Passwords in File button.
  • Use a FileChooser for the user to select the input file.
  • Use try/catch structure to catch exceptions thrown by PasswordCheckerUtility methods

Exceptions

Provide exception classes for the following:

  1. Length of password is less than 6 characters (class LengthException)

Message The password must be at least 6 characters long

  1. Password doesnt contain an uppercase alpha character (class NoUpperAlphaException)

Message The password must contain at least one uppercase alphabetic character

  1. Password doesnt contain a lowercase alpha character (class NoLowerAlphaException)

Message The password must contain at least one lowercase alphabetic character

  1. Password doesnt contain a numeric character (class NoDigitException)

Message The password must contain at least one digit

  1. Password doesnt contain a special character (class NoSpecialCharacterException)

Message The password must contain at least one special character

  1. Password contains more than 2 of the same character in sequence (class InvalidSequenceException)

Message The password cannot contain more than two of the same character in sequence.

  1. Password contains 6 to 9 characters which are otherwise valid (class WeakPasswordException)

Message The password is OK but weak it contains fewer than 10 characters.

  1. For GUI check if Password and re-typed Password are identical (class UnmatchedException)

Message The passwords do not match

Throw this exception from the GUI, not the utility class.

Note: If more than one error is present in a password, use the above order to throw exceptions. For example, if a password is xxyyzzwwaa$, it fails rules 2 and 4 above. Throw a NoUpperAlphaException, not a NoDigitException.

Student Junit methods:

  • Use the file PasswordCheckerUtility.java
  • Setup: include passwords that meet the below criteria.
  • Teardown: set your student passwords ArrayList to null
  • for each password requirement method in the PasswordCheckerUtility you must have a test case that passes and another one that fails

When you launch the GUI, this is what you will see.

If you select the button which reads Check Passwords in File, you will be presented with a file chooser. You must navigate to where you stored the file passwords.txt and load it. The file will be in the following format (one password per line):

Examples:

  1. No lowercase alphabetic character

Displayed to user:

  1. No digit

Displayed to user:

  1. If the password is OK, but between 6 and 10 characters, you will see:
  2. If password has more than two of the same characters in a row

Displayed to user:

  1. If password is valid
  2. If the passwords do not match:

Displayed to user:

  1. Based on the file above, when the user selects Check Passwords in File:

Displays errors to user when selecting Check Passwords in File. Note that valid passwords (including weak but otherwise valid passwords) are NOT displayed.

Deliverables:

Design:

Initial design document (UML and/or pseudo-code)

Implementation:

Final design document

Java files The src folder with your driver (javafx application), data manager, exceptions and Junit Test (.java) files

Javadoc files The entire doc folder with your javadoc for student generated files

Learning Experience document

GitHub screen shot

Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats:

LastNameFirstName_AssignmentX.zip [compressed file containing following]:

doc [a directory] include the entire doc folder with the javadoc for

student generated files

file1.html (example)

file2.html (example)

class-use (example directory)

LearningExperience.doc or other text format

src [a directory] contains your driver (javafx application), data manager, exceptions and Junit Test (.java) files

File1.java (example)

File2.java (example)

File_Test.java (example)

GitHub screen shot.

LastNameFirstName_AssignmentX_Moss.zip [compressed file containing only]:

.java file which includes the driver (javafx application), data manager, exceptions and Junit Test (.java) files NO

FOLDERS!!

File1.java (example)

File2.java (example)

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CMSC204 Assignment #1- Passwords Checker
$25