Java Application - CaesarCipher
Java Application - CaesarCipher
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
http://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
Name the Java Class:Â CaesarCipher
Grading Rubric
â¢Â   Correct File Name (CaesarCipher.java) - case sensitive
â¢Â   Correct Class Name (CaesarCipher) - case sensitive
â¢Â   Correct Style - comments
â¢Â   Correct Style - indentation
â¢Â   Correct Style - White Space
â¢Â   Free of syntax errors
â¢Â   Scanner object to read from keyboard
â¢Â   Program loop to continue
â¢Â   Prompt for and validate the key
â¢Â   Validate the key in a loop
â¢Â   Prompt for and read a phrase
â¢Â   Correctly encrypt the phrase
â¢Â   Display the encrypted phrase
PLACE THIS ORDER OR A SIMILAR ORDER WITH US TODAY AND GET AN AMAZING DISCOUNT :)