An "enigma", as defined in the dictionary, is a "dark, obscure, or inexplicable saying; a riddle; a statement, the hidden meaning of which is to be discovered or guessed". The Germans certainly chose a fitting name for their cipher machine, as it took several years of wartime before the British were able to decode any of its encrypted messages.
The Enigma machine was first patented by German engineer Arthur Scherbius in 1918, commercially produced in 1923, and from that point on was refined by the various German military sectors until it reached its final form in 1945. The basic components of the machine were a set of three rotors (clockwork-like wheels), a plug board, and a reflector board. The plug board controlled which set of 12 letters were to be set to match each other - for example, A to R. The rotors and rotor keys were set according to a "day book" that the operator received. Once the preparatory steps had been completed, the machine was prepared to send messages. The genius of the device was that instead of reading information that had been coded only once (as with a symbol scanner), it was able to read information that had been encoded as many as nine times.
When a letter was pressed, such as B, it would first be fed through the three rotor wheels, which might route B to U, U to T, and T to A. It would then reach the reflector board, which (following the above example) would reroute A into R. The letter would then pass back through the rotor wheels, with the result of being altered three more times before arriving in its final form. The mathematics behind this system meant that it was impossible for a letter to be encoded as itself, and the sequence of letters would only repeat after 16,900 letters. When a set of eight rotors was introduced, with three to be chosen from that set, the number of permutations possible was 3x10 to the 114th power. To prevent any issue with this sequence, messages were limited to a maximum of 250 characters, with no punctuation or numbers.
In the 1930's, Germany was beginning to steady itself after WWI by aligning with Adolf Hitler and the Nazi Party. Cautioned by the massive German loss of submarines in the previous war to faulty communications, the German army invested almost all time and effort in the creation and enhancement of the Enigma machine. This new system of communication meant that they could send important information about their plan of attack freely - the Allied forces would have no idea what was being said.
Thankfully, this was not the case for very long. Polish, British, and French mathematicians threw themselves into the cracking of the Enigma code. It was Polish mathematician Marian Rejewski who made the first progress with the permutation series, and, when joined by peers Henryk Zygalski and Jerzy Rozycki, was able to decode messages as early as 1939. Poland was overrun by the Germans in 1940, and the mathematicians fled to other allied nations, passing on the information they had collected to date.
Alan Turing, a British cryptographer, was one of those at the secret code-breaking base called Bletchley Park, located in Bedfordshire. The team worked on complete decryption of the code until December 13th, 1942 when the cipher for U-Boat communication was finally cracked, and fifteen U-Boats were uncovered in the Atlantic. This information cut the sinking of Allied ships in half, and expedited the end of the war.
While the mystery of the Enigma machine no longer exists, its mark on history and in early cryptology is indelible, and will no doubt serve as a springboard for future cryptographers and computer programmers alike.
For more information on the Enigma, and on those people who worked to invent and decode it, you may be interested in some further reading.