4-Bit XOR Cipher Towers in Minecraft
Fun with Logic Gates and Ciphers
I know what you must be thinking- 4-bit? XOR? Cipher? Towers? o_O
First four images are Tower 1 and last four are of Tower 2.
Let’s break it down:
4-bit:
4-bit denotes how many values we can have. Since our values are only, tower light on or tower light off (binary), we’re working with a total of 16 combinations (2^4).To keep it simple there are only 4 place holders/levels in the tower I created, hence 4 bits.I created a code table which states what each of the 16 possible combinations represent:
XOR and Logic Gates:
OK, we’ve got the code, now how to mask its value so that only you and I know what it means? Well the engine that does this is a XOR(exclusive OR) logic gate. To create a XOR (Exclusive OR logic gate), I started by breaking it down into components (note: I usually use a note block or piston as the output block in the pictures):A simple NOT Gate (inverts the selection) and Input/Output Gate (turns on or off depending if the switch is on or off)
A NOR Gate(Not OR Gate) and an OR Gate(turns on if either or both are on)
XOR(composed of 3 NOR Gates and 1 OR Gate) and a XNOR(inverse of XOR Gate) for the heck of it.
XOR Cipher Tower
So the question is how to send a message using XOR Gates? For each gate, there are 2 inputs and 1 output. One input we denote as the key and the other is a value in your plain text message. The XOR gate functions as our encryption (and decryption) algorithm/method to encipher the message we want to send (and to review, a XOR gate basically outputs 1 if they are different when comparing values[1,0] and [0,1], and outputs 0 if they are the same [1,1] and [0,0]).Caption: Wooden Plank says “Right:Key” and “Left:Text”
We are using 4 XOR gates (a total of 8 inputs and 4 outputs) stacked on top of each other. You have to set each value of key/text pair to and the output will be the encrypted message that can be seen from afar.
So for instance if I wanted to send the message: 1101 (or ‘Hello’ when we look at our code table) using the key:1100, I would go to the first level(bottom) and input 1 for the text input and input 0 for the key (the output would be light on or 1). I would then go to the second level and input 0 for the text value and 0 for the key(the output would be light off or 0). (Note: I set reading the tower top to bottom as the same as reading it left to right). I would then repeat this process for every level of the tower (4 levels in this case/hence 4-bit).
The encrypted message should read 0001
Towers
I created 2 towers so that I could send messages to my friends on neighboring island :) View gallery above.One interesting feature/bug is that the towers can also decrypt your message, but if you decrypt it in the tower the opposite island can figure out your key! So I recommend just doing it in your head (remember a XOR gate basically outputs 1 if they are different when comparing values[1,0] [0,1], and outputs 0 if they are the same [1,1] and [0,0])
Well The sun has set, and it’s time to say: Encrypted Text:0111 Key:1001
References and Links
Binary. (2011, September 9). In Wikipedia, The Free Encyclopedia. Retrieved 01:41, September 10, 2011, from link
Hyde, Randall. “Chapter Three Data Representation.” Art of Assemby. UCR, 11 Sept. 2002. Web. 09 Sept. 2011. link.
XOR cipher. (2011, May 10). In Wikipedia, The Free Encyclopedia. Retrieved 23:05, September 9, 2011, from XOR Cipher
Java Tool to Create Logic Gates from components: link
One Comment
rathgrl2 / 21 Sep 2011 / 10:38 am