For this assignment, you will re-write your Ceasar Cipher program from the beginning of the semester. Instead of a straight rotation of letters, you will implement a substitution cipher. You may want to go back and review the chapter, Secret Bits, that we read during the first week. In a subsequent part of this project, you will write code that cracks such codes using frequency analysis.
As you review substitution ciphers, keep in mind that Caesar ciphers are a special case of the general class of substitution ciphers. For the substitution cipher portion of this assignment, you may implement any of the general class of substitution ciphers based on a fixed permutation of our alphabet.
The requirements for this assignment are quite modest; consequently, the due date is less than one full week. We are doing this in order to give you more time on other parts of the project that will probably prove to be more challenging.
SubstitutionCipher, that supports the following functionality:
public String encode(String plainText)that converts the given
plainTextString into an encrypted string. Lower-case letters should be converted to upper-case. Characters other than the 29 we support should be dropped.
public String decode(String cipherText)that takes a given encrypted String and decodes it using the key that was either specified or generated when the constructor was called. Also write a static method
public static String decode(String cipherText, String key)that decodes the encrypted text using the given key. Note: you must avoid the duplication of code.
On your machine where you are doing your homework, create a folder called <your email name> followed by “P01A”. For example, someone with email address “cjones” would create a folder called “cjonesP01A”. Inside that folder, place whatever Java and documentation files are necessary for your programming project. Finally, either tar or zip the folder so that when I extract it, the folder ”<emailname>P01A“ will be created. Finally, submit via Eureka.