The Enigma was a mechanical cipher system created around 1918 and produced by Scherbius & Ritter, a German engineering firm. It was invented by Arthur Scherbius to replace the pencil and paper cipher systems used during WWI with machines. The company produced both a commercial version and a millitary version. The millitary version was designed to be stronger than the commercial version.

This machine consisted of a number of components. At the highest level it is comprised of a keyboard to enter the plaintext, a scrambling unit, and a display board. The scrambling unit contained several wheels that performed most of the scrambling. The scrambling wheels had wiring on them. They were like very short cylinders or disks that had electrical wiring to take electric currents from one side of the disk to the other. These paths did not head straight through the disk, they wound around through the disk and exited at some other point on the opposite side. Each wheel had a different wiring scheme. The wheels sat one after the other and the current would pass through all three disks. But this would still basically be multiple simple substitution cipher which is no stronger than a single simple substitution cipher. To make the cipher better the first wheel turns one position after each click of a key on the keyboard. The second wheel rotates one position, after each full revolution of the first wheel and so on. Doing this makes the engima machine a polyalphabetic substitution cipher. But this still wasn't good enough, a stationary reflector was added after the wheels to reflect the signal back throught the three wheels along another path. At this point we have the current being send by a key pressed on the keyboard through the wheels, through the reflector and back through the wheels along another path, and finally lighting a letter on the display board.

This still wasn't deemed good enough either, so they also added a plugboard that allowed the operator to set up a simple substitution between two letters using a cable. This plugboard was placed between the keyboard/display and the rest of the scrambling unit. With several cables you could substitute several letters. Now we have the signal going from the keyboard throught the plugboard, through the scrambling wheels, through the reflector, back through the scrambling wheels along another path, back through the plugboard, and out to the display. This is the basic construction of the Enigma machine used by Germany during WWII. The original design had three wheels in use, a later version contained 5. Jetifi tells me the original version also contained a plugboard with a default A to A mapping

Wait there is more. The wheels could be placed in any order. And while you could only use three (or five) wheels at one time you could have additional ones that could be swapped in also. The German code books contained the primary settings of the Enigma for a given day, which included which scramblers were used, in what order, in what starting position, and what letters were swapped on the plugboard. To make messages even harder to decrypt only the beginning of a german message were encrypted with the day settings specified in the code book. This beginning contained three letters that told the operator how to set the wheels for the rest of the message, intially these three letters were repeated once. So the first six letters of a message in plaintext might have been HJUHJU. Which after decrypting this beginning block with the day's settings the operator would reset the first wheel to H, the second to J, and the third to U and decrypt the rest of the message. (obviously the five wheel version had five letters instead of three). This meant that of all the german messages the Allies captured they only had very small pieces of ciphertext encrypted the same way. Note the repetition, and remember that any repetition is the downfall of any encryption scheme.

For more info see
http://www.attlabs.att.co.uk/andyc/enigma/about_enigma.html
http://www.gl.umbc.edu/~lmazia1/Enigma/enigma.html
An applet that simulates the Enigma
http://www.attlabs.att.co.uk/andyc/enigma/enigma_j.html
Part of the Everything2 Crypto Project.