3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Poly-Alphabetic Cipher Machine

Poly-Alphabetic Cipher Machine
  This is one of my coolest inventions.  It's a poly-alphabetic cipher machine made out of Lego’s.  It is a type of mechanical encoding device that is reminiscent of the Enigma Encoding Machine used by the Germans during WWII.  I didn’t have any kind of instructions or aid, and as far as I’m aware this is the first device of its kind made out of Legos. The machine isn’t all that complicated, as its beauty lies in its simplicity.  It uses a mechanical gearbox with one gearing variable that alternates the rotational direction of the encoding wheel after every letter is encoded.  In essence, each subsequent letter uses a different alphabet to encode the message, hence the term poly-alphabetic.  This makes the resulting message immune to many different tactics of decoding.  Code breaking procedures like letter frequency analysis, simply will not work.  In fact, the only way to decode the message, without using an identically built machine, is to develop a complex computer algorithm and slowly sift through the approximately 1.626x10^53 possible combinations.  The overwhelming amount of possibilities combined with the difficulty of finding the proper function to decode the message makes this code nearly impossible to break.

  The machine has two reels, each with 27 characters.  The left reel is marked with the 26 letters of the English alphabet and a slot for inserting a space. The right wheel is marked with the numbers 1-27.  Both reels can list their their respective characters in any order.  The total amount of cominations is reached by taking the possible character configurations of each wheel, 26! (26 factorial), and multiplying it by itself since the machine has two reels.  Since this is built out of Lego’s, and only has a limited number of parts to be built out of, the gears don’t always line up perfectly when you switch modes, and they have a little slack in them as well. However, I’ve reinforced the model as much as possible to reduce the error while encoding. The machine currently has an accuracy of approximately ±1/54 of a rotation. As long as care is taken while operating the machine, errors will be kept nonexistent.

  The machine is operated in a very simple manner. To encode a message, you insert the black knob on top of the machine into the hole by the left reel. Then you set the machine to its starting position.  You do this by moving the grey axel on the front until the gears are in the neutral position. Next, the reels should be rotated so that it reads A on the left and a number (1-27) on the right. Then you make a box on your coding paper and put the starting number in it. Then push in the grey axel on the front to engage the reels with the single gear. Then rotate the black knob until the letter on the left reel is the letter that you want to encode, write the corresponding number down on the code sheet.  Then put the grey axel out all of the way to engage the double gears. Turn the knob again to find the corresponding number for the next letter to be encoded, then rinse and repeat. Continue working in this fashion until the entire message has been encoded. To decode a message, simply switch knob to the right, put the gears in neutral, set the proper starting position, push the grey axel in to engage the single gear, and start decoding in the same way that the message was encoded.
33 comments
Jan 28, 2011. 1:56 PMJorbs3210 says:
You need to post instructions on how to build this.
Aug 3, 2010. 4:55 PMSaturn V says:
No offense, but this is a mono-alphabetic cypher. Polyalphabetic uses 2+ alphabets to encode, where this is just taking a regular alphabet and turning it into a number.
Aug 12, 2010. 3:28 PMSaturn V says:
You have a good point. But don't you think another alphabet on the encoded wheel would be better than numbers?
Aug 23, 2010. 3:14 PMSaturn V says:
Yeah, it wouldn't matter. And it's very hard to crack a cypher that mimics the Enigma cypher machine like yours. To crack the Enigma, it took the greatist minds in Europe, the first computer, and the Nazis broadcasting the code for the day, and several months. A Vigenere square, however, is a much easier poly-alphabetic cypher to crack. And mono-alphabetic cyphers are easier than pie. And a lot shorter, too!
Oct 21, 2009. 6:08 AMjdege says:
I find the whole idea of building a rotor machine out of legos to be fascinating.  And I don't want to belittle what you've done in any way.  But, while this statement is true:

"This makes the resulting message immune to many different tactics of decoding.  Code breaking procedures like letter frequency analysis, simply will not work.
"

This statement is not:

"In fact, the only way to decode the message, without using an identically built machine, is to develop a complex computer algorithm and slowly sift through the approximately 1.626x10^53 possible combinations."


Oct 22, 2009. 5:37 AMjdege says:
The inaccuracy is in the claim that the only way to break the message is exhaustive search of the key space.  There are cryptanalytic methods other than letter frequency analysis and exhaustive search.  Even if the only attack is to search the key space - which with only one rotor is unlikely to be true - heuristic searches can generally find the key by testing only a very small fraction of the key space.

Ciphertext-only Cryptanalysis of Enigma, by James J. Gillogly:
http://members.fortunecity.com/jpeschel/gillog1.htm
Oct 23, 2009. 2:27 PMjdege says:
Enigma placed too much reliance on the ordering of the characters on the wheels, because the ordering was too hard to change.  Yours, on the other hand, uses paper strips.  It'd be easy enough to provide multiple paper strips, and to make the selection of which a part of the key.

I don't claim to be any sort of expert.  But I am looking forward to a detailed description of how the machine is built - and to seeing some sample texts.

Might I suggest that you include at least one sample with plaintext, ciphertext, and key?  If I have time to look into this (and I'm not promising anything, there's a lot on my plate), I'd probably try to emulate the machine in software, and I'd need at one set of test data to ensure that the software worked.
Oct 20, 2009. 6:48 PMI_am_Canadian says:
Uhh....

Thats really flippin cool.

Oops...

I mean,

AMAZING

Seriously, thats a fantastic bit of engineering. Great work man!
Oct 21, 2009. 3:48 PMshadowninja31 says:
That's cool! IAC: we should make one out of knex.
Oct 21, 2009. 5:08 PMOblivitus says:
I'm sure that one could be made as precisely with knex. Although it would be much larger.
Oct 21, 2009. 6:06 PMOblivitus says:
It has been done before, the first one was made a few years ago.
Oct 22, 2009. 5:32 AMOblivitus says:
The rbg, the first one was made in 2007, the second link shows a mech made in 2008.

http://www.instructables.com/id/Semi-automatic-7-Shot-Knex-Rifle/
http://www.instructables.com/id/mp5/
Oct 23, 2009. 8:28 AMOblivitus says:
Yeah, I figured.
Oct 21, 2009. 6:25 AMatombomb1945 says:
Might I suggest a study of Cyber Security?  You will end up studying a lot of codes like this one, and if you were able to come up with this on your own the field will be all that much easier for you. 
Oct 21, 2009. 5:16 PMatombomb1945 says:
Awesome choice as well.  Explains the Shuttle for your Icon.

You may want to check out the books by and about Kevin Mitnick, he did a lot of (ahem) work on codes and code breaking. 
Oct 22, 2009. 7:17 AMatombomb1945 says:
LHC = Who knows?

I have read DaVinci Code and picked up a lot of the codes within the book, but could never figure out the page numbering.  Borrowed the book, so I had to give it back after reading it. 
Oct 21, 2009. 2:48 PMOblivitus says:
Great job on this, and on the description as well. I can understand how it works from your explanation. And you're right, it is quite simple. I think that examples of codes and their corresponding messages would help too though.
Oct 21, 2009. 6:20 AMatombomb1945 says:
This is really awesome.  I had to study these types of encoding in my security classes.  Actually, We had to decode them by hand, and it was a pain.  Never was able to get the whole thing decoded, but a few of my class mates were able to.
Oct 21, 2009. 4:47 AMrimar2000 says:
CONGRATULATIONS, that is a very complete cipher machine.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
6
Followers
3
Author:twzoom