Algorithm for performing encryption or decryption


In cryptography, a cipher (or cypher) is an algorithm for performing encryption or decryption. There are many algorithms that have been invented.

A Caesar Cipher is a very simple technique.  The algorithm is named after Julius Caesar who used it in some of his correspondence.

The algorithm transforms normal text by shifting each letter a certain number of characters either to the left or the right.  The shift direction and count is known as the key.

Example 1:  Key is -3 (shift left 3)

Example 2:  Key is +3 (shift right 3)

Here is a URL for a site that allows you to test the algorithm

https://www.xarg.org/tools/caesar-cipher/

Notice that the case of the original text is maintained and that non-letters are not encrypted.

Create a java application to prompt the user for a key and a phrase. After the information is entered, encrypt the phrase using the provided key.

Validate the key. The absolute value of the key cannot be less than 1 or greater than 25.  Prompt the user in a loop until a valid key is entered.

Put the code in a loop to continue prompting for more keys and phrases to encrypt.

Here is an example of how the program might appear

Request for Solution File

Ask an Expert for Answer!!
Other Subject: Algorithm for performing encryption or decryption
Reference No:- TGS01430815

Expected delivery within 24 Hours