I need to write a program which will automatically decrypt any Caesar coded mess
ID: 3640219 • Letter: I
Question
I need to write a program which will automatically decrypt any Caesar coded message. It should rely on the face that the letter e is the most common letter in the English language. So by determining the most common letter in the encrypted message you can figure out how many letters "e" has been shifted to the left and continue to decrypt the entire message. I must also keep uppercase and lowercase the same so I need to have to arrays of characters for both cases. When shifting the letters back (to the left to decrypt) the character need to wrap around at the end.I need to decompose the program into functions as a design consideration.
My algorithm prototype is:
1. Search the message and count all the letters from a-z and A-Z to find the most common.
2. Calculate how many shifts to the right it is from "e"
3. Apply a left shift in the amount calculated from "e"
4. output to a txt file
I have been stumped on this, I can get bits, like the file i/o or a decrypt prototype but I can't get anything stable. I know you need to use loops to step through character, I just can't get it to work. I have scrapped all that I have in anger and shame!!!
Please Help.