Input: Output:


The garbled language that Cory can't understand, back towards the beginning of the story, is actually real text encrypted with a couple of symmetric algorithms. Here's how to manually encode/decode the text.

  1. Remove any periods, commas, question marks, or exclamation points at the end of the string of text.
  2. Replace all “2”s with two spaces, and all “3”s with three spaces. If it helps, you can use underscores or some other symbol instead.
  3. Count the number of characters in the text. This includes letters, spaces, and punctuation.
  4. Draw a square grid big enough to hold all the characters. For example, if the text is 23 characters long, you need a 5x5 grid, which holds up to 25 characters.
  5. Put the characters into the grid, starting in the top-left corner and going down, i.e. filling each column before you go on to the next. Any empty spaces at the end should be left blank.
  6. For letters A-M, replace with the corresponding letter N-Z, and vice-versa. Use this table:
    A B C D E F G H I J K L M
    N O P Q R S T U V W X Y Z
  7. Read the new characters in the square left to right, reading each row before going to the next column. It should reveal the decoded (or encoded) message.

This page is an implementation of this algorithm in JavaScript.