Question: Develop a Java application that uses a type of encrypted alphabet, called a random monoalphabetic cipher, to encrypt and decrypt a message. Your encryption key
Develop a Java application that uses a type of encrypted alphabet, called a random monoalphabetic cipher, to encrypt and decrypt a message. Your encryption key and message are to be read in from two different files and then the encrypted message will be output to third file. Then the encrypted message is read in and decrypted to a fourth file. How this encryption algorithm works is described fully below. You dont need to research encryption algorithms beyond the following description. A monoalphabetic cipher starts with an encryption word, removes the redundant letters from the word, and assigns whats left to create an encrypted alphabet such that the first encrypted alphabet letter corresponds to A, the next to B, etc. Then the unused letters in the encryption word are then assigned to correspond to alphabetic letters starting with Z. For example, if the encryption word is FEATHER, the non-redundant letters are F, E, A, T, H, and R. These are assigned to A through F like this: Original alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ Encrypted alphabet:FEATHR The letters of the alphabet not in the set of F, E, A, T, H, and R are then assigned to the other letters of the alphabet starting with Z and working back towards A to form a full alphabetic cipher like this: Original alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ Encrypted alphabet:FEATHRZYXWVUSQPONMLKJIGDCB For this program you must use the encryption word TROYONLINE to encrypt your text. This program uses 4 total files. Use file keyword.txt to hold your encryption key word, file input.txt as your input plain text file, encrypt.txt as your encrypted output file, and file output.txt as your decrypted output file.
Use Notepad to create the keyword.txt and input.txt files. First create your encrypted alphabetic and then encrypt the following sentence: THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG Just encrypt and decrypt upper case letters to other upper case letters. Dont worry about lower case letters and encrypting the spaces.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
