What if a dictator bans encryption and forces all communication to be public? Is private communication still possible? We explore a cryptographic framework that enables secure messaging by hiding in plain sight, embedding encrypted messages into natural-sounding text generated by large language models (LLMs). To casual observers, these outputs appear indistinguishable from typical LLM generations.
Building on the work of Gligoroski et al., we extend their cryptographic embedding scheme by improving its resistance to known-position attacks—threat scenarios where an adversary knows the exact locations of embedded characters. Our modified encoding strategy ensures that even with positional knowledge, the adversary gains minimal advantage in distinguishing ciphertext from innocuous text.
To improve coherence and embedding success rates, we introduce a novel tree-based decoding framework that recursively backtracks through LLM generations, selecting token paths that best align with the encrypted message while preserving fluency and meaning. This method significantly enhances the quality of the cover text without compromising the stealth of the embedding.
Finally, we present an early investigation into context-based attacks, an underexplored threat model wherein adversaries exploit thematic or topical patterns of LLMs to detect hidden content. We assess how context may unintentionally betray the presence of cryptographic embeddings and propose mitigation strategies within our framework.
Our work advances the field of steganography in generative models, offering a path toward resilient, high-quality covert communication in adversarial environments.