JAVA APPLICATION – CAESARCIPHER

DAMNED LIES AND STATISTICS
October 11, 2020
Employment Relations Law Take Home Exam
October 11, 2020

JAVA APPLICATION – CAESARCIPHER

n 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

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

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.