Tutorial by Examples

The Caesar cipher is a classic encryption method. It works by shifting the characters by a certain amount. For example, if we choose a shift of 3, A will become D and E will become H. The following text has been encrypted using a 23 shift. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG QEB NRFZH YOL...
The ASCII way This shifts the characters but doesn't care if the new character is not a letter. This is good if you want to use punctuation or special characters, but it won't necessarily give you letters only as an output. For example, "z" 3-shifts to "}". def ceasar(text, shi...
ROT13 is a special case of Caesar cipher, with a 13 shift. Only letters are changed, and white-space and special characters are left as they are. What is interesting is that ROT13 is a reciprocal cipher : applying ROT13 twice will give you the initial input. Indeed, 2 * 13 = 26, the number of lette...
Implementation of the Caesar cipher. This implementation performs the shift operation only on upper and lower case alphabets and retains the other characters (such as space as-is). The Caesar cipher is not secure as per current standards. Below example is for illustrative purposes only ! Refer...
The following code example implements the Caesar cipher and shows the properties of the cipher. It handles both uppercase and lowercase alpha-numerical characters, leaving all other characters as they were. The following properties of the Caesar cipher are shown: weak keys; low key space; the...

Page 1 of 1