Homework 3: Implementing SDES

- Provide a class SDES with the following public methods:
- SDES(int key) -- constructor that takes an integer representing a 10-bit key and creates an SDES instance that uses the given key.
- int encrypt(int plain) -- encryption method that takes an integer representing 8 bits of plaintext and returns an integer representing the corresponding 8 bits of ciphertext.
- int decrypt(int crypt) -- decryption method that takes an integer representing 8 bits of ciphertext and returns an integer representing the corresponding 8 bits of plaintext.

SDES sdes = new SDES(108); // 0001101100

_{2}= 108_{10}int ciphertext = sdes.encrypt(225); // 11100001_{2}= 225_{10} - Write a test program with the following behavior:
- Asks if the user wants to encrypt or decrypt (e or d, lowercase)
- Asks for a 10-bit key
- Asks for an 8-bit string to encrypt or decrypt
- Prints the encrypted or decrypted string

No additional input should be required, so the test program should be runnable by redirecting an input file containing only the values above on consecutive lines, e.g.

e 1001110101 00011011

Note that you are reading in the key and plaintext values from the user as binary strings, so you will need to convert them to integers for encryption.

**Extra Credit:**Add a feature to your test program that allows it to take and encrypt or decrypt a character string. This same feature should do the reverse operation as well to show that it will produce the starting point.