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.