Question: Java Question 7 Simple encryption can be done by shifting the ASCII codes of the bytes of a file by a certain value. Write a
Question 7 Simple encryption can be done by shifting the ASCII codes of the bytes of a file by a certain value. Write a method encryptLowerCase(String inFilename, String outFilename) which reads the binary byte file with name inFilename using FileInputStream and adds the value 13 to all the lower case English letters. Other bytes are unchanged. If any of the changed bytes is larger than the ASCII value of 'z', subtract 26 from the byte so that its value is within the range 'a' to 'z'. All the bytes, including the unchanged ones, should be written in the order they are read to a binary byte file with name out Filename using FileOutputStream. Handla possible exception(s) by outputting a suitable message using the getMessage ( method if an exception occurs. [5 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
