Question: Description: --JAVA-- Please, will rate highly You are to write a Java program that will create a class called Encryption. This class will have a
Description:
--JAVA-- Please, will rate highly
You are to write a Java program that will create a class called Encryption. This class will have a constructor that takes an int as a parameter that will initialize the private state variable key. There will be three methods in the class. The first method is called encrypt and it takes a String as a parameter and returns a String which is the encrypted version of the String passed in. You will use a simple shift cypher which uses key as the number of places to shift. The second method will be called decrypt and it takes a String as a parameter and returns a String which is the decrypted version of the String passed in. This will shift back the places based on key. The third method will allow the user to change the value of the key. (Bonus: have the third method give the user a warning that if the key is changed, any input encrypted with the previous key will not be decrypted properly.) You will need to create a menu driven tester class. The menu should give the options to encrypt, decrypt or exit the program. The program will keep looping until the user selects to exit the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
