1931: Herbert Yardley's "The American Black Chamber" was released.
The American Black Chamber was denounced by the U.S. government as having given away American secrets - primarily secrets about how and when cryptanalysis had been applied — not only against likely adversaries, but also against U.S. allies. This led to Public Law 37, signed by Franklin D. Roosevelt in 1933, criminalizing any such future exposure.
Learn more about Yardley via the link below. And make sure to visit the Black Chamber/Yardley exhibit at the National Cryptologic Museum.