Java Applet: CaesarCypherTranslator.class by Robert T. Kelley

Java 1.3 plugin required

This applet will encrypt or decrypt a message using Caesar cyphers.

Background:

Julius Caesar is supposed to have used secret codes known today as Caesar cyphers. There are 26 such cyphers over the English alphabet. In the simplest, A is replaced with B, B is replaced with C, and so on, up to Z, which is replaced with A. This is called a rotate-one Caesar cypher because it rotates the alphabet one place. A rotate-two cypher replaces A with C, B with D, and so on up to Z which is replaced by B.

The following line is this line encrypted with a rotate one cypher.
Uif gpmmpxjoh mjof jt uijt mjof fodszqufe xjui b spubuf pof dzqifs.

Note that the letters in the above have been changed, but spaces and punctuation marks have not. Also, capitalization has been preserved.

For most Caesar cyphers, decryption and encryption require different algorithms, but not for the rotate-13 cypher. Here, the same algorithm will both encrypt and decrypt. This is because there are 26 letters in our alphabet, so doing Rot-13 twice brings each letter back to itself. Because Rot-13 works by replacing the current letters in a message with those that are 13 positions ahead in the alphabet, the letter a is replaced by n, b by o, c by p, etc. (and vice versa).

You may find newsgroup postings that are rot-13 encoded. It is sometimes used to hide offensive material from accidental viewing (naughty jokes for example). Unless you choose to decode it, the message will just appear as a bunch of gibberish.

Rot-13 encoding can be used for other purposes as well. Discussions that give away the ending to a movie, for example, can be encoded so someone doesn't read it by accident.

Use:

  1. Select the appropriate initial position for the toggle button
  2. Enter the text to be ROT-encrypted or decrypted into the text box
  3. Select the rotation distance from the menu
  4. Click the toggle button to see the rotated version of your text

Return to Java
Return to Math Links
Return to Robert Kelley's Music Website

2001 Robert Kelley