Chapter 2: Simplifying Codes and Cryptograms
29
Rail Fence Ciphers
A Rail Fence Cipher is a transposition cipher. The letters in
the message aren’t changed, but their positions are altered.
Unless you know the encryption method, these ciphers can be
very difficult to crack. You can find them in Chapter 9.
To decipher these codes, you need to know the number of
rails. With a two-rail cipher, you simply divide your ciphertext
into halves, and then write the second half underneath the
first half, slightly offset. Then you can read off the plaintext
by alternating between the top and bottom rails of your
letter fence. Figure 2-7 shows you an example of a two-rail
cipher.
For ciphers with more than two rails, the process is more
complicated because you have to figure out how many letters
to have in each rail to crack the code. The number of “points”
of the zigzag in the top row is the most important thing to
figure out.
To solve these ciphers, try drawing a zigzag onto a lined piece
of paper with a colored pencil or highlighter pen. Then write
the ciphertext from left to right and top to bottom in order,
following the zigzag path. The horizontal lines on your page
will help you keep everything lined up (so if you aren’t using
lined paper, draw some horizontal lines!). These lines are
the rails.
A three-rail cipher is drawn over three lines, a four-rail cipher
is drawn over four lines, and so on. Figure 2-7 shows two
examples of Rail Fence Ciphers.
If a message has too few letters to fit into the chosen rail pat-
tern (a fairly common occurrence) dummy letters are added
to the end of the message to pad it out. So don’t be put off if
an X or other random letter or two appears at the end of your
message.
Draw the zigzag so the last section is just coming up to —
but stops just short of — another point. Refer to the way the
zigzags are drawn in Figure 2-7.