The key to cracking the Enigma was to figure out what the settings were for the day. At the start of the war the machine had 3 rotors and a 4th was added later. There were also a set of plug wires that further increased the possibilities.
Once you found the settings, you entered the encrypted message into the machine and out came the decrypted message (and vice versa).
Turing’s machine (predecessor for modern computers) was set up to find the settings. The big break came when they figured out that the weather data was being transmitted in the beginning of the message, and I believe the messages contained “heil hitler”.
Early computers were often called Turing machines.
In parallel to the British efforts, at Blechley Park, to find the settings, Americans were working on a system in Dayton Ohio at NCR called the Bombe. The Bombe was built to solve the 4-rotor Naval Enigma machines. These early computers were mass produced and shipped to Mount Vernon Seminary for Girl, a requisitioned former boarding school in Washington DC, where they were essential to our Navy’s efforts in the Atlantic.
Some good books are “The Secret In Building 26” by Jim DeBrosse and Colin Burke, and “Seizing the Enigma” by David Kahn. You can also watch “The Imitation Game”.
I am currently reading “A Man Called Intrepid” describing William Stephenson’s contributions in winning WWII.
Among other things it describes the successful efforts at developing a system to break enigma coding even as the machine settings were constantly changed. The book does a really good job of giving WWII context to the whole enigma story.
The book also gives a good description of the difference between using intelligence for strategic and tactical purposes and the need to protect intelligence sources for larger goals.