Question: Please help with this java program. Cryptography is an ancient study of secret writing. There is a wealth of literature in this field. This is
Please help with this java program.
Cryptography is an ancient study of secret writing. There is a wealth of literature in this field. This is a field of study that is of particular relevance in Computer Science.
For the purposes of this programming assignment convert the message that you are asked to encode or decode to lower case. You will only be encoding or decoding the letters of the alphabet. Punctuation marks and numerals remain untouched.
Substitution Cipher: In this method you will replace the letters using the following scheme. Plain Text: a b c d e f g h i j k l m n o p q r s t u v w x y z Cipher Text: q a z w s x e d c r f v t g b y h n u j m i k o l p
Caesar Cipher: The Caesar Cipher is also a substitution cipher. This was said to have been used by Julius Caesar to encode messages to his generals. In the classic Caesar cipher the letters are shifted 3 places to the right. The message "return to rome" would be encoded as "uhwxua wr urph". However, for your programming assignment you will ask the user how many places to shift to the right, wrapping them around as necessary.
You will be entering the message to be encoded from the command line. Sample output: Enter phrase to be encrypted: Hello World Enter number of characters to shift for Caesar Cipher: 13 ------------------------------------------------------------------------------ Plain Text: hello world Substitution Cipher: dsvvb kbnvw Caesar Cipher: uryyb jbeyq
To decode a message encoded with the Substitution Cipher you will enter from the command line: Enter phrase to be decrypted: dsvvb kbnvw Enter cipher name: Substitution -------------------------------------------------------- Encoded text: dsvvb kbnvw Substitution cipher: hello world
To decode a message encoded with the Caesar cipher you will enter: Enter phrase to be descrypted: uryyb jbeyq Enter cipher name: Caesar ---------------------------------------------------------- Encoded text: uryyb jbeyq Caesar Cipher: hello world
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
