How did the german decrypt the messages in world war 2?

by JusWow

I am not sure if this is the right subreddit for this question. So I watched Imitation game a week ago and this was bugging the hell out of me.

The movie says that they change the enigma machine code every morning and send a weather report as the first message. Turner used this and his machine broke the encryption.

How did the German get the decryption code or know how to decrypt it? Like some of them are undersea, middle of nowhere, or somewhere fighting.

thefourthmaninaboat

Each unit or ship with an Enigma machine was also issued with a code book. This gave the settings everyone was to use on each day. New code books were issued every month. If you were away from German occupied territory for more than a month, you'd be issued with code books that covered the time for which you'd be away.

Of course, this had risks. If the code books were captured, it was trivial for the Allies to break the code until the code book ran out. Several operations were mounted in order to capture code books. One was captured after a commando raid on the Lofoten Islands of Norway, while other sets were captured from German weather ships in 1941. In May 1941, the code books of the weather ship Munchen were captured. These gave code settings for May and June 1941. However, in mid-June, the Germans changed some of their settings, to a code-book that hadn't been captured. The RN was then sent to capture the weather ship Lauenburg, and did so, retrieving her code books. Another operation was planned by Ian Flemming (of James Bond fame). He planned to have a commando unit crash a captured German bomber near a German patrol boat in the North Sea or English Channel. Once the commandos were brought aboard, they would hijack the vessel, and return to England with the boat and its codes. This operation was cancelled, as no suitable opportunities presented themselves.

Sources:

Enigma: The Battle for the Code, Hugh Sebag-Montefiore, Cassell, 2004