The year was 1944, and despite the ongoing Second World War, it was an election year. Republican Governor Thomas Dewey, who was running for President, heard rumors that incumbent President Franklin D. Roosevelt had secret information before the war that could have prevented the Japanese attack on Pearl Harbor on December 7, 1941. In order to accuse Roosevelt of negligence, however, Dewey needed proof. He believed he was finding it.

At that time America’s highest ranking military officer was General George C. Marshall, the Army Chief of Staff and outranking even Generals Eisenhower and MacArthur. Marshall knew something that Dewey didn’t, but offered to share it if Dewey promised to keep the secret. Dewey, however, was reluctant, fearing a possible political trap by Roosevelt. Dewey didn’t want to be sworn to silence if Roosevelt was claiming “national security” purgatives to conceal a scandalous failure. Dewey relented only when Marshall cast the promise as a mere gentlemen’s agreement. Even then, to avoid a face-to-face meeting that the press might notice, Marshall sent Dewey a letter which, once read, was to be returned to its trusted courier, Colonel Carter Clarke. Clarke himself wore civilian clothes to the meeting at Dewey’s home.

“My Dear Governor,” the letter began — and proceeded to divulge one of the country’s biggest secrets: the United States had broken several of Japan’s secret codes and, even before the war, was reading the secret messages of Japanese diplomats. Unfortunately, the messages in 1941 did not mention the date of the upcoming attack on Pearl Harbor, not “until the last message before December 7, which did not reach our hands until the following day, December 8.”

An American tragedy, to be sure. Now, however, the Japanese were suffering tragedies too — because they were continuing to use their compromised codes. Marshall revealed that the naval battles of Coral Sea and Midway were American victories in large part because “our few ships were in the right place at the right time.” Otherwise, those ships might have been thousands of miles away. Convoys of Japanese supply ships continued to suffer heavy losses because Japan’s coded messages revealed their sailing dates and the convoys’ routes. American submarines had only to wait in ambush.

Marshall’s letter then warned that open Congressional inquiries into the Pearl Harbor debacle (in other words, open inquiries by Dewey’s Republican friends on Capitol Hill) might arouse Japanese suspicions that their codes had been broken — and then, almost immediately, a vital source of intelligence might vanish. To underscore the point, Marshall complained that “Donovan’s people” — that is, General Donovan’s Office of Strategic Services (OSS) — had, “without telling us,” burglarized the Japanese Embassy in Lisbon, Portugal. The Japanese, fearing the worst, subsequently changed their entire military attaché code, worldwide. The incident had occurred the year before, and yet, Marshall lamented, American cryptographers had still not broken the new code.

Certainly this remarkable letter had some surprises for Governor Dewey.

Equally remarkable was Dewey’s reply. After reading the letter, he declared that it didn’t tell him anything he didn’t already know, aside from two details. He complained that this entire code-breaking operation was the worst kept secret in Washington — that Dewey himself could name at least twelve Senators who knew all about it; that U.S. Naval personnel throughout the Pacific commonly talked about how that their information about Japanese forces must be coming from broken Japanese codes.

Dewey admitted that he had not heard the OSS story before. And Dewey found it hard to believe that the Japanese, after their defeats at Coral Sea and Midway, were still using codes that predated the Pearl Harbor attack years earlier. Dewey suspected that President Roosevelt was guilty of a Pearl Harbor cover-up. If true, Dewey said, Roosevelt “shouldn’t be reelected — he should be impeached!” To claim that the Japanese were still using pre-Pearl Harbor codes was, for Dewey, just too convenient for Roosevelt’s benefit.

Yet, this letter asserted exactly that. If Roosevelt himself had sent him the letter, Dewey would not have believed it. But because the letter came from General Marshall, whose honor and integrity Dewey respected, he did believe it.

So why, Dewey asked Clarke, did the last Japanese message before the Pearl Harbor attack arrive so late to be deciphered? Clarke explained that, in 1941, the listening stations intercepting Japanese communications were on the American west coast. What they collected, still in code, was then flown to Washington, D.C. The system was considered fast for the time, but tragically it wasn’t fast enough. Clarke said the wartime effort now involved 10,000 Army and 8,000 Naval personnel.

Why hadn’t the Japanese changed their codes since? They tried — by modifying the codes. For a simple example, imagine that the word battleship is encrypted as 12345. Have you changed the code if the new encryption is 54321? Or 31524? Not much, if the same old cipher machine is generating the number sets. Indeed, every word can be a different number set each time it appears, but that doesn’t change the code very much until the entire cipher machine gets replaced. The Japanese, Clarke said, were apparently having trouble replacing their cipher machines throughout their forces.

Marshall had one more sensitive reason for asking Dewey not to publicly say, nor even imply, that America had broken any Japanese codes. By confiding it now, Marshall hoped Dewey would hush his friends in Congress.

The reason involved the Axis alliance. When Italy’s Benito Mussolini and Germany’s Adolf Hitler first made their alliance, Mussolini called it the Rome-Berlin Axis — implying that the world would “revolve” around it. (On a map, Rome and Berlin are roughly on the same longitude line.) That interesting imagery got skewed when Japan joined, becoming the Rome-Berlin-Tokyo Axis.

Still, Hitler admired Japan’s martial history and gleeful he had Japan as an ally. In December 1941, after the Pearl Harbor attack, the United States declared war on Japan — but only on Japan, not on Germany or Italy. Hitler, already at war with Great Britain, the Soviet Union, and a slew of other countries, could have avoided making yet one more enemy, let alone of the world’s leading industrial power. But Japan was his ally and so he declared war on the United States. Mussolini followed.

There was, however, a problem: Japan didn’t return the favor by declaring war on the Soviet Union. Japan and the Soviet Union had a non-aggression pact — and Tokyo chose to keep that deal with Joseph Stalin. In 1943, when German forces came very close to winning the Battle of Stalingrad, Stalin reinforced Stalingrad by transferring Soviet troops from Siberia, weakening Siberia’s defenses because he knew that Japan would not attack. Stalingrad ended up a huge defeat for Germany.

Still, Hitler treated the Japanese ambassador, Hiroshi Oshima, with great respect. The two men discussed Hitler’s intentions concerning one issue or another. The Germans even granted the Ambassador a privileged look at the so-called Atlantic Wall — a line of coastal defenses the Germans erected against a possible amphibious invasion from across the English Channel. (That invasion arrived in June 1944.)

Ambassador Oshima duly reported all of this in his messages to Tokyo — and, unbeknownst to him, also to Washington. For the Americans had broken the Japanese diplomatic code. Meanwhile, the British had broken the code of Germany’s Enigma cipher machine, but those messages rarely contained conversations with Hitler himself. General Marshall’s secret letter to Governor Dewey revealed that the Allies’ prime source of intelligence about Hitler’s intentions in Europe were Oshima’s messages. The Ambassador’s other messages had helped too.

This was yet another reason why the German-Japanese alliance was not so beneficial for Germany.

Remarkably, some years earlier, the Germans did worry that Japan’s codes were vulnerable. So, to help the Japanese, the Germans sent them Germany’s best cipher machine — the Enigma. Which the Allies had broken.

So the German-Japanese alliance was not so beneficial for Japan either.

Governor Dewey, now informed, kept his promise to General Marshall: in the heated election campaign of 1944, Dewey never mentioned that America had broken any Japanese codes — despite him knowing this from sources in addition to Marshall. Evidently, Dewey also persuaded his Capitol Hill friends to hush up, for the secret remained officially unacknowledged for decades.

Oshima, meanwhile, survived the war, returned to Japan, and died in 1975. Remaining Hitler’s friend to the end, at least in spirit, Oshima never learned that he himself was one of the Allies’ best sources of intelligence at the dark heart of the Third Reich.

Now for a minor piece of trivia: it turns out that OSS personnel — “Donovan’s people,” in Marshall’s words — were not the culprits who burglarized the Japanese Embassy in Lisbon. Marshall had been misinformed, and by extension so was Dewey. Yet, whoever the culprits were, the story apparently made quite an impression. For Dewey, it represented a warning that even the worst kept secret in Washington was still a secret, and that sloppy security by other people did not justify exposing that secret.

So Dewey didn’t.