The Enigma machine was invented in 1918 and was adopted by the German military in the 1920s and 1930s. It worked by scrambling letters using rotors that were wired differently and could be arranged and set in many positions each day, making the encryption very difficult to break. However, Polish cryptanalysts were able to break some versions of the Enigma in the 1930s by exploiting vulnerabilities in how messages were encrypted, leading them to share their methods with British and French codebreakers before World War II.