If it hadn’t been for a shortfall in the supply of random numbers, one of history’s most infamous spy rings might never have been exposed. The shortage occurred in late 1941, two years after the start of World War II. With Hitler’s invading armies poised to overrun Moscow, Soviet leader (and erstwhile bank robber) Joseph Stalin ordered key personnel to evacuate the capital. In the chaos that followed, the NKVD — Stalin’s intelligence agency and forerunner of the KGB — made a mistake that would doom all the Soviet agents who would infiltrate the Manhattan Project, the top-secret American effort to build an atomic bomb.
The error involved the NKVD’s codebooks, known as one-time pads, which used random numbers to scramble letters, words and phrases. The random-number key to any particular one-time pad was known only to the sender and recipient. Without it, the encoded message couldn’t be deciphered. As the name suggests, one-time pads were meant to be used once and then destroyed. Used properly, they were completely unbreakable. But making them required the laborious printing of volumes of random numbers. No one knows exactly how the Soviets produced random numbers — computers were still in their infancy. According to some accounts, the NKVD employed a roomful of women who would blurt out numbers haphazardly, or they may have used something like a lottery machine, with numbered balls. This much is known: Their schemes failed to meet demand.
“The Soviet Union couldn’t make random numbers fast enough and distribute them to all the places that needed them,” says Jane Nordholt, a retired physicist from Los Alamos National Laboratory in New Mexico, where the Manhattan Project was based. Faced with the need to encode tens of thousands of messages, NKVD officials cut corners: They printed more than 35,000 pages of duplicate random number keys and distributed them to agents in the field. That fateful decision allowed American cryptographers to crack the Soviet codes by finding repeated patterns in coded messages that would otherwise have remained impregnable.
Two years later, in 1943, the U.S. Army’s Signal Intelligence Service — the precursor of the National Security Agency — started a secret program called Venona to monitor Soviet diplomatic telegrams. The program paid off in December 1946, when Meredith Gardner, a gifted young linguist and cryptographer, deciphered a message that mentioned the names of American scientists involved in the Manhattan Project. His work eventually unmasked all the spies who had revealed American bomb-building plans to the Soviets, including husband and wife team Julius and Ethel Rosenberg, who were executed for treason in 1953. Venona’s crucial role in the Cold War remained hidden from the public until 1995, when the project was finally declassified.