Captain Gary's Secret Decoder Rule
AKA The Slide Rule Cipher
(See also The Enigma Machine and
The Game Tile Cipher)
Yes, it looks like the St. Cyr Slide, but here's a method of coding a message that, as far as I can tell, is original, and does not resemble the method used with the St. Cyr Slide. At least I haven't found any references in the literature about any method that is similar to this. (For a related method see the Skiptogram Cipher.)
Coding and decoding the cleartext message is done with the aid of a simple ruler-like device that can be easily constructed out of light cardboard. This device is just like a slide rule, for those of you who are old enough to remember that quaint computing device. There is a fixed section called the body and a moving section called the slide. The complete alphabet, plus an extra 'A' is inscribed on both the body and the slide Figure 1 shows what the finished code rule should look like. The blue section represents the body and the yellow section represents the slide.

Figure 1. The completed code rule.
Method One - Simple Enciphering
The method of using the code rule treats the letters of the plaintext word in pairs. To begin with we add an agreed-upon seed letter to the beginning of each and every word in the message. Suppose we have agreed on the seed letter Q. Here's what a simple message might look like as we get ready to encode it.
this is a test (original message)
qthis qis qa qtest (original message with seed letter added)
|
Now we are ready to begin encoding the message. We begin by moving the slider so that the first two letters of the first word are one above the other as shown in figure 2. Then we find A on the slider (use either the left A or the right A) and read off the letter above it on the body, in this case, X. Thus X becomes the first letter of our ciphertext.

Figure 2. Encoding the first letter of our message.
this is a test (original message)
qthis qis qa qtest (original message with seed letter added)
X (ciphertext so far)
|
The next step is use the next two letters in the same way we used the first two. The next two letters of our plaintext are T and H in the word 'this". We align the slider so that T is above H and look for A on the slider. This time, as you can see from figure 3, the A on the slider points to M and so M becomes our second cipher text letter.

Figure 3. Encoding the second letter of our message.
this is a test (original message)
qthis qis qa qtest (original message with seed letter added)
XM (ciphertext so far)
|
Repeating the process with the next two letters, H and I as shown in figure 4, we get our next ciphertext letter, Z.

Figure 4. Encoding H over I to Z.
this is a test (original message)
qthis qis qa qtest (original message with seed letter added)
XMZ (ciphertext so far)
|
Finally, our last pair is I and S which we encode in the same manner to get Q. Since this is the last pair we are done encoding the word 'this' into 'XMZQ'. Notice that the cipher text is again the same length as the original word. There will always be one fewer pairs of letter than there are letters which is why we needed to add a seed letter to the beginning of each word.
this is a test (original message)
qthis qis qa qtest (original message with seed letter added)
XMZQ (ciphertext so far)
|
Completing the coding we end up with this cipher text:
this is a test (original message)
XMZQ IQ Q XPMZ (ciphertext)
|
Notice that of the three Ts in the plaintext, two of the encoded to X and one of them encoded to Z. Notice also that the ciphertext Z represents plaintext I and plaintext T. Likewise ciphertext M represents both S and H, and ciphertext Q represents both A and S. Because of the way the letters are coded by pairs the same plaintext letter will not always encode to the same ciphertext letter and vice versa. This makes this simple code very secure against ordinary letter frequency analysis. In other words, it is probably safe from the average person who knows how to work cryptogram puzzles.
Deciphering Method One
Now that we've scrambled up the message it won't do us any good unless the message can be deciphered by the person we send it to. Deciphering works just like enciphering, only backwards. This time we line up the first ciphertext letter directly over the A on the slider and shown in figure 5. (which is really the same as figure 2.)

Figure 5. Line up ciphertext X over A on the slider.
Once we've done that we look on the body to find our seed letter, Q, and read off the first plaintext letter directly below Q on the slider, which is T.
XMZQ IQ Q XPMZ (ciphertext)
t (plaintext so far)
|
Next we line up the A on the slider directly below the next ciphertext letter, M. Now, instead of looking for our seed letter on the body we look for the previous deciphered plaintext letter, T. Figure 6 shows using M over A indexed by T to find the next plaintext letter H.

Figure 6, which is the same as figure 3.
XMZQ IQ Q XPMZ (ciphertext)
th (plaintext so far)
|
Next we slide Z over A and used the latest plaintext letter H as the index to find the next plaintext letter I.

Figure 7. Z over A indexed by H gives I.
XMZQ IQ Q XPMZ (ciphertext)
thi (plaintext so far)
|
Finally, we slide Q over A and use I as the index to find our last plaintext letter for this word, S. Looking at figure 8, notice that in the top image lining up Q over A leaves the I on the body hanging in space. When this happens simply use the A at the opposite end of the slide, as shown in the lower image.

Figure 8. Use the opposite A when the index letter hangs over empty space.
Method Two - Getting Tricky
In the above method we used the single seed letter Q at the head of every word. We can make the cipher a bit more secure by using different seed letters at the head of each word. For example, we could choose the seed word SPY, and use S as the seed letter for the first word, P as the seed letter for the second word, and Y as the seed letter for the third word. Then on the fourth word we would start all over again with S as our seed letter.
Method Three - Getting Really Tricky
When we enciphered the message above we always looked for out ciphertext letter on the body directly above the letter A on the slide. We could call A the index letter since that is the letter we use to indicate which ciphertext letter to use. We could just as easily use any other letter as our index letter, and for that matter, we could use a different index letter for each letter of the message. Suppose, for example, that we choose the index word DELTA. Now when we encode the first letter we look for our ciphertext letter above D on the slide instead of above the A on the slide. For the second letter of the plaintext we use the second letter of the index word as our index on the slide. Continuing in this way we repeat the index letter sequence D-E-L-T-A over and over until the end of the message.
Now suppose we combined and index word with a seed word. Now we would use a different seed for each letter and a different index for each letter. Using the three-letter seed word SPY and the five-letter index word DELTA, the pattern would only repeat every fifteen letters as shown below.
SPYSPYSPYSPYSPY SPYSPYSPYSPYSPY
DELTADELTADELTA DELTADELTADELTA
^ ^
|
This makes the cipher considerably more secure, but considerably more bother to encode and decode.
Method Four - Getting Really Really Tricky
There's got to be a way to make the cipher more secure without introducing all the bother of seed words and index words. In fact, the cipher can be made significantly more secure simply by scrambling the alphabet before putting it on the slide rule. The reason this is more secure is that it hides certain bits of information that might be useful in cracking the code. For example, suppose we use the unscrambled ruler to encipher the word CLUE. The resulting ciphertext would be ORRQ. Notice the double R. If the cracker notices that the distance from C to L is the same as the distance from L to U this might provide a clue to how to break the code. In fact, the clever counter-spy might crack the code numerically. Noticing that if we assign numbers to the letters starting with A = 00, B = 01, ... Z = 25, that if we subtract L from C we get 02 - 11 = -09, and if we subtract U from L we get 11 - 20 = -09. Now if we arrange the letters in a circle like the numbers on a clock, minus 9 is the same as plus 17, just as "minus 3 O'Clock" is the same as plus 9 O'Clock. You can see how this works by also numbering the alphabet in reverse with Z = -01, Y = -20, ... A = -26.
Now since the difference between C and L is 17, and the difference between L and U is also 17, and the number 17 corresponds to the letter R in our numbered alphabet the cracker will have all the information he needs to crack the code with a pocket calculator instead of our clever slide rule.
The way to foil this attack is to scramble the alphabet on the body and the slide. Once this is done the distances between the letters C and L and the letters L and U will be different and that piece of cracking information is out the window. The only disadvantage is that now the receiver of the message must have a matching scrambled slide rule. One way around that problem is to use a code word or phrase to construct the scrambled slide rule. For example, we might use QUICK BROWN FOX as our code phrase. Our scrambled alphabet would then be:
abcd efgh ijkl mnop qrst uvwx yz cleartext alphabet
QUIC KBRO WNFX ADEG HJLM PSTV YZ scrambled ruler alphabet
|
We simply write out the code phrase, dropping duplicate letters, and then add the rest of the missing letters in normal order.
When constructing a slide rule with a scrambled alphabet you should use whatever letter comes first in the alphabet as your index letter, and this letter should appear at both ends of the slide, just as A appears at both ends of the slide in method one.
Method Five - Getting Really Really Really Tricky
Using a conventional substitution cipher, it does no good at all to encipher a message and then encipher the ciphertext again using a different code. It might seem like the message has been double-coded, but this is an illusion. The final result is the same as if it had been single-coded using a combined cipher, and the double-coded message is just as easy to crack as the single-coded message.
That is not the case, however, using Captain Gary's Secret Decoder Rule. Double encoding a message using two different slide rules does increase the security of the message.
Method Six - Data Lost and Data Regained
What would happen if we left out the seed letter? Now we would find that the enciphered word always came out one letter shorter than the original word. Now we can't have the word become shorter without losing some information in the process. The word "this", using method one, but without the seed letter Q, encodes to the three letter word MZQ. But how do we decode MZQ if we don't have the Q to begin start the decoding process with?
The problem is that the single letter M, if we line it up over A on the slide, might be the result of enciphering MA, LZ, KY, JX, IW, ..., YM, XL, WK, VJ, UI, TH, SG,.... In other words, there are 26 different letter combinations that might have resulted in the ciphertext letter M. So we throw out the ones that can't possibly be words and list out the remaining combinations:
MA..
TH..
DR..
ES..
GU..
Next we use each of these to decode the third letter in the usual way we used for method one. This gives us these possibilities:
MAB..
THI..
DRS..
EST..
GUV..
Then we repeat with the finally ciphertext letter, Q and get:
MABL
THIS
DRSC
ESTD
GUVF
Of these, only THIS is a word so we decide that must be the correct decipherment. The problem with this method is that the message must consist only of recognizable words., and if more than good word pops out the receiver would have to guess which one was meant. Things like map coordinates (L26) or abbreviations (PTM) are out because they could not be guessed from the missing information the way real words can be. The other disadvantage is that one-letter words can't be enciphered at all unless they are combined with a seed letter.
(Feb 21, 2004)
Going in Circles
Here's a version of the slide rule that is even easier to use. I used this while solving the "Bored Guru" Challenge cipher that was posted on the yahoo group traditional_cryptanalysis. I found this little circular version to be of invaluable assistance in cracking that cipher. You can print out two copies of this image and cut the outer ring of letters off one copy. Then pin them together in the middle and line up letters by spinning the inner dial around.

Figure 9. The Circular Decoder Rule.
Even though the Bored Guru cipher is a simple polyalphabetic substitution cipher, and not the same kind of cipher as the one presented here, this circular slide rule really helped me crack the code by making it easy for me to quickly identify the length of the key cycle in the Bored Guru code. After the Bored Guru challenge is closed (Mar. 8, 2004) I will post the details here of how I cracked it using the circular decoder rule. In fact, this little gadget was so useful I'm thinking of crafting one in wood so I'll have a more permanent version of this handy tool.
Another version of the circular rule to be used for encoding and decoding by the method explained above could have a third alphabet, in scrambled order, on the larger circle, hidden underneath the inner circle, and a window cut into the inner ring that showed through one letter at a time from the scrambled alphabet for each of the 26 possible rotations of the inner wheel. That windowed wheel could even be used for doing ordinary Aristocrats (simple mono-alphabetic cryptograms).