Magic
As early as the 1920s, cryptographers employed by the U.S. military worked to decode Japanese transmissions. The project, known simply as Magic, was a joint effort of the U.S. Army’s Signals Intelligence Service and the U.S. Navy’s Communications Special Unit, and was based at Arlington Hall in Arlington, Virginia.
Magic decoded several different Japanese codes, beginning with RED in 1923, after the acquisition of a Japanese code book. The Japanese created a more complex code, in use from 1930 onward. Called BLUE by Magic, this was decoded successfully by 1932. In 1939, Germany provided Japan with modified Enigma machines. The Enigma machines created the code called PURPLE. American engineers reverse engineered the Japanese Enigma machine and managed to partially decode PURPLE fairly quickly; however, Magic could not regularly decode PURPLE until after 1942.
While PURPLE was used for diplomatic transmissions, it was not used by the Japanese Navy; therefore, there was no way to decode information about Pearl Harbor before it occurred; however, PURPLE did provide ongoing information sent between the Germans and Japan. This was shared with U.S. Allies during the War, but Japan refused to believe that PURPLE had been decoded.
Transmissions had to be intercepted, decoded, translated and distributed. This process was challenging and time-consuming. The combined Army and Navy staff at Magic did their jobs well; however, the cryptography resources available at Magic were not always effectively used or shared. The Army and Navy took turns distributing decrypts, and choosing which decrypts were important enough to share and which were not. Prior to Pearl Harbor, no copies of decrypts were available to officers allowed to read them.
There is some discussion of the potential role of Magic in the creation of internment camps for Japanese-Americans in World War II. In the records of messages intercepted and decoded by Magic, there are several messages that suggest Japanese intention to rely upon Japanese-Americans to act to collect intelligence.