Program in Java. Sample text in the CSV file is below:
604192 | Evans | Fatima | FatimaWEvans@cuvox.de | Sued1968 | 5891.63 | zonked98 | | |
670220 | Lowery | James | JamesKLowery@gustr.com | Soner1961 | 4734.29 | bonvoyage23 | |
Keys for the simple substitution cipher usually consist of 26 letters. An example key is: plain alphabet : abcdefghijklmnopqrstuvwxyz cipher alphabet: phqgiumeaylnofdxjkrcvstzwb plaintext : defend the east wall of the castle ciphertext: giuifg cei iprc tpnn du cei qprcni The substitution cipher can be implemented using arrays and you may include upper and lowercase letters, digits and special characters when needed. This assignment allows you to practice exception handling while using a simple cipher. The assignment requires you read from a text file The assignment requires you to prepare a report in the form of a text file (which can be viewed in a text editor or printed at a later date). Reports include titles, column headings, dates, detailed lines of data, and optionally summaries, totals, and counts Step 1: Customer Class A local bank needs a new Customer class. You are tasked with creating the class and testing it. The Customer class should include: 1. The following instance data: Customer ID - 6 digits represented as a String last name - String first name - String email address - String user name - String bank balance - float password - String 2. A constructor which requires 7 parameters (the items listed above). The following could be a sample instantiation of an object from the Customer class: Customer bank Customer = new Customer ("123456", "Smith", "John", "jsmith0001@ .edu","jsmith0001", 1511.20, "Sillygoat213"); All passwords will be encrypted when an object is instantiated. This means the constructor should call the encypt() method to encrypt the password. 3. An encrypt()method (required by the Encryptable interface): o O Use a substitution cipher to encrypt the password. Passwords contain upper and lowercase letters and digits. You may develop your own substitution cipher. 0 You may use static arrays (as class data) to hold the plain alphabet and the cipher alphabet. Remember, you will need to include digits since passwords may include these characters. 3. An encrypt()method (required by the Encryptable interface): o Use a substitution cipher to encrypt the password. Passwords contain upper and lowercase letters and digits. You may develop your own substitution cipher. You may use static arrays (as class data) to hold the plain alphabet and the cipher alphabet. Remember, you will need to include digits since passwords may include these characters. o 4. A decrypt()method (required by the Encryptable interface): o Use a substitution cipher to decrypt a password and return the decrypted password. DO NOT update the encrypted password for the object. This method simply returns a decrypted version of the password but does not update the password. 5. Include accessors and mutators for the class data as you deem necessary with security in mind. Include a comment within the class to explain how you secured the class." 6. Include a toString() method to build and return a string that contains class data that you deem appropriate from a security point of view. Step 2: Test the Customer class The bank wants you to create a program to test your new class. To do this, create a driver program named CustomerList which reads through the Customer.csv file and outputs the following formatted like a report: Customer ID First name Last name Original password from the text file Encrypted password - using the accessor for password Decrypted password - using the decrypt() method Note: You are not updating the Customer file, you are simply testing your new class. The driver will read a record from Customer.csv instantiate a student object with the data from the record (which encrypts the password) use accessors to prepare a line of output in the report Include headings, the current date, and a record count in the report. Step 3: Exceptions In addition to using encryption to store passwords, the bank is debating whether or not to enforce new password rules: Passwords should be 10 characters or longer and Passwords must contain letters and digits. You are to determine how many current customers violate the proposed new rules. Create a class called InvalidPWException to help with this. You will add some additional processing to your CustomerList program which tests the Customer class. Create a new InvalidPWException object in the driver program for: Password is too short. Password not complex. Your program should throw an exception if the password is too short and/or if the password does not contain letters and digits (is not complex). Count the number of each type of exception you encounter and display the counts at the end of the report. Add a new column to the report. This column indicates errors. If an error occurs, display the appropriate message: Too Short Not Complex Too Short and Not Complex