Codes and Ciphers :: Rail Fence
In the rail fence cipher, the plaintext is written downwards on successive "rails" of an imaginary fence, starting a new column when the bottom is reached. The message is then read off in rows. For example, if we have 3 rails and a message of "This is a secret message", you would write out:
T S A C T S G H I S R M S E I S E E E A J
The last J is just a random letter to fill in the space. The secret message is then condensed and regrouped.
TSACT SGHIS RMSEI SEEEA JGURL
To decipher a message you must know the number of rails that were used to encipher it. You then break up the letters into equal groups for each rail. For example, if you are using 3 rails, you would break the secret message into 3 equal groups. Now you stack the groups on top of each other and read off the message vertically. If you get gibberish, then there are probably some extra letters tacked on the end of the message that are throwing off the grouping. Try removing one letter from the end and try again.
Table of Contents