The Enigma machine was invented by a German engineer Arthur Scherbius shortly after WW1
The machine (of which a number of varying types were produced) resembled a typewriter. It had a lamp board above the keys with a lamp for each letter. The operator pressed the key for the plaintext letter of the message and the enciphered letter lit up on the lamp board. It was adopted by the German armed forces between 1926 and 1935. The machine contained a series of interchangeable rotors, which rotated every time a key was pressed to keep the cipher changing continuously. This was combined with a plug board on the front of the machine where pairs of letters were transposed; these two systems combined offered 103 sextillion possible settings to choose from, which the Germans believed made Enigma unbreakable.
The Poles had broken Enigma in as early as 1932, but in 1939 with the prospect of war, the Poles decided to inform the British of their successes. Dilly Knox, one of the former British World War One Codebreakers, was convinced he could break the system and set up an Enigma Research Section, comprising himself and Tony Kendrick, later joined by Peter Twinn, Alan Turing and Gordon Welchman. They worked in the stable yard at Bletchley Park and that is where the first wartime Enigma messages were broken by the British in January 1940. Enigma traffic continued to be broken routinely at Bletchley Park for the remainder of the war.