Simple substitution ciphers directly substitute one letter of the alphabet with another letter or character. In a transposition cipher, the letters in the message stay the same; however, the text is scrambled based upon a predetermined pattern.
Rail Fence Cipher
One common type of transposition cipher is a rail fence cipher. Look at the shape of the top of the rail fence above. Notice how it creates an up, down, up, down, “W” pattern.
In this type of cipher, the message is written in this pattern within a table with a predetermined number of rows and columns. The “key” will determine the number of rows, and the number of characters in the message will determine the number of columns. (Ideally, the number of characters in the message will be at least three times the key.)
To encipher the message, create the table. Write the first letter of your message in the upper left-hand corner. Move one square over (to the right) and one square down. Write the next letter. Continue using this pattern until you reach the bottom of the table. Then, move one square over and one square up to complete a “V” pattern. Continue with this pattern until you have entered the entire message.
The message “Please help me” with a key of 4 would look like this:
To encipher the message, write the characters as they appear in each row. The ciphertext for this message using this key would look like this:
To decipher this message, create a blank table using the key to determine the number of rows. Since the key for this message is four, we would need four rows. Count the number of characters in the ciphertext to determine the number of columns. Next, add dashes in the table where the plaintext would go. Begin replacing the dashes with the ciphertext by rows, moving left to right. In this example, we have replaced the first two dashes with the first two letters of the ciphertext. We would continue to replace the dashes in each row with the ciphertext until the message appears.
One variation of the rail fence cipher involves adding blank spaces in between the words of the plaintext message.
In this case, the blank spaces are counted as characters, and they are included in the ciphertext like this:
Ciphertext: P MLEH EESEP AL
One other variation is to replace the blank spaces with nulls. Nulls are characters that aren’t part of the message. In the following example, we have replaced the spaces between the words with x’s. We have also added nulls to the end of the message to make it easier for the recipient to decipher. Unfortunately, by creating a pattern of x’s, we have also made it easier for others to decipher as well.
There are many sites that will allow you to encode and decode messages by entering information into an applet. These applets should give you an idea of how easy it is to break these types of ciphers using computer programs. (One example is listed in the “See Also” section below.) We will talk more about how computers are used to facilitate data analysis next week.
Another type of transposition cipher is a route cipher. In this cipher, the message is written in a table from top to bottom, filling all spaces in the first column before moving on to the next. Again, you can add spaces or nulls between words or at the end of the message to complete the table.
For this example, the plaintext is still “Please help me.” However, the ciphertext is now PAHPLSEMEELE.
© Sheree Buikema