How the Poles used "openings"
In trying to break the Enigma code, the Poles and the British made use of flaws in either the conceptualization of the machine (for example, that a letter would never be coded into itself), or from the use of the machine by the Germans. One example of the latter is how the Poles used the "openings" of messages to determine the wiring of the rotors.
The Germans used the following protocol when using Enigma. On a given day, there would be a rotor setting that everyone in the whole system would use (e.g. JKL). If you wanted to code a message, you would first set the rotor settings to JKL. Then, the user would select another three-letter rotor setting (e.g. XYZ). The user would then code XYZXYZ using the Enigma machine with the JKL initial setting. After coding the six letters, the user would change the rotor settings to XYZ, and then begin coding the message he wanted to code.
When sending a message by radio, the message would open with the coded version of XYZXYZ. After this "opening", the rest of the coded message would be sent. As a consequence, if you intercepted a message and were aware of the German protocol, you knew that the first and fourth letter came were coded from the same letter (in this case, X). The same is true for the second and fifth letter, and for the third and sixth letter.
Why is this useful? Let A be the permutation that occurs in the first state (the one that changes the first X into something else), let B be the permutation for the second state, etc …, and consider the permutation AD. Suppose dmq vbn is one of the openings. Then we know that A will transpose d and some other letter (in our example, X), and D will transpose v and the same other letter. So we can conclude that AD will replace d with v.
Now suppose we had the following openings from the same day:
dmq vbn von puy puc fmq fby dla
(This example is from Rejewski’s paper.) We can then conclude that AD will replace d with v, v with p, p with f, and f with d. In other words, we have now found a cycle (d v p f) which is a factor of the permutation AD. We can do the same with BE and CF, and with enough openings, we can determine the exact formulas of these three permutations.
The remaining step is to determine A and D from AD. This is not so easy. We do know that both A and D are each the product of 13 transpositions, because of the nature of the Enigma machine. Rejewski also proved a theorem that said that in this case, then AD would be made up of pairs of cycles of the same length. So, in the example just given, if we find a cycle of length 4, then there should be another cycle of length 4 in the formula for AD. Further, Rejewski wrote is his paper that you could make use of "the encipherers’ habits) in order to determine A and D.