An illuminating passage from Thomas Powers’s NYRB review of The Puzzle Palace: A Report on America’s Most Secret Agency, James Bamford’s 1983 book on the US National Security Agency (NSA).
[The NSA's] true origins go back to the First World War when a State Department code clerk, Herbert O. Yardley, tried his hand at a secret message addressed to Woodrow Wilson in May 1916. He solved it within a couple of hours and immediately concluded that the British, who controlled the eastern terminal of transatlantic cables to North America, were reading the US government’s most secret diplomatic traffic. When the United States entered the war Yardley transferred to the military, founded a Code and Cipher Solution Subsection in the office devoted to military intelligence, and at the war’s end was arranging liaison with the French Chambre noire, or “black chamber,” a name Yardley borrowed when he was appointed to head a permanent code-breaking office in the War Department in 1919. . . .
[T]he end of the war presented Yardley with two major problems. The first was the end of official censorship, which meant he no longer had automatic access to international cable traffic. Indeed, it was now against federal law to intercept messages, but Yardley quietly arranged with the management of Western Union and Postal Telegraph, the two major international carriers, for the Black Chamber to temporarily “borrow” messages. The two companies agreed to this illegal arrangement in the interest of national security, a precedent that was to be enduring.