The Caesar cipher is actually a letter shifter that can shift a letter to a different position. For example, to encrypt English word, “apple”, the Caesar cipher may simply shift each letter of the word right by 2 positions creating the new word “crrng”; therefore “a” becomes “c”; “p” becomes “r”; “l” becomes “n”; and “e” becomes “g”. Following the convention, we here call “apple” plaintext, “crrng” ciphertext, and “2” encryption key. To decrypt “crrng”, the Caesar cipher simply shifts each letter of “crrng” left by 2 positions.
Write a C++ program that consists of three major components: 0) encryption, 1) decryption, and 2) echo, where “echo” means that when you enter a key and a plaintext, it will print out the same plaintext. Note that characters are entered one after the other and terminated by “;”. String type is not allowed to be used here. Also, the maximum value of a key is 25 and use only lowercase letters with no spaces(s) between letters.
The answer to the question is available in the PDF file https://assignmentexpert.com/https://assignmentexpert.com/homework-answers/programming-answer-36563.pdf
Comments
Leave a comment