A million pages of new World War II codebreaking records have been released by the U.S. Army and Navy and the British government over the last five years. Now, Battle of Wits presents the history of the war that these documents reveal. From the Battle of Midway until the last German code was broken in January 1945, this is an astonishing epic of a war that was won not simply by brute strength but also by reading the enemy's intentions. The revelations of Stephen Budiansky's dramatic history include how Britain tried to manipulate the American codebreakers and monopolize German Enigma code communications; the first detailed published explanations of how the Japanese codes were broken; and how the American codebreaking machines worked to crack the Japanese, the German, and even the Russian diplomatic codes. This is the story of the Allied codebreakers puzzling through the most difficult codebreaking problems that ever existed. At the same time, the compelling narrative shows the crucial effect codebreaking had on the battle-fields by explaining the urgency of stopping the wolf pack U-boat attacks in the North Atlantic, the burning desire in the United States to turn the tide of the war after Pearl Harbor, the importance of halting Rommel's tanks in North Africa, and the necessity of ensuring that the Germans believed the Allies' audacious deception and cover plans for D-Day. Budiansky brings to life the unsung code-breaking heroes of this secret war: Joseph J. Rochefort, an intense and driven naval officer who ran the codebreaking operation in "The Dungeon", a dank basement at Pearl Harbor, that effectively won the Battle of Midway; Alan Turing, the eccentric father of the computerage, whose brilliant electromechanical calculators broke the German Enigma machine; and Ian Fleming, whose daredevil espionage schemes to recover codebooks resembled the plots of the 007 novels he later wrote. Among the villains, we meet the Nazi Admiral Donitz, who led the submarine wolf packs against Allied shipping in the North Atlantic with horrific casualty rates -- until the codebreakers stopped him. Budiansky, a Harvard-trained mathematician, demonstrates the mathematical insight and creativity of the cryptographers by showing step-by-step precisely how the codes were broken. This technology -- the flow of information, its encryption, and the computational methods of recovering it from the enemy -- had never before been so important to the outcome of a war. Informative diagrams, maps, appendices, and photographs show exactly how, why, and where the secret war was won. Unveiled for the first time, the complete story of codebreaking in World War II has now been told.