Question: Module 8.3 | Challenge The Cryptography Class Overview In this two-part challenge, you will create a Cryptography class with a public static encodeFile method and




Module 8.3 | Challenge The Cryptography Class Overview In this two-part challenge, you will create a Cryptography class with a public static encodeFile method and a public static decodeFile method. These methods encode and decode the contents of a file, respectively. Each method has an input file and an output file as parameters. Two testing programs will also be created For an overview on cryptography, watch this video presentation: khanacademv.org/computing/computer-science v/intro-to- Specifications Part 1 MyMessage.txt .Create a text file named MyMessage.txt and enter these letters: abcdefg Note: The encrypted letters will be the letters: klmnopq MyMessage.txt will be encrypted by method encodeFile producing a secret code that will be stored in an output file EncryptedMessage.txt. Save MyMessage.txt in the same folder as the folder that will contain your Cryptography class and the test harness file . Cryptography.java Create the skeleton of a class called Cryptography .Create a public static method encodeFile Add the throws clause to the method header for the IOException type Fleinput Stream and DataInputStream classes (java . 10 package) will be used to read from the input file (MyMessage.txt) Aboolean variable endofFile should be declared and initialized to false Declare and create new FileInputstream, DataInputstream, FileOutputsteream, and DataOutputstream objects. Open the files. Process the files using the readByte and writeByte methods. Here is an algorithm: . while not end of file: try read the next byte from the input file add 10 (which produces the new encoded character) write the byte to the output file catch using EOFException set the endofFile flag to true Close the files
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
