In cryptography, a Caesar cipher, also known as the shift cipher is one of the simplest and most widely known encryption technique. The action of a Caesar cipher is to replace each plaintext letter with one a fixed number of places down the alphabet. The method is named after Julius Caesar, who used it to communicate with his generals.
This definition is found at http://en.wikipedia.org/wiki/Caesar_cipher#Example
The ASCII code scheme is easily utilized to make a simple Caesar cipher. See link. Since C++ treats characters as integers, we can add or subtract integers to create the encoded letter.
Write a program that will encrypt and decrypt a 5 letter word.
The user needs to enter a 5 letter word at the keyboard. The program encrypts the word, print it
out, then reverse the word and print the original word again.
You can use the debugging tool to see how each value changes in the encryption program.
Select Debug --> Start Debugging from the main menu. The program will start to execute, then stop at the breakpoint.
Notice that the output window (at the bottom) splits into two windows with tabs. The VC++ work windows have changed, now showing the source code window across the top. A yellow arrow, which indicates the current line of code being executed, has appeared on top of the red "breakpoint" dot.
The bottom appears two windows.
The Locals window displays the current local variables and parameters and allows
you to change the values of these variables interactively during code execution.
The Autos Window displays variables used in the current statement.
You can use either the autos windows or the locals window to see how each value changes. Right now, the execution of your program halts after the first cout statement is executed, because we set a breakpoint there. This is indicated by a yellow arrow inside the red dot. Let's step into the loop and see what happens.
One shows a blue arrow jumping over some lines of code (Step Over F10) . Another shows the arrow pointing into the braces (Step Into F11) . These are the buttons for single stepping through a program. There is also, the Step Out button, which allows you to skip large blocks of code in debugging. Let's use the Step Over Button first.
Press the Step Over button, the yellow arrow will move to the next line. Keep pressing the Step Over button to see how each value changes, the color change of value means the values are updated. Carefully watch how each value changes.