Caesar Cipher Translator

advertisement
Note: The number in the bottom right corner of the first box is where you write how many "shifts" or "rotations" you want in the cipher.
The Caesar cipher is one of the earliest and simplest ciphers that were invented. It works like this:
  1. First, choose some text that you want to encrypt. Let's choose the text "eat".
  2. Next, pick a number. It can be positive or negative. Let's choose "-3" for this example. This will be our "key" that will allow us to encrypt and decrypt the message.
  3. For each letter of your text, move it along the alphabet by a number of places defined by our key. So in our example, the letter E would get moved backwards (remember we chose a negative number) three spaces. So E would get encrypted into B.
  4. Likewise, the next letter, A, gets moved backward by 3 letters. Since it's at the start of the alphabet, we rotate back around to the end: A>Z>Y>X, so we end up with the letter X as the encrypted version of A.
  5. Finally, we move T three spots back and get: T>S>R>Q.
So if we use Caesar encryption on the word "EAT" with -3 as our key, we end up with "BXQ". Here's a diagram showing the shifting process for a key of -3:
caesar cipher shifting alphabet encryption
As I said earlier, the caesar cipher is extremely easy to crack if one suspects that some sort of substitution cipher has been used to produce some encrypted text. Since there are only 25 possible ways to encrypt a message using a Caesar cipher, a person who wants to decrypt it simply has to try 25 different keys until something meaningful is used.
Another interesting way to crack a Caesar cipher is to look at the distribution of letters. In the text. English has a fairly predictable distriution of letters in any decent sized amount of text:
letter distribution
All of the different keys used in the Caesar cipher will just shift this distribution by some number of places. The cipher cracker simply has to count the occurances of the letters, and then compare their distribution to the one above. The letter "e" for example seems to occur most frequently so their first guess might be that the largest frequency in their count would actually be the letter "e".
The JavaScript code which runs this translator was directly copied from the rosetta code page. All I did was make it usable as an online caesar cipher so everyone could use it. All credit goes to that anonymous coder!

LingoJam © 2024 Home | Terms & Privacy