Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java 1. This step is toCreate a new Customer Java class which implements the Encryptable interface on page 426. To make it a little easier,

java

1. This step is toCreate a new Customer Java class which implements the Encryptable interface on page 426. To make it a little easier, you can start with a copy of the Secret class (pages 426-428). These files should be among the Student Data Files you downloaded at the beginning of the semester. The Customer class should include: The following instance data: 1. Customer ID 6 digits represented as a String 2. last name - String 3. first name - String 4. email address - String 5. user name - String 6. bank balance float 7. password - String 8. encypted - boolean Remove any code/variables from Secret that is not needed by Customer. A constructor which requires 7 parameters (the first 7 shown above). The following could be a sample instantiation of an object from the Customer class: Customer bankCustomer = new Customer (123456, Smith, John, jsmith0001@kctcs.edu, jsmith0001, 1511.20, Sillygoat213); Since all of the passwords currently in the file are not encrypted, the constructor should set the encrypted data item in the class to FALSE. A definition for the encrypt( )method (required by the Encryptable interface): o This method uses a simple technique to encrypt a password: Reverse the order of the characters in the password (for example, if the password is Sillygoat213, it would become 312taogylliS. You are NOT permitted to use the StringBuffer class. This assignment is partially designed to review string manipulation. o Use the Caesar cipher, shown in the Secret class in Chapter 9, to further encrypt the reversed-order version of the password use a set shift value of 4. o This method should update the password to the encrypted password you generated and change the encrypted data item to TRUE. A definition for the decrypt( )method (required by the Encryptable interface): o This method uses a simple technique to decrypt an encrypted password. Use the Caesar cipher, shown in the Secret class in Chapter 9, to shift the encrypted passed by -4. Then reverse the order of the characters in the password. You are NOT permitted to use the StringBuffer class. o This method should update the password to the decrypted password you generate and change the encrypted data item to FALSE. From a security point of view, think about which data items in the class need accessors. Create those accessors. Include a comment in the Customer class file which explains why you chose the ones you did and why excluded the others. Create the accessors that you chose. You do not have to create any mutators for the data items for this assignment. However, include a comment in the Customer class file as to which you feel need a mutator and why. Include a toString( ) method to build and return a string that contains all instance data items in a nice format. In Blackboard, a file named Customer.csv was included with this assignment. It contains a list of 200 Customer records. All of the passwords in this file are currently not encrypted. 2. The bank wants you to create and test a program that would encrypt customer passwords. To do this, create a driver program named CustomerList which reads through the Customer.csv file and displays First name Last name Original password Encrypted password Note: You are not updating the Customer file, you are simply displaying the old and new password. The accessors will help with this. The driver will simply read a record, display name and original password, encrypt the password, and display the new encrypted password. The bank is debating whether or not to enforce a password rules: passwords should be 10 characters or longer You want to know how many records in the file currently have invalid passwords if the new rules were initiated. Create a class called InvalidPWException to help with this. This will be similar to the OutofRangeException class on page 454 of the textbook. This is pretty simple. Dont overcomplicate this. 3. Create a copy of the driver, naming it CustomerExceptions. Create a new InvalidPWException objects in the driver program for: password is too short The new driver program should throw an exception if the password is too short. You might want to refer to the CreatingExceptions program on page 453. Display only records with passwords which are too short: First name Last name User ID Password (this will not be encrypted) Error message

Customer file

image text in transcribed

bzedan2017@gmail.com Customer -Excel File Insert Page Layout Formulas Data Review View Add-ins Help Team Tell me what you want to do Genera' Conditional Formatting E-Insert . . A 111 . AA--9-M- Calibri $ . % , Delete . Format as Table. Cell Styles Paste B 1 u.lm. 2.. Clipboard F7 _ E , Format. Filte Font Alignment Number Styles 1617622 Thomas Regina ReginaRT Therwase 6812.2 boorish62 2 139016 Friend Lia LiFrien Womilorg 3525.32 daughter39 3 590106 Tighe Allan AllanGTiglOurighter 2225.75 hope7s 4 635541 McDaniel Josephine Josephine Recare 5841.61 spiffy14 5 548459 Brown Andrew AndrewKE Pokinklan 5521.38 mice36 6 164016 Brock Brian BrianMBrc Fick1954 3506.69 animated96 7696036Ayla Gloria GloriaEAy Whourpe 1242.66mard66 8 290593 Gorman Samuel SamuelEG Idowed 5639.14 immense63 91225635 Logan Robert RobertCLcMajesigh 8338.41 fiveappless 10216332 Leach Karen KarenVLe. Buthrotim 1898.08 beastly33 11225880 Lair Larry LarryKLair Chancer 6332.63 smasherino91 12 566834 Lundy Karen KarenWLu Kner1956 4838.61 magenta97 13 350381 Moore Jasmine JasmineT Rivertand 1453.07 thoughtful74 14 350286 Soto Ramon RamonDS Wentiont 6320.69 hotoven86 15 550578 Meade Elizabeth Elizabetht Sice1983 4691.58 smokinggun89 6322708 Bay 17 546722 west Debbie DebbieM Bributly 1480 outgoingone4s 19461243 Truong ose RosesTruc Copunty1 2287.6 cloistered30 20 560282 Titus Robert RobertsTi Drigature 6465.96 completed96 21 142208 Richardso Wayne WayneCRi Wifich 22 513085 Jamerson Peggy PeggyEJar Thicatedi 9913.26 committee81 23 704286 Long AmyAmyRLong Ralf1970 833.99 belligerent26 24 131220 HughesSylvia SylviaJHuxamoste 8494.33 retiredagain44 414.09 questionable95 Customer Ready 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

assess the infl uence of national culture on the workplace

Answered: 1 week ago