# How to create a code ring for 2 separate encryptions?

I'm trying to create a cipher ring for a Dungeons & Dragons game. I'm using what is basically a Vigenere cipher, but by doing some math you can solve it using a Caesarian Shift. I want to have a tactile way of solving the code (the code ring).

This is how the code works:

From an overview, there are 3 text information pieces: The Plaintext or solved code [P], the Key [K], the Caesarian key [N] and the Encrypted letter [C]

Very quickly, you would solve it like this:

the example encrypted message is 'wykkzebxax'.
The Key is 'puzzling'.

For our code, we take the first letter of the Key [Ki] and compare it to which number of the alphabet it is. In this case, P is the 16th letter. To decode the message, we take K1 -1, then subtract that from 26 (The total number of letters in the alphabet). So for our purposes:
n = 26 - (K1 - 1)
n = 26 - (16-1)
n = 11

So using a Caesarian Shift decoder with n set to 11, our first encrypted letter is revealed: 'h'.

Going on so on and so forth until the code is completed.

The final code is "helloworld"

Now that that the encryption is explained this is my question: How would I make a cipher ring that can use these parameters? Assuming that a proper end user would be taught how to use it properly.

My thinking is that the innermost ring would be the standard alphabet with their corresponding numbers beneath them, for ease of reference. After that I'm really stumped.

You'll just need a simple caesar ring, with all the values for n for 'puzzling' written somewhere. For each letter there will be a different shift (or so i understood from your question), so keeping tabs on the current position, they will have to check each letter separately, much like a combination lock

A single code ring will work, but there will be a lot of annoying busywork, setting and resetting the ring to the various password letter values. (I'm going to assume here that you don't want to make the item only usable for a single password.) To make a general purpose decryption device, you need as many code rings as your password is long, and you'd then use those rings sequentially.

To make the object physically appealing, you'll probably want to put the several rings together on a cylinder, and then rotate the rings to that the password can be read acrostically under the ciphertext ring's letter A. You can mark a "window" on the cylinder for this purpose.

To create a device like this for your particular cipher, you have to make the plaintext rings movable (able to rotate around the cylinder), and the ring for the encoded text needs to remain fixed. Like so:

    Fixed ring: | a | b c d e f g h i j k l m n o p q r s t u v w x y z
First ring: | P | Q R S T U V W X Y Z A B C D E F G H I J K L M N O
2nd ring: | U | V W X Y Z A B C D E F G H I J K L M N O P Q R S T
3rd ring: | Z | A B C D E F G H I J K L M N O P Q R S T U V W X Y
4th ring: | Z | A B C D E F G H I J K L M N O P Q R S T U V W X Y
5th ring: | L | M N O P Q R S T U V W X Y Z A B C D E F G H I J K
6th ring: | I | J K L M N O P Q R S T U V W X Y Z A B C D E F G H
7th ring: | N | O P Q R S T U V W X Y Z A B C D E F G H I J K L M
8th ring: | G | H I J K L M N O P Q R S T U V W X Y Z A B C D E F


I highlighted the first 8 ciphertext letters as they should be looked up, the corresponding plaintext is to be found on the fixed ring.

But, of course, what you really want is to be able to read the message right off the device, without jumping from one column to another. The coolness factor of this feature is well worth the extra complexity.

You can get that by giving each encoder ring a plaintext ring of its own right next to it. Those plaintext rings have the alphabet reversed, and you have to match the plaintext ring's letter a to the corresponding ciphertext letter. (You'd of course add some kind of pointy thing to the plaintext ring's letter a to make that obvious). It would work like so:

      First ring: |P| Q R S T U V W X Y Z A B C D E F G H I J K L M N O
plain ring 1: |h| g f e d c b a z y x w v u t s e q p o n m l k j i
2nd ring: |U| V W X Y Z A B C D E F G H I J K L M N O P Q R S T
plain ring 2: |e| d c b a z y x w v u t s e q p o n m l k j i h g f
3rd ring: |Z| A B C D E F G H I J K L M N O P Q R S T U V W X Y
plain ring 3: |l| k j i h g f e d c b a z y x w v u t s e q p o n m


and so on. The original message will appear in the password window.