Towards A Correct Usage of Cryptography in Semantic Watermarks for Diffusion Models
Jonas Thietke, Andreas Müller, Denis Lukovnikov, Asja Fischer, Erwin Quiring · 2025
Read Towards A Correct Usage of Cryptography in Semantic Watermarks for Diffusion Models by Jonas Thietke, Andreas Müller, Denis Lukovnikov, Asja Fischer, Erwin Quiring (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-11404.txt.
Introduction
Jonas Thietke, Andreas Müller, Denis Lukovnikov, Asja Fischer, and Erwin Quiring examine how secret-keeping tools are used inside image watermarks in this 2025 paper. Semantic watermarks hide a mark inside images made by diffusion models by shaping the starting noise. One popular line of methods leans on cryptographic building blocks to steer that noise.
The authors find several flaws in how those blocks were used, above all in a claim that quality is never lost and in how keys are handled. The flaws had already caused confusion in later work. In response, they give a fresh, general proof that the method can be lossless, grounded in a standard security notion. They then lay out how the building blocks should be set up to balance security, speed, and image quality. The paper aims to put this watermark line on firmer ground.
Catalog record
| CREATOR | Jonas Thietke, Andreas Müller, Denis Lukovnikov, Asja Fischer, Erwin Quiring |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 24 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2503-11404
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Towards A Correct Usage of Cryptography in Semantic Watermarks for Diffusion Models Jonas Thietke, Andreas Müller, Denis Lukovnikov, Asja Fischer, Erwin Quiring Abstract Semantic watermarking methods enable the direct integration of watermarks into the generation process of latent diffusion models by only modifying the initial latent noise. One line of approaches building on Gaussian Shading relies on cryptographic primitives to steer the sampling process of the latent noise. However, we identify several issues in the usage of cryptographic techniques in Gaussian Shading, particularly in its proof of lossless performance and key management, causing ambiguity in follow-up works, too. In this work, we therefore revisit the cryptographic primitives for semantic watermarking. We introduce a novel, general proof of lossless performance based on IND$-CPA security for semantic watermarks. We then discuss the configuration of the cryptographic primitives in semantic watermarks with respect to security, efficiency, and generation quality. 1 Introduction Inversion-based semantic watermarks are a novel class of watermarking methods for latent diffusion models (LDMs) ( Wen et al. 2023 ; Yang et al. 2024 ; Ci et al. 2024 ; Gunn et al. 2024 ) . These watermarks change the initial latent noise to contain a watermark pattern which is recovered later by inverting the denoising process in a diffusion model. Hence, the diffusion model does not need to be changed. Semantic watermarks are thus easy to implement and empirical results suggest a high robustness to image perturbations. As only the initial latent is changed, the watermark becomes a plausible, inherent part of the generated image, for instance, through specific object details. The semantic watermarking methods differ in how they modify the initial latent noise z_{T} and can be categorized into two types. Distribution-changing methods such as Tree-Ring ( Wen et al. 2023 ) and RingID ( Ci et al. 2024 ) add fixed circular patterns into the frequency spectrum of z_{T} which changes the distribution of z_{T} . In contrast, distribution-preserving methods such as Gaussian Shading ( Yang et al. 2024 ) and PRC Gunn et al. 2024 keep the distribution of z_{T} . They critically rely on cryptographic primitives to generate a pseudorandom sequence that steers the sampling process of z_{T} . However, Gaussian Shading, laying the foundation for distribution-preserving semantic watermarking, has not properly specified the cryptographic primitives. This can cause considerable ambiguity on the usage of this watermark method. In particular, we find that the proof of lossless performance, proving the watermark’s undetectability, is not accurately specified. Moreover, it only covers the scenario where each user generates only a single image ever. The implications for key management are not discussed either, leading to multiple possible configurations of Gaussian Shading. In this work, we revisit the cryptographic primitives for semantic watermarking. We focus on Gaussian Shading, but also discuss PRC. First, we present a novel, general proof based on IND$-CPA security ( Rogaway 2004 ) that allows demonstrating the lossless performance of a semantic watermark. It also covers the realistic watermarking scenario where a user generates multiple images. We apply this proof on Gaussian Shading and discuss its applicability to PRC. Second, we analyze the implications of this proof for the key management in semantic watermarking regarding security, efficiency, and generation quality and variety. We show that the secure configuration of Gaussian Shading does not affect the generation quality and variety, but leads to a rather inefficient scheme in terms of runtime and storage. PRC, in contrast, can also be deployed efficiently. 2 Background In this section, we shortly describe the applied cryptographic principles and the watermarking process of Gaussian Shading. Without loss of generality, we focus on the multi-bit scenario where the watermark allows detection and user identification. Stream Ciphers. One of the key advances in Gaussian Shading is the use of a stream cipher to guide the image generation process. In general, a stream cipher is an encryption algorithm that encrypts a message s by generating a keystream which is combined with the message to create a ciphertext that can be securely transmitted. In a nutshell, the cipher works as follows. First, a pseudo-random generator ( \operatorname{PRNG} ) is used to obtain a keystream, K=\operatorname{PRNG}(k,\eta) , where k is a secret key and \eta is a public nonce. Afterwards, the message is encrypted using bitwise XOR: c=K\oplus s . Note that c looks like a random bit string, which is an essential property for its use in Gaussian Shading. In order to decrypt c , the receiver first uses \operatorname{PRNG} to obtain the same keystream K as used for encryption, and then obtains the original message by using bitwise XOR: s=K\oplus c . In summary, the encryption function is \operatorname{Encr}(k,\eta,s)=\operatorname{PRNG}(k,\eta)\oplus s , and the decryption function is \operatorname{Decr}(k,\eta,c)=\operatorname{PRNG}(k,\eta)\oplus c . We refer to Katz & Lindell 2015 for a more elaborate explanation. A secure stream cipher should ensure that every change of even one bit in k and \eta entirely changes the output of \operatorname{PRNG} . Otherwise, various attacks would be possible ( Boura & Naya-Plasencia 2023 ) . Gaussian Shading applies ChaCha20 ( Bernstein et al. 2008 ) as stream cipher, which requires a 256-bit secret key k and a 96-bit nonce \eta . Watermark Generation And Verification. Figure 2 in Appendix A illustrates the watermarking process of Gaussian Shading ( Yang et al. 2024 ) . Before generating images, the provider generates a random user id m for each user. When the user prompts the provider to generate a new image given some textual description, the provider first samples a latent z_{T} with a sampling strategy \mathcal{S} and subsequently uses it to generate a new image x using the generator \mathcal{G} through iterative denoising starting from z_{T} . Gaussian Shading is integrated in the first step by changing the default sampling strategy based on a standard Gaussian \mathcal{N}(O,I) . Gaussian Shading instead uses the user identifier m to steer the sampling of z_{T} . First, m is replicated several times to increase robustness during message recovery, yielding s=\operatorname{Repl}(m) . The replicated user id s is then encrypted using a stream cipher: c=\operatorname{Encr}(k,\eta,s) . This encrypted message c is used to steer the sampling procedure \mathcal{S} . To this end, the standard normal distribution is divided into 2^{\ell} bins, each with equal probability mass. The elements of c are used to select the bins of \mathcal{N}(0,1) from which each element of the random vector z_{T} is sampled. For \ell=1 , we have two bins and randomly sample either a negative or a positive value z_{T}[i] from the Gaussian distribution depending on the binary value of c[i] . In summary, we can describe the process to obtain a watermarked image x as a concatenation of multiple functions: x=\operatorname{GS}(k,\eta,m)=\mathcal{G}(\mathcal{S}(\operatorname{Encr}(k,\,\eta,\,\operatorname{Repl}(m)))) . For watermark verification of an image x^{\prime} , the model provider performs a full inversion \mathcal{I} to get an estimated latent noise \hat{z}_{T}~=~\mathcal{I}(x^{\prime}) . Next, the inverse sampling process \mathcal{S}^{-1} is done where \hat{z}_{T} is quantized to obtain the encrypted message bits \hat{c} . After decrypting \hat{c} with \operatorname{Decr}(k,\eta,\hat{c}) and applying error correction with \operatorname{Repl}^{-1} , we obtain the recovered user id \hat{m} . Taken together, this process can be described as follows: \hat{m}=\operatorname{GS}^{-1}(k,\eta,x^{\prime})=\operatorname{Repl}^{-1}(\operatorname{Decr}(k,\,\eta,\,\mathcal{S}^{-1}(\mathcal{I}(x^{\prime})))) . The final stage is to check if \hat{m} matches with any user