Michael J Donato Jr.


ENIGMA MACHINE
Introduction
During World War II, the Germans had an unbreakable code machine that the Allies could not defeat until they captured a physical copy of the encryption device. This device is one of history's most famous encryption systems - the Enigma.

The Encryption
To follow along with this section, you may visit a flash implementation of the Enimga machine here.

The encryption itself is composed of a few parts. Firstly, the letter you enter into the device undergoes an arbitrary transformation. This transformation is known in advance, based on the third rotor in the machine. Now each time we type a letter, the rotors will move based on the following pattern:

  • Every time a letter is entered, the third rotor turns.
  • Every time the third rotor hits 'W', the second rotor turns.
  • When the second rotor is on 'E' and a letter is entered, it rotates to 'F'. This is a special rule (double stepping)
  • When the seconds rotor hits 'F', the first rotor turns.

  • Knowing how the rotations work is the hardest part. Now we just need to convert it to something programmable. We can do this by simply storing the rotors as strings, and keeping track of the rotor offsets.

    Implementation
    After figuring out the subtleties of the Enigma machine, the implementation was actually fairly simple. It was only about 200 lines of ASM and I'm sure there are more efficient implementations.

    You can download my implementation of the Enigma Machine in assembly language here: enigma.zip(3.79 KB). (Note that there is an additional include file which contains some pre-made procedures to write data to the console. You will need it to run the Enigma.)

    SIMPLE XNA GAME
    Introduction
    This semester I'm taking a simple game design course in XNA. This was our first assignment. I decided to add some particle effects since the actual assignment was very easy. Additionally, I set up sort of a framework for future games in the course.

    The Game
    The assignment was to create a simple "run and dodge" game. You use the left and right arrows (or the Left thumbstick on an xbox 360 controller!) to move the ship back and forth to the flags. Meanwhile you must dodge the incoming meteors. The game will get progressively harder until you have 48 points, at which time it levels out. You can toggle debugging info with F11 (off) and F12 (on).

    As mentioned above I wanted to make it easy for me to deal with future assignments. I created a base class called GameObject that all other objects in the game are derived from. By doing this, objects can be added to a global list automatically when they are instantiated. Later, they are removed when the boolean value "alive" is set to false. Since the only reference to most objects exists in the list, garbage collection happens automatically with very little work on my part. I've also implemented a simple animation system, which should allow me to animate any object based on a sprite sheet, by setting just a few variables.

    You can download the source(603 KB) or the executable(264 KB).

    Feel free to use them in any way you'd like. I require no credit for the work.