Cryptanalysis of Pseudorandom Error-Correcting Codes

Tianrui Wang, Anyu Wang, Tianshuo Cong, Delong Ran, Jinyuan Liu, Xiaoyun WangarXiv 2025 · DOI

As AI-generated content (AIGC) becomes ubiquitous, the need for reliable watermarking—identifying content as machine-made—has become a critical pillar of AI governance. A promising new tool for this is the Pseudorandom Error-Correcting Code (PRC), introduced at CRYPTO 2024. PRCs are designed to be "stealthy" (indistinguishable from random noise) and "robust" (surviving edits or noise).

However, while PRCs have strong theoretical foundations based on hard problems like Learning Parity with Noise (LPN), their security had not been tested against concrete, practical parameters. This paper presents the first comprehensive cryptanalysis of PRCs, demonstrating that watermarks can be detected or removed with significantly less effort than the theoretical 128-bit security level suggests.

Breaking the Stealth: Three Specialized Attacks

The authors propose three specialized attacks targeting the two core properties of PRCs: undetectability and robustness. These attacks exploit vulnerabilities introduced by "acceleration tricks" used in practical implementations, such as specific matrix sampling methods.

  1. Attack-I: Partial Secret Key Recovery: Using a Meet-in-the-Middle (MITM) approach combined with Information Set Decoding (ISD), the authors recover portions of the secret key. This allows them to mimic the decoding process and distinguish watermarked content from plain content with high probability.
  2. Attack-II: Weak Key Distinguisher: The authors identified a vulnerability in how keys are generated. In current implementations, there is a high probability of generating "weak keys" where rows of the public key are identical. By exploiting these structural biases, an attacker can detect a watermark in linear time.
  3. Attack-III: Noise Overlay Attack: This attack targets robustness. By first recovering the specific noise vector used in the watermark, the attacker can craft a "malicious" noise overlay. This disrupts the decoding process while maintaining the same total "error weight," effectively removing the watermark without destroying the content quality.
Summary of the three proposed attacks, including their goals, time complexity, and additional requirements.

Experimental Validation

The authors validated their attacks using real-world generative models and datasets, including DeepSeek-R1-Distill-Qwen-7B for text and Stable Diffusion 2.1 for images.

Key results from these experiments include:

  • Efficiency: Attack-I can detect watermarks at a cost of only $2^{22}$ operations, far below the expected cryptographic security levels.
  • Success Rates: In real-world tests, the attacks achieved a 100% success rate in detecting watermarks against both DeepSeek and Stable Diffusion under common parameter settings ($t=3$).
  • Security Bounds: For LLMs, the security level of the current scheme cannot exceed 75 bits for any practical code length ($n \le 2^{17}$), failing to reach the standard 128-bit security wall.

Key Insights: Theory vs. Practice

A major insight regarding Large Language Models (LLMs) is the "Gibberish" Trade-off. For a PRC watermark to be detectable by the intended receiver, the LLM must produce high-entropy (highly random) text. In practice, this often results in the model outputting unreadable nonsense or mixing languages, making the current PRC scheme impractical for high-quality text generation.

Furthermore, the authors found that for certain parameters, the probability of generating a weak key is nearly 100%, making the "undetectable" watermark trivial to find. This highlights the fragility of stealth when theoretical primitives are adapted for performance.

Conclusion and Future Directions

To address these vulnerabilities, the authors propose a Revised Key Generation Algorithm that uses Gaussian elimination to ensure row independence, effectively eliminating the weak key vulnerability. However, several hurdles remain for the field. The current scheme for LLMs remains essentially unusable for high-quality text due to entropy requirements, and the inversion process for diffusion models remains noisy and difficult to characterize theoretically. Finding a way to embed PRCs without degrading content quality or compromising security remains an open and critical problem for AI safety.

Summary updated

BibTeX
@misc{wang2025cryptanalysis,
  author = {Tianrui Wang and Anyu Wang and Tianshuo Cong and Delong Ran and Jinyuan Liu and Xiaoyun Wang},
  title = {{Cryptanalysis of Pseudorandom Error-Correcting Codes}},
  year = {2025},
  eprint = {2512.17310},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.17310},
}
Figure