Code Wheel

by IWorkInPixels, published

Code Wheel by IWorkInPixels Apr 3, 2013
2 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps



Code Wheel by IWorkInPixels is licensed under the Creative Commons - Attribution license.

Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag


Thing Statistics

4868Views 1927Downloads Found in Math


My dad taught me this cipher when I was a kid, and I've wanted for a long time to make a printable code wheel that would allow others to learn the cipher. This is some sort of variant on the Vigenere cipher (http://en.wikipedia.org/wiki/Vigenere_cipher) but I'm not sure of the actual name of this variant, so if anybody knows, please let me know in the comments! I know it is also related to the key autokey and Alberti ciphers.

In addition, I have a prize for the first person to correctly decrypt the ciphertext below and post the plaintext to the comments... I loved the steganography challenge in the Seej block, and it's high time we had another contest... Good luck!

Oh, and you will find that brute force is not the way to go... there are 1.243841e 142 possible keys. :)

UPDATE: There is now a monocase alphas only ciphertext of the same plaintext, which reduces your keyspace down to 4.0329146e 26 possible keys.

Keep in mind that an attacker doesn't need to do an exhaustive search of all of these keys; once he has some of the letters right, they will help him get more letters right, and the effect will snowball until he has the entire key. Indeed, I cracked the alphas only version by hand in less than 2 hours.

This algorithm should therefore not be used for anything that you actually need to keep secret.

-G},x3Pp__DPpqSk6'iF5]E0ww"QhV.yEei{b>~wu2)5ecNGGO^AF3w.ur!RE ]E>}.


I design things in my free time, just for fun. If you like my stuff, send me some DOGE. It'll totally make my day! Thank you.



1: Print it out.
2: Put it together.
3: Follow the instructions on the webpage download. If you want, you can also use this wheel to perform simple Caesar ciphers.
4: Optional: Use the .SCAD file to print two copies of a new key, and give one to a friend. Now you can communicate securely with that friend!
5: If you'd like to participate in the contest, you will want to download the python version of the cipher.

More from Math

view more

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

I made this, but then had to spend quite a bit if time filing it down so the pieces would actually fit together. It would be helpful if you post them as separate files so that I could simple make the interior piece a hair smaller.

Hint 5 (final hint): If you turn the wheel so that the A on the inner
wheel matches a given letter on the outer wheel, then the letter on the
inner wheel which lines up with the A on the outer wheel + the letter on
the inner wheel = the key length.

In the photos above, for example, M and O are shown to each line up with the A on the other wheel.

In the case of the printed wheel, the key length is 26. So M + O = 26.

of these combinations are more likely to appear in english text than
others, but there are only 52 of them to check, so worst case scenario, a
script could pretty easily brute force its way through all of them, and
either look for English words itself or show the results to you to pick
a winner.

Lather, rinse, repeat until you have enough of the key to solve the puzzle.

Wouldn't the key length always be 26? I thought that was the point?

In this printed code wheel, the key length is always 26, yes. But there's no reason only uppercase letters can be used with this algorithm. The python version I posted, for instance, adds lowercase letters, numbers, and punctuation as well. That way your entire message is encrypted, without having to convert everything to uppercase, and remove the spaces, punctuation, and numbers.

Sorry, I was missreading things. I'm still trying to answer the question "If you see the word 'MOM' in the ciphertext what would that mean?" It would mean I'm super confused.

It's ok... just glad to see someone engaging the challenge! So here's some more help...

If you see the word "MOM" in the ciphertext, it means one letter was encoded as an M, the next letter moved x distance around the circle and landed on the O, and the third letter moved 26-x distance around the circle and landed back on the M again. The first letter could be anything, but there are only a small number of possibilities for what the 2nd and 3rd letter could be, and it is therefore easy to check your guesses.

Hint 4: The distance between two of the same letter in the ciphertext has to be a multiple of the key length, as you have gone around the wheel n times and landed back at the same letter.

Hint 3: There's a new file available for download, which contains an encrypted copy of the Gettysburg Address, as seen here


with some filler at the beginning and end so I'm not just giving away the key. You now have a long piece of ciphertext encrypted with the same key (though not the same rotation of the key) as the original contest message, and you now have the mother of all cribs. Enjoy!

Hint 2: the word "my" appears in the plaintext twice, and it begins with "Hi, ". You now have a crib.

Is the key just a bunch of random letters or does it spell a phrase?

Per the algorithm, the key is the letters of the alphabet, in random order. This means that if you were to, say, know that the letters "T", "K", and "A" were at certain places in the key, then those three letters would appear nowhere else in the key.

"Be sure to drink your Ovaltine."

Ahahahah you'll shoot yer eye out kid!

Lulz. Nope. And it's not "My hovercraft is full of eels.", either. :)

I'm a little bit concerned by the non-alphanumeric characters in your cyphter. Makes me think you didn't use your wheel or anything like it to write this code. I may have to see an example solved before I'll believe that it's solvable with this item.

So I haven't had time to really develop the two cypher rings that you credited as parent object of this (thanks for that) but generally letters don't print well laying down like that. I'm not sure the scale but if they're not at least 1mm thick all around there's not much chance of this printing successfully. I've tried getting around this by printing letter rings on sticker paper and sticking it to the rings, but that doesn't always work because stickers don't like plastic unless you corona treat them, which not everyone has a plasma generator to do that with. So I've kind of back-burnered that project for a little while.

Just posted a picture of one of my early prototypes of this, in yellow PLA with the letters sharpie'd after printing. They are usable in a pinch, and the letters in the final version are nearly twice as big, and are completely readable even without sharpie.

Yeah I saw that you had back-burnered the project, which is why I began my version... my version was originally intended to be a snap-on addition to the MakerBot watch, but I ended up giving up on that, shelving my project for a bit, and yesterday I decided it was time to publish or perish. I had a prototype, but it has been lost to the sands of time... I will print another today and post the results to this thing... at roughly 3 inch diameter, the letters come out just fine.

As for the ciphertext above, it was indeed written by this cipher, although I have added many more characters to the alphabet than the ones that will fit in the 3 inch printed version. I have already given away the key space (which is alphabet size factorial), and therefore also the alphabet size and key length. I will begin posting more hints this afternoon. I will also upload the python code used to create my ciphertext.

It is possible to crack the cipher, but it will require some research into some cryptanalysis methods that were declassified by the NSA in 2005, and are available on their website.

Good luck!

But if I can't use your decoder ring to solve the cypher then what's the point of the ring?

The ring is a simpler version of the same cipher, which will allow you to learn and practice this cipher without the aid of a computer. Since the cryptanalysis of the cipher will require computers anyway, it seemed a shame not to preserve punctuation, spaces, and lowercase letters, as well as gain several orders of magnitude of security, so I included all of the above in the alphabet used by the python file.

If you really want to try cracking it using only pen and paper, here's the same message, encoded using the printable code wheel, alphas only (spacing and punctuation removed to hide plaintext word lengths):