A digital watermarking method and related apparatus
By scrambling and encrypting the watermark and carrier image using a hyperchaotic system, and combining Zigzag and spiral scanning digital watermarking methods, the problems of vulnerability and poor robustness of digital watermarks in existing technologies are solved, and a high-security watermark embedding that can still be correctly decrypted after image transformation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AGRICULTURAL BANK OF CHINA
- Filing Date
- 2024-11-28
- Publication Date
- 2026-06-12
Smart Images

Figure CN119629284B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software technology, and in particular to a digital watermarking method and related apparatus. Background Technology
[0002] Digital watermarking technology was developed to protect the security and copyright information of existing digital media. It achieves copyright protection, content tracking, and verification by hiding specific information within the digital media. Digital watermarks do not significantly alter the appearance of the medium, but they can be extracted and identified.
[0003] At present, the implementation of digital watermarking is inseparable from image encryption algorithms. Traditional encryption algorithms encrypt images through deterministic processes, which can lead to repeated structures in the encrypted images, making them vulnerable to statistical and cryptanalysis attacks. Summary of the Invention
[0004] In view of the above problems, this application provides a digital watermarking method and related apparatus to improve the robustness and security of digital watermarking. The specific solution is as follows:
[0005] The first aspect of this application provides a digital watermarking method, the digital watermarking method comprising:
[0006] Obtain a plaintext watermark image, and then perform scrambling and encryption operations on the plaintext watermark image based on a hyperchaotic system to obtain a ciphertext watermark image.
[0007] Obtain the carrier image of the plaintext, and scramble and encrypt the carrier image of the plaintext based on the hyperchaotic system to obtain the carrier image of the ciphertext.
[0008] The watermark image of the ciphertext is embedded into the carrier image of the ciphertext, and the carrier image is decrypted to obtain the carrier image with the embedded watermark.
[0009] In one possible implementation, the step of scrambling and encrypting the plaintext watermark image based on a hyperchaotic system to obtain the ciphertext watermark image includes:
[0010] Multiple first pseudo-random sequences are obtained by iterating through the hyperchaotic system, and the length of the first pseudo-random sequence corresponds to the size of the watermark image of the plaintext.
[0011] Normalization and row-wise reset are performed on the multiple first pseudo-random sequences respectively to obtain multiple random number matrices for the watermark image. The multiple random number matrices for the watermark image include the first random number matrix corresponding to the first iteration and multiple sets of first random number matrices corresponding to non-first iterations. Each set of first random number matrices includes the second random number matrix and the third random number matrix corresponding to two consecutive iterations.
[0012] The first random number matrix is used to perform an XOR operation on the watermark image of the plaintext to obtain the first intermediate ciphertext image.
[0013] The multiple sets of first random number matrices are called sequentially according to the iteration rounds;
[0014] The first intermediate ciphertext image is subjected to a Zigzag scan to obtain a first scan sequence. The first scan sequence is then XORed and row-wise reset using the second random number matrix from the first set of called random number matrices to obtain a second intermediate ciphertext image.
[0015] The second intermediate ciphertext image is spiral-scanned to obtain a second scan sequence, and the second scan sequence is XORed and row-by-row reset using the third random number matrix in the first set of called random number matrices to obtain a third intermediate ciphertext image.
[0016] If not all of the multiple sets of first random number matrices are called, the third intermediate ciphertext image is used as the first intermediate ciphertext image, and the step of calling the multiple sets of first random number matrices in turn according to the iteration round is returned to be executed until all of the multiple sets of first random number matrices are called, and the latest third intermediate ciphertext image is output as the watermark image of the ciphertext.
[0017] In one possible implementation, the step of scrambling and encrypting the plaintext carrier image based on the hyperchaotic system to obtain the ciphertext carrier image includes:
[0018] Multiple iterations of the hyperchaotic system are used to obtain multiple second pseudo-random sequences, the length of which corresponds to the size of the carrier image of the plaintext.
[0019] The multiple second pseudo-random sequences are normalized and reset row by row to obtain multiple random number matrices for the carrier image. The multiple random number matrices for the carrier image include the fourth random number matrix corresponding to the first iteration and multiple sets of second random number matrices corresponding to non-first iterations. Each set of second random number matrices includes the fifth random number matrix and the sixth random number matrix corresponding to two consecutive iterations.
[0020] The plaintext carrier image is XORed using the fourth random number matrix to obtain the fourth intermediate ciphertext image.
[0021] The multiple sets of second random number matrices are called sequentially according to the iteration rounds;
[0022] The fourth intermediate ciphertext image is subjected to a Zigzag scan to obtain a third scan sequence. The third scan sequence is then XORed and reset row by row using the fifth random number matrix from the second set of random number matrices that has been called, to obtain the fifth intermediate ciphertext image.
[0023] The fifth intermediate ciphertext image is spiral-scanned to obtain the fourth scan sequence, and the fourth scan sequence is XORed and row-wise reset using the sixth random number matrix in the called second random number matrix set to obtain the sixth intermediate ciphertext image.
[0024] If not all of the multiple sets of second random number matrices have been called, the sixth intermediate ciphertext image is used as the fourth intermediate ciphertext image, and the step of calling the multiple sets of second random number matrices in sequence according to the iteration round is returned until all of the multiple sets of second random number matrices have been called, and the latest sixth intermediate ciphertext image is output as the carrier image of the ciphertext.
[0025] In one possible implementation, before sequentially calling the plurality of second random number matrix sets according to the iteration rounds, the step of scrambling and encrypting the plaintext carrier image based on the hyperchaotic system to obtain the ciphertext carrier image further includes:
[0026] Perform a discrete cosine transform on the fourth intermediate ciphertext image.
[0027] In one possible implementation, embedding the watermark image of the ciphertext into the carrier image of the ciphertext and decrypting the carrier image to obtain the carrier image with the embedded watermark includes:
[0028] The carrier image of the ciphertext is subjected to discrete wavelet transform to determine the target high-frequency components to be embedded;
[0029] The watermark image of the ciphertext is embedded into the target high-frequency component of the carrier image of the ciphertext in reverse order to obtain the watermark embedding result of the carrier image of the ciphertext.
[0030] The watermark embedding result is subjected to discrete wavelet inverse transform and decryption to obtain the carrier image with the embedded watermark.
[0031] In one possible implementation, before embedding the watermark image of the ciphertext into the target high-frequency component of the carrier image of the ciphertext in reverse order, the step of embedding the watermark image of the ciphertext into the carrier image of the ciphertext and decrypting the carrier image to obtain the watermark-embedded carrier image further includes:
[0032] Perform a reduction operation on the pixel values of the watermark image of the encrypted text.
[0033] A second aspect of this application provides a digital watermarking device, the digital watermarking device comprising:
[0034] The watermark encryption module is used to acquire the plaintext watermark image and scramble and encrypt the plaintext watermark image based on a hyperchaotic system to obtain the ciphertext watermark image.
[0035] The carrier encryption module is used to acquire the carrier image of the plaintext, and to scramble and encrypt the carrier image of the plaintext based on the hyperchaotic system to obtain the carrier image of the ciphertext.
[0036] An embedding module is used to embed the watermark image of the ciphertext into the carrier image of the ciphertext, and to obtain the carrier image with the embedded watermark by decrypting the carrier image.
[0037] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the digital watermarking method described in the first aspect or any implementation thereof.
[0038] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0039] The memory is used to store computer programs;
[0040] The processor is used to execute the computer program so that the electronic device can implement the digital watermarking method of the first aspect or any implementation thereof.
[0041] The fifth aspect of this application provides a computer storage medium carrying one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the digital watermarking method described in the first aspect or any implementation thereof.
[0042] By employing the above technical solution, this application provides a digital watermarking method and related apparatus, which acquires a plaintext watermark image, scrambles and encrypts the plaintext watermark image using a hyperchaotic system to obtain a ciphertext watermark image; acquires a plaintext carrier image, scrambles and encrypts the plaintext carrier image using a hyperchaotic system to obtain a ciphertext carrier image; embeds the ciphertext watermark image into the ciphertext carrier image, and decrypts the carrier image to obtain the carrier image with the embedded watermark. Hyperchaotic systems possess complex dynamic characteristics, as well as features such as uncertainty, non-periodicity, and initial value sensitivity. This application utilizes a hyperchaotic system to scramble and encrypt the watermark image and carrier image respectively, thereby completing the watermark embedding, which effectively improves the robustness and security of the digital watermark. Attached Figure Description
[0043] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0044] Figure 1 A flowchart illustrating a digital watermarking method provided in an embodiment of this application;
[0045] Figure 2 This is a partial flowchart illustrating a digital watermarking method provided in an embodiment of this application;
[0046] Figure 3 This is another schematic flowchart of a digital watermarking method provided in an embodiment of this application;
[0047] Figure 4 This is another schematic flowchart of a digital watermarking method provided in an embodiment of this application;
[0048] Figure 5 An example of a plaintext carrier image provided for an embodiment of this application;
[0049] Figure 6 An example of a plaintext watermark image provided in an embodiment of this application;
[0050] Figure 7 An example of a carrier image of encrypted text provided in an embodiment of this application;
[0051] Figure 8 An example of a watermarked image for encrypted text provided in this application embodiment;
[0052] Figure 9 An example of a carrier image with an embedded watermark provided in this application embodiment;
[0053] Figure 10 An example of an extracted watermark image provided in this application embodiment;
[0054] Figure 11 This is a schematic diagram of the structure of a digital watermarking device provided in an embodiment of this application;
[0055] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0056] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0057] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0058] The terms "first," "second," etc., used in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0059] To facilitate understanding of this application, the relevant concepts involved in this application will be explained below:
[0060] Digital watermarking is a technology that embeds hidden information into digital media (images, audio, video, etc.). The hidden information is typically used for the identification, tracking, and verification of the content, such as media owner information and copyright information.
[0061] Embedding: The process of embedding hidden information into a digital carrier, making it a medium with specific information.
[0062] Extraction: The process of extracting watermark information from a carrier containing watermark information. The extracted watermark information can be used to verify a series of information about the carrier.
[0063] Robustness: The ability of a digital watermarking algorithm to resist attacks.
[0064] Security: Digital watermarking algorithms offer protection against tampering and ensure privacy of hidden information.
[0065] Chaotic system: A dynamical system whose behavior is non-periodic, sensitive to initial conditions, and independent of external inputs.
[0066] Lyapunov exponents are numerical characteristics used to describe the average exponential divergence rate of adjacent trajectories in phase space. They represent the system's sensitivity to initial conditions. Lyapunov exponents can measure the convergence and divergence rates of the system's trajectories, as well as whether the system is in a chaotic state.
[0067] Hyperchaotic systems are a special type of chaotic system, exhibiting higher dynamic complexity and randomness than ordinary chaotic systems. Hyperchaotic systems typically possess multiple positive Lyapunov exponents, indicating more complex dynamic behavior. This application selects the Lorenz hyperchaotic system as a tool for generating pseudo-random sequences. The expression for the Lorenz hyperchaotic system is shown in the following formula (1):
[0068]
[0069] Where a is the Prandtl number in the classical Lorenz system, used to determine the relative velocity of the fluid layer; b is the geometric factor, usually related to the physical geometry of the system; c represents the Rayleigh number, which is related to the convection intensity of the system; and r is the new parameter, used to control the influence of the new variable ω on the system, usually related to the loss characteristics of the system.
[0070] The Lorenz hyperchaotic system is a modification of the classical Lorenz system. The classical Lorenz system is a simplified three-dimensional model. By introducing some nonlinear terms and additional driving forces into this system, a hyperchaotic Lorenz system is obtained. In the above formula (1), when a = 10, b = 8 / 3, c = 28, and -1.52 ≤ r ≤ -0.06, the system is in a hyperchaotic state.
[0071] Peak signal-to-noise ratio (PSNR) is used to identify the ratio between the maximum possible power of a signal and the power of destructive noise that affects the fidelity of its representation. In image processing, it is mainly used to quantify the reconstruction quality of images affected by lossy compression and is widely used in digital watermarking. Generally speaking, a PSNR value below 20dB indicates unacceptable image quality; a PSNR value between 20-30dB indicates poor image quality; an image quality between 30-40dB indicates good image quality, with distortion but not affecting the image's information expression; and an image quality above 40dB indicates excellent image quality, very close to the original image.
[0072] Normalized pixel contrast ratio (NPCR) is a metric used to compare the similarity between two images. An ideal NPCR value is 100%. Generally, a higher NPCR value indicates that the image retains more detail during compression.
[0073] Structural Similarity (SSIM) is an indicator that measures the similarity between two images. It measures the similarity between the watermark image extracted from the carrier image and the original watermark image, thereby judging the completeness of the watermark extraction. The value of SSIM ranges from [0,1]. The larger the value of SSIM, the smaller the difference between the extracted watermark image and the original watermark image, that is, the higher the completeness.
[0074] Digital watermarking technology is used to embed specific identifiers into digital media to track information such as ownership, content, and source. Digital watermarking technology focuses on robustness, security, and privacy. Currently, there are various implementation methods for digital watermarking, such as spatial domain watermarking, frequency domain watermarking, and hash-based watermarking. The following sections will introduce spatial domain watermarking, frequency domain watermarking, and hash-based watermarking respectively:
[0075] 1) Spatial watermarking technology. The Least Significant Bit (LSB) algorithm is one of the earliest proposed spatial digital watermarking algorithms. Its basic principle is to embed the watermark information into the least significant bit of the image pixels to achieve watermark embedding. Watermark embedding can also be achieved by embedding specific noise.
[0076] 2) Frequency Domain Watermarking Technology. Frequency domain watermarking technology embeds watermark information into the frequency domain of the carrier image. Common methods include Discrete Cosine Transform (DCT), which is also widely used in image processing. DCT transforms a two-dimensional image from the spatial domain to the frequency domain while preserving the low-frequency information (DC coefficients). Discrete Wavelet Transform (DWT) is also a commonly used image processing method. It can decompose the image signal into frequency bands of different scales, and the watermark can be embedded into wavelet coefficients of different scales to improve the robustness and security of the watermark.
[0077] 3) Hash-based watermarking technology. This technique uses a hash algorithm to encode the watermark image into a fixed-length code, which is then embedded into the carrier image to hide the information. Common hash-based watermarking techniques include MD5, SHA-1, and SHA-256.
[0078] The implementation of digital watermarking is inseparable from image encryption algorithms, and traditional encryption and embedding algorithms have many shortcomings. First, traditional encryption algorithms use deterministic processes for image encryption, which can lead to recurring structures in the encrypted image, making it vulnerable to statistical and cryptanalysis attacks. Second, current traditional encryption methods are not robust enough when performing operations such as image rotation, scaling, and compression, resulting in incorrect decryption or degraded image quality, making it difficult to clearly display image information. Traditional image encryption algorithms typically use fixed-length keys as input, and since the key space is finite, it is susceptible to attacks such as brute-force attacks. In addition, some block cipher algorithms have known security vulnerabilities and attack methods, such as differential attacks and linear attacks.
[0079] To address these issues, this application provides a digital watermarking method based on a hyperchaotic system and Zigzag spiral scrambling. Hyperchaotic systems possess complex dynamic characteristics, as well as uncertainties, aperiodicity, and sensitivity to initial conditions, which can effectively improve the robustness and security of digital watermarking.
[0080] See Figure 1 , Figure 1 This is a flowchart illustrating a digital watermarking method provided in an embodiment of this application. Figure 1 As shown in the embodiment of this application, a digital watermarking method may include steps S10 to S30, which are described in detail below.
[0081] S10: Obtain the plaintext watermark image, and scramble and encrypt the plaintext watermark image based on the hyperchaotic system to obtain the ciphertext watermark image.
[0082] In this embodiment of the application, a watermark image of plaintext to be embedded is obtained, and the watermark image of plaintext is scrambled by a superchaotic system using a Zigzag spiral to encrypt the watermark image, thereby obtaining a watermark image of ciphertext.
[0083] See Figure 2 , Figure 2 This is a partial flowchart illustrating a digital watermarking method provided in an embodiment of this application. Figure 2 As shown in the embodiment of this application, a digital watermarking method is provided, wherein step S10, "scrambling and encrypting the plaintext watermark image based on a hyperchaotic system to obtain a ciphertext watermark image", may include steps S101 to S107, which are described in detail below.
[0084] S101, multiple first pseudo-random sequences are obtained by using a hyperchaotic system for multiple iterations. The length of the first pseudo-random sequence corresponds to the size of the plaintext watermark image.
[0085] In this embodiment of the application, it is assumed that the plaintext watermark image is a pixel matrix of size m×n. If the plaintext watermark image is a color image, then the plaintext watermark image is first converted into a grayscale image.
[0086] A hyperchaotic system is initialized by taking initial values and preprocessing them. The hyperchaotic system iterates based on these initial values, and each iteration yields a pseudo-random sequence (i.e., the first pseudo-random sequence) of length 2000+m×n. By taking multiple sets of initial values, the hyperchaotic system can undergo multiple iterations to obtain multiple first pseudo-random sequences. The first 2000 random numbers are discarded, resulting in a final first pseudo-random sequence of length m×n. It should be noted that the value of 2000 can be set according to the actual scenario, and this embodiment does not limit this.
[0087] S102, normalize and reset the multiple first pseudo-random sequences respectively to obtain multiple random number matrices for the watermark image. The multiple random number matrices for the watermark image include the first random number matrix corresponding to the first iteration and multiple sets of first random number matrices corresponding to non-first iterations. Each set of first random number matrices includes the second random number matrix and the third random number matrix corresponding to two consecutive iterations.
[0088] In this embodiment of the application, for each of the multiple first pseudo-random sequences, the first pseudo-random sequence is first normalized to normalize the random numbers in it to 0 to 255, and then the random number matrix is obtained by resetting the rows.
[0089] For the multiple random number matrices for the watermarked image mentioned above, they can be divided into a first random number matrix corresponding to the first iteration, and multiple sets of random number matrices corresponding to subsequent iterations (i.e., the first random number matrix set). Each first random number matrix set contains a second random number matrix and a third random number matrix corresponding to two consecutive iterations. For ease of understanding, assume that the multiple random number matrices for the watermarked image include random number matrix 1, random number matrix 2, random number matrix 3, random number matrix 4, and random number matrix 5 obtained sequentially by a hyperchaotic system in 5 iterations. After division, random number matrix 1 can be regarded as the first random number matrix, random number matrix 2 and random number matrix 3 can be combined to form the first random number matrix set 1, and random number matrix 4 and random number matrix 5 can be combined to form the first random number matrix set 2. Furthermore, random number matrix 2 is regarded as the second random number matrix in the first random number matrix set 1, random number matrix 3 is regarded as the third random number matrix in the first random number matrix set 1, random number matrix 4 is regarded as the second random number matrix in the first random number matrix set 2, and random number matrix 5 is regarded as the third random number matrix in the first random number matrix set 2.
[0090] S103, XOR the plaintext watermark image with the first random number matrix to obtain the first intermediate ciphertext image.
[0091] In this embodiment of the application, the plaintext watermark image is XORed with a first random number matrix to obtain the corresponding intermediate ciphertext image (i.e., the first intermediate ciphertext image), which is a pixel matrix with a size of m×n.
[0092] S104, calls multiple sets of first random number matrices sequentially according to the iteration round.
[0093] In this embodiment, the multiple sets of first random number matrices obtained above are called sequentially in ascending order of iteration rounds. Continuing with the example of multiple random number matrices for watermarked images, including random number matrix 1, random number matrix 2, random number matrix 3, random number matrix 4, and random number matrix 5 obtained sequentially through 5 iterations of a hyperchaotic system, first set 1 of first random number matrices is called, followed by set 2 of first random number matrices.
[0094] S105, perform a Zigzag scan on the first intermediate ciphertext image to obtain a first scan sequence, and use the second random number matrix in the first set of called random number matrices to perform an XOR operation on the first scan sequence and reset it row by row to obtain a second intermediate ciphertext image.
[0095] In this embodiment, a Zigzag scan is performed on the first intermediate ciphertext image to obtain a scan sequence of length m×n (i.e., the first scan sequence). Then, the first scan sequence is XORed and row-wise reset using the second random number matrix from the first set of random number matrices, thereby obtaining the corresponding intermediate ciphertext image (i.e., the second intermediate ciphertext image), which is a pixel matrix of size m×n.
[0096] Assuming the first random number matrix set currently invoked is the first random number matrix set 1, then the first scan sequence is XORed and reset row by row using random number matrix 2 to obtain the second intermediate ciphertext image.
[0097] S106, the second intermediate ciphertext image is spirally scanned to obtain the second scan sequence, and the second scan sequence is XORed and reset row by row using the third random number matrix in the first set of random number matrices called to obtain the third intermediate ciphertext image.
[0098] In this embodiment of the application, a spiral scan is performed on the second intermediate ciphertext image to obtain a scan sequence (i.e., the second scan sequence) of length m×n. Then, the second scan sequence is XORed and row-wise reset using the third random number matrix in the first set of random number matrices, thereby obtaining the corresponding intermediate ciphertext image (i.e., the third intermediate ciphertext image), which is a pixel matrix of size m×n.
[0099] Assuming the first random number matrix set currently invoked is the first random number matrix set 1, then the second scan sequence is XORed and reset row by row using random number matrix 3 to obtain the third intermediate ciphertext image.
[0100] S107, if not all of the multiple sets of first random number matrices have been called, use the third intermediate ciphertext image as the first intermediate ciphertext image, return to step S104, and continue until all of the multiple sets of first random number matrices have been called, then output the latest third intermediate ciphertext image as the watermark image of the ciphertext.
[0101] In this embodiment, we continue to use multiple random number matrices for watermark images, including random number matrix 1, random number matrix 2, random number matrix 3, random number matrix 4, and random number matrix 5 obtained sequentially through 5 rounds of iteration of a hyperchaotic system. Assuming that the currently invoked first random number matrix is the first random number matrix set 1, the third intermediate ciphertext image obtained by random number matrix 3 will be used as the first intermediate ciphertext image, and we return to step S104, that is, continue to invoke the first random number matrix set 2, and repeat steps S105 and S106. At this time, all of the first random number matrix sets have been invoked, and the third intermediate ciphertext image obtained by random number matrix 5 will be used as the watermark image of the ciphertext.
[0102] S20: Obtain the carrier image of the plaintext, and scramble and encrypt the carrier image of the plaintext based on the hyperchaotic system to obtain the carrier image of the ciphertext.
[0103] In this embodiment of the application, a carrier image of plaintext is obtained, and the carrier image of plaintext is scrambled by a Zigzag spiral based on a hyperchaotic system to encrypt the carrier image and obtain a carrier image of ciphertext.
[0104] See Figure 3 , Figure 3 This is another schematic flowchart illustrating a digital watermarking method provided in an embodiment of this application. Figure 3 As shown in the embodiment of this application, a digital watermarking method is provided, wherein step S20, "scrambling and encrypting the plaintext carrier image based on a hyperchaotic system to obtain the ciphertext carrier image", may include steps S201 to S207, which are described in detail below.
[0105] S201, multiple iterations of a hyperchaotic system are used to obtain multiple second pseudo-random sequences, the length of which corresponds to the size of the plaintext carrier image.
[0106] In this embodiment of the application, it is assumed that the embedding relationship between the watermark image and the carrier image is required to be 1:4, that is, one pixel in the watermark image corresponds to 2×2 pixels in the carrier image. At this time, the carrier image of the plaintext is a pixel matrix with a size of 2m×2n. If the carrier image of the plaintext is a color image, then the carrier image of the plaintext is first converted into a grayscale image.
[0107] The hyperchaotic system is initialized by taking initial values and performing preprocessing operations on these initial values. It should be noted that the initial values used for encrypting the carrier image and encrypting the watermark image can be the same or different, and can be set according to the actual scenario; this application embodiment does not limit this.
[0108] The hyperchaotic system iterates based on the obtained initial values, and each iteration yields a pseudo-random sequence (i.e., a second pseudo-random sequence) of length 2000 + 2m × 2n. By taking multiple sets of initial values for the hyperchaotic system, multiple iterations can be performed to obtain multiple second pseudo-random sequences. The first 2000 random numbers are discarded, and the final length of the second pseudo-random sequence is 2m × 2n. It should be noted that the value of 2000 can be set according to the actual scenario, and this application embodiment does not limit it. It should also be noted that the number of iterations of the hyperchaotic system can be the same or different when encrypting the carrier image and when encrypting the watermark image, and can be set according to the actual scenario; this application embodiment does not limit it.
[0109] S202, normalize and reset the multiple second pseudo-random sequences respectively to obtain multiple random number matrices for the carrier image. The multiple random number matrices for the carrier image include the fourth random number matrix corresponding to the first iteration and multiple sets of second random number matrices corresponding to non-first iterations. Each set of second random number matrices includes the fifth random number matrix and the sixth random number matrix corresponding to two consecutive iterations.
[0110] In this embodiment of the application, for each of the multiple second pseudo-random sequences, the second pseudo-random sequence is first normalized to normalize the random numbers in it to 0 to 255, and then the random number matrix is obtained by resetting the rows.
[0111] The multiple random number matrices for the carrier image can be divided into the fourth random number matrix corresponding to the first iteration and multiple sets of random number matrices corresponding to non-first iterations (i.e., the second set of random number matrices). Each set of second random number matrices contains the fifth and sixth random number matrices corresponding to two consecutive iterations. For ease of understanding, assume that multiple random number matrices for the carrier image are obtained sequentially through 7 iterations of a hyperchaotic system: random number matrix 6, random number matrix 7, random number matrix 8, random number matrix 9, random number matrix 10, random number matrix 11, and random number matrix 12. After partitioning, random number matrix 6 can be considered the fourth random number matrix; random number matrix 7 and random number matrix 8 can be combined to form the second random number matrix set 1; random number matrix 9 and random number matrix 10 can be combined to form the second random number matrix set 2; and random number matrix 11 and random number matrix 12 can be combined to form the second random number matrix set 3. Furthermore, random number matrix 7 is considered the fifth random number matrix in the second random number matrix set 1, random number matrix 8 is considered the sixth random number matrix in the second random number matrix set 1, random number matrix 9 is considered the fifth random number matrix in the second random number matrix set 2, random number matrix 10 is considered the sixth random number matrix in the second random number matrix set 2, random number matrix 11 is considered the fifth random number matrix in the second random number matrix set 3, and random number matrix 12 is considered the sixth random number matrix in the second random number matrix set 3.
[0112] S203, use the fourth random number matrix to perform an XOR operation on the plaintext carrier image to obtain the fourth intermediate ciphertext image.
[0113] In this embodiment of the application, the plaintext carrier image is XORed using a fourth random number matrix to obtain the corresponding intermediate ciphertext image (i.e., the fourth intermediate ciphertext image), which is a pixel matrix with a size of 2m×2n.
[0114] S204 calls multiple sets of second random number matrices sequentially according to the iteration rounds.
[0115] In this embodiment, the multiple sets of second random number matrices obtained above are called sequentially in ascending order of iteration rounds. Continuing with the example of multiple random number matrices for watermarked images, including random number matrices 6, 7, 8, 9, 10, 11, and 12 obtained sequentially through 7 iterations of a hyperchaotic system, the process is as follows: first, second random number matrix set 1 is called, then second random number matrix set 2 is called, and finally second random number matrix set 3 is called.
[0116] S205, perform a Zigzag scan on the fourth intermediate ciphertext image to obtain the third scan sequence, and use the fifth random number matrix in the called second random number matrix set to perform an XOR operation on the third scan sequence and reset it row by row to obtain the fifth intermediate ciphertext image.
[0117] In this embodiment of the application, a Zigzag scan is performed on the fourth intermediate ciphertext image to obtain a scan sequence (i.e., the third scan sequence) with a length of 2m×2n. Then, the first scan sequence is XORed and row-wise reset using the fifth random number matrix in the called second random number matrix set to obtain the corresponding intermediate ciphertext image (i.e., the fifth intermediate ciphertext image), which is a pixel matrix with a size of 2m×2n.
[0118] Assuming the currently invoked second random number matrix set is the second random number matrix set 1, then the third scan sequence is XORed and reset row by row using random number matrix 6 to obtain the fifth intermediate ciphertext image.
[0119] S206, the fifth intermediate ciphertext image is spirally scanned to obtain the fourth scan sequence, and the sixth random number matrix in the second set of random number matrices is used to perform an XOR operation and row-by-row reset on the fourth scan sequence to obtain the sixth intermediate ciphertext image.
[0120] In this embodiment, a spiral scan is performed on the fifth intermediate ciphertext image to obtain a scan sequence (i.e., the fourth scan sequence) with a length of 2m×2n. Then, the fourth scan sequence is XORed and row-wise reset using the sixth random number matrix from the second set of random number matrices, thereby obtaining the corresponding intermediate ciphertext image (i.e., the sixth intermediate ciphertext image), which is a pixel matrix with a size of 2m×2n.
[0121] Assuming the currently invoked second random number matrix set is the second random number matrix set 1, then the fourth scan sequence is XORed and reset row by row using random number matrix 7 to obtain the sixth intermediate ciphertext image.
[0122] S207, if not all of the multiple sets of second random number matrices have been called, use the sixth intermediate ciphertext image as the fourth intermediate ciphertext image, and return to execute the step of calling multiple sets of second random number matrices in turn according to the iteration rounds until all of the multiple sets of second random number matrices have been called, and output the latest sixth intermediate ciphertext image as the carrier image of the ciphertext.
[0123] In this embodiment, we continue to take the example of multiple random number matrices for watermarked images, including random number matrices 6, 7, 8, 9, 10, 11, and 12 obtained sequentially through 7 iterations of a hyperchaotic system.
[0124] Assuming the currently invoked second random number matrix is the second random number matrix set 1, the third intermediate ciphertext image obtained using random number matrix 8 will be used as the first intermediate ciphertext image. The process returns to step S104, that is, the second random number matrix set 2 is invoked again, and steps S105 and S106 are repeated. Then, the third intermediate ciphertext image obtained using random number matrix 10 is used as the first intermediate ciphertext image, and the process returns to step S104, that is, the second random number matrix set 3 is invoked again, and steps S105 and S106 are repeated. At this point, the entire second random number matrix set has been invoked, and the third intermediate ciphertext image obtained using random number matrix 12 will be used as the watermark image for the ciphertext.
[0125] In one possible implementation, discrete cosine transform can also be used to process the carrier image to reduce the resource consumption of the carrier image. In this regard, an embodiment of this application provides a digital watermarking method, which, before executing step S204 "sequentially calling multiple sets of second random number matrices according to the iteration rounds," further includes the following steps:
[0126] Perform discrete cosine transform on the fourth intermediate ciphertext image.
[0127] S30, embed the watermark image of the ciphertext into the carrier image of the ciphertext, and obtain the carrier image with embedded watermark by decrypting the carrier image.
[0128] In this embodiment of the application, after the watermark image encryption and carrier image encryption are completed, the watermark image of the ciphertext can be embedded into the carrier image of the ciphertext, and the carrier image can be decrypted to obtain the carrier image containing the watermark.
[0129] See Figure 4 , Figure 4 This is another schematic flowchart illustrating a digital watermarking method provided in an embodiment of this application. Figure 4 As shown in the embodiment of this application, a digital watermarking method is provided, wherein step S30, "embedding the watermark image of the ciphertext into the carrier image of the ciphertext and decrypting the carrier image to obtain the carrier image with the embedded watermark", may include steps S301 to S303, which are described in detail below.
[0130] S301, Perform discrete wavelet transform on the carrier image of the ciphertext to determine the target high-frequency component to be embedded.
[0131] In this embodiment of the application, discrete wavelet transform is performed on the carrier image of the ciphertext to obtain four components: LL, LH, HL, and HH. LL represents the low-frequency subband component, LH represents the horizontal high-frequency subband component, HL represents the vertical high-frequency subband component, and HH represents the diagonal high-frequency subband component.
[0132] In discrete wavelet transform, low-frequency components mainly contain the overall structure and approximate shape information of the image, while high-frequency components mainly contain the edge and detail information of the image. Therefore, in this embodiment, the watermark is embedded into the high-frequency components, that is, LH is used as the target high-frequency component, so as not to affect the overall display effect of the original image.
[0133] S302, embed the watermark image of the ciphertext into the target high-frequency component of the carrier image of the ciphertext in reverse order to obtain the watermark embedding result of the carrier image of the ciphertext.
[0134] In this embodiment, the dimensions of each high-frequency component after discrete wavelet transform of the carrier image are the same as the dimensions of the watermark image. Continuing with the example where the watermark image of the ciphertext is a pixel matrix of size m×n and the high-frequency components of the carrier image of the ciphertext are pixel matrices of size m×n, the watermark is embedded in reverse order. That is, the (i,j)th pixel of the watermark image of the ciphertext is embedded into the (mi,nj)th pixel of the high-frequency components of the carrier image of the ciphertext. Since the pixel value ranges from 0 to 255, to avoid the pixel value of the carrier image exceeding 255 after embedding, which would result in missing image information, the pixel values of the watermark image of the ciphertext are reduced before embedding.
[0135] S303, perform discrete wavelet inverse transform and decryption on the watermark embedding result to obtain the carrier image with the embedded watermark.
[0136] In this embodiment of the application, after the watermark embedding is completed, the watermark embedding result is subjected to discrete wavelet inverse transform to obtain the encrypted carrier image with embedded watermark, and then the carrier image with embedded watermark is obtained by reversing the encryption process of the carrier image.
[0137] In the implementation examples, the Lorenz hyperchaotic system can be selected as a tool for generating random sequences. Because hyperchaotic systems are highly sensitive to initial conditions, even small changes can lead to completely different system trajectories. Therefore, using a hyperchaotic system can improve the security and reliability of image encryption. This application tested the similarity of pseudo-random sequences generated by the Lorenz hyperchaotic system under three different initial values and different iteration numbers, using Euclidean distance as the similarity measurement index. It should be noted that Euclidean distance, also known as Euclidean distance, is a commonly used distance definition that represents the true distance between two points in N-dimensional space. The specific expression is shown in the following formula (2):
[0138]
[0139] This invention applies Euclidean distance as a similarity index, and the specific results are shown in Table 1 below:
[0140] Table 1
[0141]
[0142]
[0143] As can be seen from Table 1 above, when the initial values are small, the Euclidean distance of the obtained sequence values increases with the number of iterations, indicating that the pseudo-random sequences obtained under different initial values are quite different, which is consistent with the characteristic that chaotic sequences are highly sensitive to initial values.
[0144] Experiments were conducted on standard image processing files using the experimental methods described in this application. See [link to application]. Figure 5 , Figure 5 An example of a plaintext carrier image provided for an embodiment of this application. For example... Figure 5 As shown, the plaintext carrier image selected for the experiment in this application is the standard experimental image Lena, with an image size of 512×512. See also... Figure 6 , Figure 6 An example of a plaintext watermark image provided for an embodiment of this application. For example... Figure 6 As shown, the plaintext watermark image selected for the experiment in this application is the standard experimental image Cameraman, with an image size of 256×256.
[0145] In Figure 5 and Figure 6 Based on this, a watermark embedding experiment was conducted, and the experimental results are as follows: Figure 7 and Figure 8 As shown, where, Figure 7 This application provides an example of a carrier image for encrypted text. Figure 8 An example of a watermarked image for encrypted text provided in an embodiment of this application. From Figure 7 and Figure 8 As can be seen, the NPCR values of the ciphertext carrier image and the ciphertext watermark image reach 99.61% and 99.56% respectively, indicating that the encrypted images are completely dissimilar to the original images, and no useful information can be extracted from them. See also Figure 9 , Figure 9 An example of a carrier image with an embedded watermark provided in an embodiment of this application. Figure 9 The PSNR value of the carrier image with the embedded watermark is 48.72, indicating that the quality of the embedded image is extremely high, almost indistinguishable from the original carrier image, and that the embedding does not affect the quality of the original image. See also Figure 10 , Figure 10 An example of an extracted watermark image provided in an embodiment of this application. Figure 10 Indicates from Figure 9The extracted watermark image has an SSIM value of 0.913, indicating that it is consistent with the original watermark image and there is no information loss, thus proving the validity of this application.
[0146] Based on the above description, the digital watermarking method provided in this application embodiment uses a hyperchaotic system to scramble and encrypt the watermark image and the carrier image respectively, thereby completing the watermark embedding, which can effectively improve the robustness and security of the digital watermark.
[0147] The above describes a digital watermarking method provided by the embodiments of this application. The following will describe the apparatus for performing the above digital watermarking method.
[0148] See Figure 11 , Figure 11 This is a schematic diagram of the structure of a digital watermarking device provided in an embodiment of this application. Figure 11 As shown in the embodiment of this application, a digital watermarking device includes:
[0149] Watermark encryption module 10 is used to obtain the plaintext watermark image and scramble and encrypt the plaintext watermark image based on the hyperchaotic system to obtain the ciphertext watermark image.
[0150] The carrier encryption module 20 is used to obtain the carrier image of the plaintext and to scramble and encrypt the carrier image of the plaintext based on the hyperchaotic system to obtain the carrier image of the ciphertext.
[0151] The embedding module 30 is used to embed the watermark image of the ciphertext into the carrier image of the ciphertext, and to obtain the carrier image with the embedded watermark by decrypting the carrier image.
[0152] In one possible implementation, the watermark encryption module 10 is specifically used for:
[0153] Multiple iterations using a hyperchaotic system yield multiple first pseudo-random sequences, the length of which corresponds to the size of the plaintext watermark image. These first pseudo-random sequences are then normalized and reordered row-wise to obtain multiple random number matrices for the watermark image. These matrices contain the first random number matrix corresponding to the first iteration and sets of first random number matrices corresponding to subsequent iterations. Each set of first random number matrices contains second and third random number matrices corresponding to two consecutive iterations. The plaintext watermark image is XORed with the first random number matrices to obtain a first intermediate ciphertext image. Multiple sets of first random number matrices are then called sequentially according to the iteration rounds. Finally, the first intermediate ciphertext image is subjected to a Zigzag scan. The process involves obtaining a first scan sequence, XORing it with the second random number matrix from the first set of called random number matrices, and resetting it row-by-row to obtain a second intermediate ciphertext image. A spiral scan is then performed on the second intermediate ciphertext image to obtain a second scan sequence, XORing it with the third random number matrix from the first set of called random number matrices, and resetting it row-by-row to obtain a third intermediate ciphertext image. If not all first random number matrix sets are called, the third intermediate ciphertext image is used as the first intermediate ciphertext image, and the process returns to calling multiple first random number matrix sets sequentially according to the iteration rounds until all first random number matrix sets are called. Finally, the latest third intermediate ciphertext image is output as the watermark image of the ciphertext.
[0154] In one possible implementation, the carrier encryption module 20 is specifically used for:
[0155] Multiple iterations using a hyperchaotic system yield multiple second pseudo-random sequences, the length of which corresponds to the size of the plaintext carrier image. These second pseudo-random sequences are then normalized and row-wise reset to obtain multiple random number matrices for the carrier image. These matrices contain a fourth random number matrix corresponding to the first iteration and multiple sets of second random number matrices corresponding to subsequent iterations. Each set of second random number matrices contains a fifth and a sixth random number matrix corresponding to two consecutive iterations. The plaintext carrier image is XORed with the fourth random number matrix to obtain a fourth intermediate ciphertext image. Multiple sets of second random number matrices are then called sequentially according to the iteration rounds. Finally, the fourth intermediate ciphertext image is subjected to a Zigzag scan. The third scan sequence is obtained, and the fifth random number matrix from the called second random number matrix set is used to XOR the third scan sequence and reset it row by row to obtain the fifth intermediate ciphertext image. The fifth intermediate ciphertext image is then spirally scanned to obtain the fourth scan sequence, and the sixth random number matrix from the called second random number matrix set is used to XOR the fourth scan sequence and reset it row by row to obtain the sixth intermediate ciphertext image. If not all of the multiple second random number matrix sets have been called, the sixth intermediate ciphertext image is used as the fourth intermediate ciphertext image, and the process of calling multiple second random number matrix sets in sequence according to the iteration round is repeated until all of the multiple second random number matrix sets have been called. Finally, the latest sixth intermediate ciphertext image is output as the carrier image of the ciphertext.
[0156] In one possible implementation, the carrier encryption module 20 is also used for:
[0157] Perform discrete cosine transform on the fourth intermediate ciphertext image.
[0158] In one possible implementation, the embedded module 30 is specifically used for:
[0159] Discrete wavelet transform is performed on the carrier image of the ciphertext to determine the target high-frequency component to be embedded; the watermark image of the ciphertext is embedded into the target high-frequency component of the carrier image of the ciphertext in reverse order to obtain the watermark embedding result of the carrier image of the ciphertext; the watermark embedding result is subjected to inverse discrete wavelet transform and decryption to obtain the carrier image with embedded watermark.
[0160] In one possible implementation, the embedded module 30 is also used for:
[0161] Perform a reduction operation on the pixel values of the watermark image of the encrypted text.
[0162] It should be noted that the detailed functions of each module in the embodiments of this application can be found in the corresponding disclosures of the above-mentioned digital watermarking method embodiments, and will not be repeated here.
[0163] This application also provides an electronic device in its embodiments. See also... Figure 12 , Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device in this embodiment may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 12 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0164] like Figure 12 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage device 1208 into a random access memory (RAM) 1203. When the electronic device is powered on, the RAM 1203 also stores various programs and data required for the operation of the electronic device. The processing unit 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0165] Typically, the following devices can be connected to I / O interface 1205: input devices 1206 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1207 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1208 including, for example, memory card, hard disk, etc.; and communication devices 1209. Communication device 1209 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0166] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the digital watermarking methods provided in this application.
[0167] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the digital watermarking methods provided in this application.
[0168] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0170] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0171] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A digital watermarking method, characterized in that, The digital watermarking method includes: Obtain a plaintext watermark image, and then perform scrambling and encryption operations on the plaintext watermark image based on a hyperchaotic system to obtain a ciphertext watermark image. Obtain the carrier image of the plaintext, and scramble and encrypt the carrier image of the plaintext based on the hyperchaotic system to obtain the carrier image of the ciphertext. The watermark image of the ciphertext is embedded into the carrier image of the ciphertext, and the carrier image is decrypted to obtain the carrier image with the embedded watermark. The step of scrambling and encrypting the plaintext watermark image based on a hyperchaotic system to obtain the ciphertext watermark image includes: Multiple first pseudo-random sequences are obtained by iterating through the hyperchaotic system, and the length of the first pseudo-random sequence corresponds to the size of the watermark image of the plaintext. Normalization and row-wise reset are performed on the multiple first pseudo-random sequences respectively to obtain multiple random number matrices for the watermark image. The multiple random number matrices for the watermark image include the first random number matrix corresponding to the first iteration and multiple sets of first random number matrices corresponding to non-first iterations. Each set of first random number matrices includes the second random number matrix and the third random number matrix corresponding to two consecutive iterations. The first random number matrix is used to perform an XOR operation on the watermark image of the plaintext to obtain the first intermediate ciphertext image. The multiple sets of first random number matrices are called sequentially according to the iteration rounds; The first intermediate ciphertext image is subjected to a Zigzag scan to obtain a first scan sequence. The first scan sequence is then XORed and row-wise reset using the second random number matrix from the first set of called random number matrices to obtain a second intermediate ciphertext image. The second intermediate ciphertext image is spiral-scanned to obtain a second scan sequence, and the second scan sequence is XORed and row-by-row reset using the third random number matrix in the first set of called random number matrices to obtain a third intermediate ciphertext image. If not all of the multiple sets of first random number matrices are called, the third intermediate ciphertext image is used as the first intermediate ciphertext image, and the step of calling the multiple sets of first random number matrices in turn according to the iteration round is returned to be executed until all of the multiple sets of first random number matrices are called, and the latest third intermediate ciphertext image is output as the watermark image of the ciphertext.
2. The digital watermarking method according to claim 1, characterized in that, The process of scrambling and encrypting the plaintext carrier image based on the hyperchaotic system to obtain the ciphertext carrier image includes: Multiple iterations of the hyperchaotic system are used to obtain multiple second pseudo-random sequences, the length of which corresponds to the size of the carrier image of the plaintext. The multiple second pseudo-random sequences are normalized and reset row by row to obtain multiple random number matrices for the carrier image. The multiple random number matrices for the carrier image include the fourth random number matrix corresponding to the first iteration and multiple sets of second random number matrices corresponding to non-first iterations. Each set of second random number matrices includes the fifth random number matrix and the sixth random number matrix corresponding to two consecutive iterations. The plaintext carrier image is XORed using the fourth random number matrix to obtain the fourth intermediate ciphertext image. The multiple sets of second random number matrices are called sequentially according to the iteration rounds; The fourth intermediate ciphertext image is subjected to a Zigzag scan to obtain a third scan sequence. The third scan sequence is then XORed and reset row by row using the fifth random number matrix from the second set of random number matrices that has been called, to obtain the fifth intermediate ciphertext image. The fifth intermediate ciphertext image is spiral-scanned to obtain the fourth scan sequence, and the fourth scan sequence is XORed and row-wise reset using the sixth random number matrix in the called second random number matrix set to obtain the sixth intermediate ciphertext image. If not all of the multiple sets of second random number matrices have been called, the sixth intermediate ciphertext image is used as the fourth intermediate ciphertext image, and the step of calling the multiple sets of second random number matrices in sequence according to the iteration round is returned until all of the multiple sets of second random number matrices have been called, and the latest sixth intermediate ciphertext image is output as the carrier image of the ciphertext.
3. The digital watermarking method according to claim 2, characterized in that, Before sequentially calling the multiple sets of second random number matrices according to the iteration rounds, the step of scrambling and encrypting the plaintext carrier image based on the hyperchaotic system to obtain the ciphertext carrier image further includes: Perform a discrete cosine transform on the fourth intermediate ciphertext image.
4. The digital watermarking method according to claim 1, characterized in that, The step of embedding the watermark image of the ciphertext into the carrier image of the ciphertext and decrypting the carrier image to obtain the carrier image with the embedded watermark includes: The carrier image of the ciphertext is subjected to discrete wavelet transform to determine the target high-frequency components to be embedded; The watermark image of the ciphertext is embedded into the target high-frequency component of the carrier image of the ciphertext in reverse order to obtain the watermark embedding result of the carrier image of the ciphertext. The watermark embedding result is subjected to discrete wavelet inverse transform and decryption to obtain the carrier image with the embedded watermark.
5. The digital watermarking method according to claim 4, characterized in that, Before embedding the watermark image of the ciphertext into the target high-frequency component of the carrier image of the ciphertext in reverse order, the step of embedding the watermark image of the ciphertext into the carrier image of the ciphertext and decrypting the carrier image to obtain the carrier image with the embedded watermark further includes: Perform a reduction operation on the pixel values of the watermark image of the encrypted text.
6. A digital watermarking device, characterized in that, The digital watermarking device includes: The watermark encryption module is used to acquire the plaintext watermark image and scramble and encrypt the plaintext watermark image based on a hyperchaotic system to obtain the ciphertext watermark image. The carrier encryption module is used to acquire the carrier image of the plaintext, and to scramble and encrypt the carrier image of the plaintext based on the hyperchaotic system to obtain the carrier image of the ciphertext. An embedding module is used to embed the watermark image of the ciphertext into the carrier image of the ciphertext, and to obtain the carrier image with the embedded watermark by decrypting the carrier image. The watermark encryption module, based on a hyperchaotic system, performs scrambling and encryption operations on the plaintext watermark image to obtain the ciphertext watermark image, specifically used for: Multiple first pseudo-random sequences are obtained by iterating through the hyperchaotic system, and the length of the first pseudo-random sequence corresponds to the size of the watermark image of the plaintext. Normalization and row-wise reset are performed on the multiple first pseudo-random sequences respectively to obtain multiple random number matrices for the watermark image. The multiple random number matrices for the watermark image include the first random number matrix corresponding to the first iteration and multiple sets of first random number matrices corresponding to non-first iterations. Each set of first random number matrices includes the second random number matrix and the third random number matrix corresponding to two consecutive iterations. The first random number matrix is used to perform an XOR operation on the watermark image of the plaintext to obtain the first intermediate ciphertext image. The multiple sets of first random number matrices are called sequentially according to the iteration rounds; The first intermediate ciphertext image is subjected to a Zigzag scan to obtain a first scan sequence. The first scan sequence is then XORed and row-wise reset using the second random number matrix from the first set of called random number matrices to obtain a second intermediate ciphertext image. The second intermediate ciphertext image is spiral-scanned to obtain a second scan sequence, and the second scan sequence is XORed and row-by-row reset using the third random number matrix in the first set of called random number matrices to obtain a third intermediate ciphertext image. If not all of the multiple sets of first random number matrices are called, the third intermediate ciphertext image is used as the first intermediate ciphertext image, and the step of calling the multiple sets of first random number matrices in turn according to the iteration round is returned to be executed until all of the multiple sets of first random number matrices are called, and the latest third intermediate ciphertext image is output as the watermark image of the ciphertext.
7. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the digital watermarking method as described in any one of claims 1 to 5.
8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the digital watermarking method as described in any one of claims 1 to 5.
9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the digital watermarking method as described in any one of claims 1 to 5.