In the world of encoding messages, many methods have been used throughout history, ranging from simple transposition ciphers to complex multi-letter substitution ciphers. In today's blog, we will look at the rail fence cipher.
This is an easy way to encode a message quickly, and while it isn't sophisticated it might be enough for your purposes. To develop the cipher, the message you want to encode, the plaintext, is written in an up-and-down zig-zag pattern:
The cipher text is written out in all, capital letters, taking each line from the pattern:
MMMIONETETINGTNIET
The cipher text is then spaced out in groups of 4 letters:
MMMI ONET ETIN GTNI ETEA DHPS
You can end the encoding here, or you can use a keyword for added security. For example, using the keyword Monday, you would rearrange the cipher text groupings alphabetically according to your keyword. The new cipher text would then be:
ETEA GTNI MMMI ETIN ONET DHPS
To decode the message the recipient would reverse the process. As the receiver who knows the keyword, you start with admnoy (Monday, in alphabetical order), and rearrange the groupings. After you have the cyphertext in the correct order you can split it up and arrange it by the 3 rails used to encode it. Notice the pattern length of 6, 12, and 6 when the message is written out in rails.
In the example above we used 3 rails in our encoding process. You can use any number of rails when you encode your message. Always ensure your keyword has no repeated letters. Take a shot at decoding the message below using the keyword turkeys and 4 rails.
WYAI BOKY TPSO AREN MUOC LAOR VRWE
Good luck.
ความคิดเห็น