Question: ** * implement a ceaser cipher that operates on ASCII characters a-z and A-Z * only. all other characters are passed through unchanged. the character
** * implement a ceaser cipher that operates on ASCII characters a-z and A-Z * only. all other characters are passed through unchanged. the character * case is preserved. * * for example, if the rotation key is 23 and the plain text is "Hi there", * the resulting cipher text will be "Ef qebob". */ public class CaesarCipher { private int shift; /** * create a cipher with the given rotation. (note that it may be any integer. * @param shift the secret amount of shift to use when encoding */ public CaesarCipher(int shift) { this.shift = shift; }
/** * return the encrypted version of the plainText based on the shift. * @param plainText the text to encrypt. the data will not be changed by this function. * @return the cipherText of the plainText. */ public byte[] encrypt(byte[] plainText) { return new byte[0]; }
/** * return the decrypted version of the cipherText based on the shift. * @param cipherText the text to encrypt. the data will not be changed by this function. * @return the plainText of the plainText. */ public byte[] decrypt(byte[] cipherText) { return new byte[0]; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
