"What the Japanese didn’t know was that barbers in the homeland knowing of the plans were the least of their worries. The Combat Intelligence Office at Pearl Harbor had broken the Japanese Navy operational code. By the beginning of March 1942, Commander Joseph Rochefort (Chief of the Combat Intelligence Office) knew within 300-400 miles the location of most of the Japanese ships. Rochefort believed that the Japanese were planning an attack on Midway for the beginning of June, but could not convince Washington of this (many in Washington believed that an attack on Hawaii or the west coast was more likely). They based their analysis on intercepts that referred to a location known as ‘AF,’ which they suspected was Midway. "
Porque os americanos quebraram o código secreto dos Japoneses.