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

Java Java Question 7 Simple encryption can be done by shifting the ASCII

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!