We always hear about enigma and how it was cracked by the allies but never how allies got their messages around
For information on the coding systems used by the Allies (and especially the British) and German attempts to break them during the war, see my answers here, here, here and here.