Image encryption method and system based on compressed sensing and dynamic embedding

By combining a four-dimensional hyperchaotic system with adaptive compressed sensing and dynamic visual embedding technology, the problems of insufficient dynamic security, sampling efficiency and visual concealment in existing image encryption methods are solved, and efficient and secure image encryption and reconstruction are achieved.

CN121940494APending Publication Date: 2026-04-28GUANGDONG OCEAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG OCEAN UNIVERSITY
Filing Date
2026-01-21
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing image encryption methods have shortcomings in terms of dynamic security, sampling efficiency, and visual concealment. In particular, they suffer from poor reconstruction quality at high compression rates and are prone to perceptible distortion.

Method used

By employing a four-dimensional hyperchaotic system combined with adaptive compressed sensing and dynamic visual embedding techniques, a highly random key stream is generated and adaptively hidden in complex texture regions of the carrier image through discrete wavelet transform, adaptive sparsification, dynamic bidirectional diffusion, and local texture energy analysis.

Benefits of technology

It improves dynamic safety and sampling efficiency, ensures image reconstruction quality under high compression ratio, and achieves good visual concealment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121940494A_ABST
    Figure CN121940494A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication security, and discloses an image encryption method and system based on compressed sensing and dynamic embedding, and the method comprises the steps: generating an initial value of a four-dimensional hyperchaotic system according to a to-be-encrypted plaintext image and an external random number; iterating the four-dimensional hyperchaotic system by using the initial value to obtain a plurality of groups of chaotic sequences; obtaining a sparse scrambling matrix based on the plaintext image; obtaining a quantization matrix by using multiple groups of chaos sequences and the sparse scrambling matrix; executing scrambling operation on the quantization matrix based on multiple groups of chaos sequences to obtain a scrambling matrix; performing dynamic bidirectional diffusion operation on the scrambling matrix by using multiple groups of chaotic sequences to obtain a ciphertext image; and performing integer wavelet transform and local texture energy analysis processing on the carrier image to construct a dynamic embedding mechanism, decomposing the ciphertext image, and adaptively embedding the decomposed ciphertext image into a high-frequency sub-band of the carrier image to obtain a secret-carrying image. The dynamic safety, the sampling efficiency and the visual concealment are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication security technology, and in particular to an image encryption method and system based on compressed sensing and dynamic embedding. Background Technology

[0002] With the rapid development of mobile internet, cloud computing, and multimedia technologies, digital images have become a primary carrier for information exchange and data storage, widely used in various fields such as medical diagnosis, military reconnaissance, and social networks. However, the open nature of public networks exposes communicators to severe security risks during information exchange, such as privacy theft, data tampering, and illegal interception. As one of the most direct ways of information transmission, images often contain personal privacy information such as faces and fingerprints, and may even involve national security data such as military maps. Therefore, in open-channel environments, ensuring the confidentiality and security of image information has become a critical issue that urgently needs to be addressed in the field of information security.

[0003] Traditional image encryption methods generate ciphertext that resembles noise, easily alerting attackers and leading to interception or destruction. Therefore, visually meaningful image encryption techniques capable of visual camouflage have become a research hotspot. However, to hide large amounts of ciphertext data within a limited carrier space, existing schemes typically employ compressed sensing technology for image compression and encryption. However, significant technical drawbacks remain in practical applications: First, insufficient dynamic security. Existing schemes often employ low-dimensional chaotic systems with simple phase space structures and narrow usable parameter ranges, making them prone to dynamic degradation or falling into periodic windows, resulting in insufficient randomness and complexity of the keystream required for encryption. Second, low sampling efficiency. One-dimensional compressed sensing typically requires constructing large-scale measurement matrices, incurring high computational and storage overhead, making real-time sampling difficult. Simultaneously, sparsification often uses globally fixed thresholds, easily leading to the accidental deletion of key sparse coefficients and loss of detail. Third, insufficient visual concealment and poor reconstruction quality at high compression rates. Existing schemes do not fully utilize the masking properties of carrier texture, easily causing perceptible distortion; furthermore, reconstruction quality significantly degrades under high compression rates. Summary of the Invention

[0004] The purpose of this invention is to address at least one deficiency in the existing technology and provide an image encryption method and system based on compressed sensing and dynamic embedding. This invention integrates four-dimensional hyperchaos, adaptive compressed sensing and dynamic visual embedding, which effectively improves dynamic security, sampling efficiency and visual concealment.

[0005] To achieve the above objectives, in a first aspect, the present invention provides an image encryption method based on compressed sensing and dynamic embedding, the method comprising the following steps:

[0006] S1: Generate the initial values ​​of the four-dimensional hyperchaotic system based on the plaintext image to be encrypted and external random numbers; S2: Iterate the four-dimensional hyperchaotic system using the initial values ​​to obtain multiple sets of chaotic sequences; S3: Perform discrete wavelet transform and energy-based adaptive sparsification on the plaintext image to be encrypted, and scramble the positions of the obtained sparse coefficient matrix to obtain a sparse scrambled matrix. S4: Construct a measurement matrix using the multiple sets of chaotic sequences, and use the measurement matrix to perform two-dimensional compressed sensing measurement and quantization on the sparse scrambled matrix to obtain a quantization matrix; S5: Perform a scrambling operation on the quantization matrix based on the multiple sets of chaotic sequences to obtain a scrambled matrix; S6: Perform a dynamic bidirectional diffusion operation on the scrambling matrix using the multiple sets of chaotic sequences to obtain a ciphertext image; S7: Perform integer wavelet transform and local texture energy analysis on the carrier image to construct a dynamic embedding mechanism, and adaptively embed the ciphertext image into the high-frequency sub-band of the carrier image after decomposition to obtain the ciphertext image.

[0007] In a second aspect, the present invention also provides an image encryption system based on compressed sensing and dynamic embedding, the system being based on the method described in the first aspect, comprising: Initialization module: Generates initial values ​​for the four-dimensional hyperchaotic system based on the plaintext image to be encrypted and external random numbers; Iteration module: Iterates the four-dimensional hyperchaotic system using the initial values ​​to obtain multiple sets of chaotic sequences; The first scrambling module performs discrete wavelet transform and energy-based adaptive sparsification on the plaintext image to be encrypted, and scrambles the positions of the obtained sparse coefficient matrix to obtain a sparse scrambling matrix. Quantization module: Constructs a measurement matrix using the multiple sets of chaotic sequences, and uses the measurement matrix to perform two-dimensional compressed sensing measurement and quantization processing on the sparse scrambled matrix to obtain a quantization matrix; The second scrambling module performs a scrambling operation on the quantization matrix based on the multiple sets of chaotic sequences to obtain a scrambled matrix; Diffusion module: Performs dynamic bidirectional diffusion operation on the scrambling matrix using the multiple sets of chaotic sequences to obtain the ciphertext image; Encryption module: Performs integer wavelet transform and local texture energy analysis on the carrier image to construct a dynamic embedding mechanism, decomposes the ciphertext image and adaptively embeds it into the high-frequency subband of the carrier image to obtain the encrypted image.

[0008] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.

[0009] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention effectively enhances dynamic security by introducing a four-dimensional hyperchaotic system to provide a highly random key stream for the encryption process. It also combines adaptive sparsification based on subband energy with two-dimensional compressed sensing to improve sampling efficiency while ensuring image reconstruction quality under high compression ratio. Furthermore, it utilizes a dynamic embedding mechanism based on local texture energy analysis to adaptively hide the ciphertext in complex texture areas of the carrier image, achieving good visual concealment. Attached Figure Description

[0010] Figure 1 This is a flowchart of an image encryption method based on compressed sensing and dynamic embedding according to Embodiment 1 of the present invention; Figure 2 This is a block diagram of an image encryption method based on compressed sensing and dynamic embedding, according to Embodiment 1 of this aspect; Figure 3 This is a schematic diagram of concentric circle Zigzag scrambling in Embodiment 1 of the present invention; Figure 4 This is a schematic diagram of the plaintext image House in Example 2; Figure 5 This is a schematic diagram of the encrypted image House in Example 2; Figure 6 This is a schematic diagram of the carrier image Boat in Example 2; Figure 7 This is a schematic diagram of the encrypted image Boat of the encrypted image House in Example 2; Figure 8 This is a schematic diagram of the reconstructed image House in Example 2; Figure 9 This is a histogram diagram of the encrypted image House in Example 2; Figure 10 This is a schematic diagram of the Boat histogram of the carrier image in Example 2; Figure 11 This is a schematic diagram of the histogram of the encrypted image Boat in Example 2, which is the encrypted image House. Figure 12 This is a block diagram of an image encryption system based on compressed sensing and dynamic embedding, according to Embodiment 3 of the present invention. Detailed Implementation

[0011] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0012] Example 1 Please see Figure 1 , 2 A preferred embodiment of the present invention provides an image encryption method based on compressed sensing and dynamic embedding, comprising the following steps: S1: Generate the initial values ​​of the four-dimensional hyperchaotic system based on the plaintext image to be encrypted and external random numbers; S2: Iterate the four-dimensional hyperchaotic system using the initial values ​​to obtain multiple sets of chaotic sequences; S3: Perform discrete wavelet transform and energy-based adaptive sparsification on the plaintext image to be encrypted, and scramble the positions of the obtained sparse coefficient matrix to obtain a sparse scrambled matrix. S4: Construct a measurement matrix using the multiple sets of chaotic sequences, and use the measurement matrix to perform two-dimensional compressed sensing measurement and quantization on the sparse scrambled matrix to obtain a quantization matrix; S5: Perform a scrambling operation on the quantization matrix based on the multiple sets of chaotic sequences to obtain a scrambled matrix; S6: Perform a dynamic bidirectional diffusion operation on the scrambling matrix using the multiple sets of chaotic sequences to obtain a ciphertext image; S7: Perform integer wavelet transform and local texture energy analysis on the carrier image to construct a dynamic embedding mechanism, and adaptively embed the ciphertext image into the high-frequency sub-band of the carrier image after decomposition to obtain the ciphertext image.

[0013] This embodiment introduces a four-dimensional hyperchaotic system to provide a highly random key stream for the encryption process, effectively enhancing dynamic security. It also adopts a combination of adaptive sparsification based on subband energy and two-dimensional compressed sensing to improve sampling efficiency while ensuring image reconstruction quality under high compression ratio. Furthermore, it utilizes a dynamic embedding mechanism based on local texture energy analysis to adaptively hide the ciphertext in complex texture areas of the carrier image, achieving good visual concealment.

[0014] In an optional embodiment, step S1 specifically includes: S101: Construct a four-dimensional hyperchaotic system. The mathematical model of the four-dimensional hyperchaotic system (4D-SLCM) is as follows:

[0015] in, , , , For system control parameters, , , , For system state variables; S102: The plaintext image to be encrypted (size is...) Perform a SHA-256 hash operation to obtain a 256-bit hash value; S103: Divide the 256-bit hash value into eight 32-bit blocks, each block being 32 bits long. Perform cyclic shift and concatenation operations on the eight blocks to construct eight 128-bit sequences, following the construction rules as follows: , ,..., .

[0016] S104: For an 8-bit sequence Performing an XOR operation yields four 128-bit fused sequences, denoted as: , , , The calculation formula is as follows:

[0017] in, This indicates a bitwise XOR operation.

[0018] S105: Combine the four 128-bit fusion sequences , , , Convert each number to decimal to obtain the corresponding decimal number. , , , ; S106: Use the aforementioned decimal number , , , and external random numbers Calculate the initial values ​​of the four-dimensional hyperchaotic system. , , , The calculation formula is as follows:

[0019] in, This indicates the rounding operation. , This is the initial value.

[0020] In an optional embodiment, S2 specifically includes: substituting the initial value into the four-dimensional hyperchaotic system, iteratively calculating a new initial value until an iteration threshold is reached, and outputting multiple sets of chaotic sequences. In this embodiment, the iteration threshold is set to 1000 times to eliminate transient effects, ultimately obtaining four sequences of length [missing information]. chaotic sequence , , , .

[0021] In an optional embodiment, S3 specifically includes: S301: Perform a discrete wavelet transform operation on the plaintext image to be encrypted to obtain four wavelet domain coefficient sub-bands. , , , The calculation is expressed as follows:

[0022] S302: Calculate the energy of each coefficient within each wavelet domain coefficient sub-band, and sort the energies of all coefficients in each wavelet domain coefficient sub-band in descending order to obtain the energy sequence, denoted as... ,in, ; , This represents the total number of coefficients for that sub-band. S303: Set the corresponding energy retention rate for each wavelet coefficient subband. Based on the energy sequence, calculate the minimum index position that satisfies the requirement that the cumulative energy percentage is not less than the energy retention rate. The calculation formula is as follows:

[0023] S304: Based on the minimum index position From the energy sequence Take the first one from the middle The energy value, the first The square root of the energy value is used as the adaptive threshold for threshold sparsification of this subband. The calculation is expressed as follows:

[0024] S305: Based on the calculated adaptive thresholds Quantize the corresponding sub-bands: quantize all sub-bands whose absolute values ​​are less than their corresponding adaptive thresholds. The coefficients are set to zero, and after performing the above thresholding process on the four wavelet domain coefficient sub-bands respectively, they are recombined to obtain the sparse coefficient matrix. ; S306: For the sparse coefficient matrix Perform a two-dimensional Arnold transformation to obtain a sparse scrambled matrix. Its coordinate mapping formula is as follows:

[0025] in, These are the position coordinates of the coefficients before the transformation. These are the position coordinates of the coefficients after transformation. and To control the parameters, a sparse coefficient scrambling matrix is ​​obtained after a preset number of iterative transformations. .

[0026] In an optional embodiment, S4 specifically includes: S401: From the sequence of the multiple sets of chaotic sequences and The length of the cut-off is The subsequence, based on a preset sampling interval and dimensions L The two subsequences obtained are rearranged as follows: matrix sum matrix , means as follows:

[0027]

[0028] For matrix sum matrix Perform orthogonalization on each side to obtain orthogonal matrices. and ; S402: Based on the preset row sampling rate With column sampling rate Preliminary calculations were performed to determine the lengths in the row and column directions. The two measured lengths were then adjusted accordingly. L The final row measurement dimension is determined by multiples of the integer value of the row measurement dimension. Dimensions of column measurement The calculation formula is as follows:

[0029] S403: Construction size is of Hadamard matrix ,in, The multiple sets of chaotic sequences are used to generate an index for row selection: (1). Extract a length of... from the chaotic sequence X. a subsequence of , convert the subsequence Sort the element values ​​in ascending order and record the sorted index sequence. Take the index sequence The former Each index value, from the Hadamard matrix Extract the corresponding rows from the data to form a structure of size . Part Hadamard matrix ; (2). Extract a length of... from the chaotic sequence Y. a subsequence of , convert the subsequence Sort the element values ​​in ascending order and record the sorted index sequence. Take the index sequence The former Each index value, from the Hadamard matrix Extract the corresponding rows from the data to form a structure of size . Part Hadamard matrix ; S404: Based on Kronecker product operation, the obtained part Hadamard matrix , Orthogonal matrix , Combined separately, the final size is Row measurement matrix Column measurement matrix The calculation formula is as follows:

[0030] in, The Kronecker product operation is defined as follows: for any matrix With matrix Its accumulation For a dimension The block matrix is ​​specifically represented as: .

[0031] S405: Based on row measurement matrix Column measurement matrix For the sparse scrambling matrix Perform two-dimensional projection measurement (2DCS) to obtain a compressed measurement matrix. The calculation formula is as follows:

[0032] S406: For the measured value matrix Linear quantization is performed to map all its element values ​​to the standard image pixel value range [0, 255], resulting in a quantization matrix. The calculation formula is as follows: .

[0033] In an optional embodiment, S5 specifically includes: S501: Calculate the quantization matrix The total number of concentric rings , The quantization matrix is ​​arranged in order from the outside to the inside. The algorithm is decomposed layer by layer into U concentric rings. For the k-th ring (k=1,2,…,U), the pixel extraction direction is determined by the parity of the ring number: if k is odd, all pixels on that ring are extracted clockwise; if k is even, pixels are extracted counterclockwise. After extraction from each ring, a one-dimensional pixel sequence is obtained, denoted as... ; S502: From the sequence of the multiple sets of chaotic sequences W Extract a subsequence of length U from the given data. For the k-th pixel sequence Using subsequences The kth value in Calculate the shift step size of the sequence. Iterate through U sequences, performing a circular right shift operation on each sequence, with the shift amount being the corresponding shift step size, to obtain the shifted sequence. Among them, the shift step size is calculated. The formula is as follows:

[0034] in, For the k-th sequence Length; S503: Obtain all U shifted sequences , ,..., Connecting the rings from the outside in, end to end, in a ring-like sequence, forms a ring with a total length of... a one-dimensional vector ; S504: Create a size of For a blank two-dimensional matrix, please refer to Figure 3 Following the Zigzag scan path, the one-dimensional vector The elements in the matrix are sequentially filled into the blank two-dimensional matrix to obtain the scrambled matrix. .

[0035] In an optional embodiment, S6 specifically includes: S601: From the sequence of the multiple sets of chaotic sequences Z The length of the cut-off is The subsequence, based on the Construct a two-dimensional matrix from subsequences and The calculation formula is as follows:

[0036] in, Represents the modulo function. Represents the matrix reshaping function; S602: Define the diffusion coefficient used in dynamic two-way diffusion. Generation rules for the key matrix: exist position of element Extract the key matrix The lowest three bits of binary are directly constructed And set a non-zero verification mechanism: if the extracted If all values ​​are zero, then automatically... Setting it to [1,1,1] specifically means:

[0037] in, Indicates from integers Extract the first to third least significant bits sequentially from the binary representation; S603: Using a two-dimensional matrix For the scrambling matrix Perform a forward dynamic diffusion from the top left corner to the bottom right corner to generate an intermediate ciphertext matrix. The calculation formula is as follows:

[0038] S604: Using a two-dimensional matrix For the intermediate ciphertext matrix Perform a reverse dynamic diffusion from the bottom right corner to the top left corner to generate the final ciphertext image. The calculation formula is as follows:

[0039] In an optional embodiment, S7 specifically includes: S701: Transfer the encrypted image Each pixel is divided into three groups based on bit segments: the highest 3 bits, the middle 2 bits, and the lowest 3 bits. These three groups are then converted into corresponding integer values ​​to generate the encrypted image. A bit segment component matrix of the same size is denoted as: , , ;in, Obtained from the highest 3 bits of the pixel. Obtained from the middle two digits. It is obtained from the lowest 3 bits.

[0040] S702: Input size is carrier image ,in, and For the carrier image Perform integer wavelet transform to obtain four values ​​of size 1. The sub-band is denoted as: , , , ; S703: Using the high 5 bits of each high-frequency subband coefficient as a stable representation of the texture complexity at that position, the stable high-frequency subband is obtained. The calculation formula is as follows:

[0041] in, , , , ; S704: Zero-filling is applied to the stabilized high-frequency subbands to avoid out-of-bounds issues during neighborhood statistics. To expand the matrix, fill each of the four sides with one coefficient cell to obtain the filled matrix. Calculate each position ( i , j The sum of the absolute values ​​of the coefficients within a 3×3 neighborhood is used as the local texture energy at that location in that subband, generating three energy matrices respectively. Its definition is as follows:

[0042] in, , , These represent the positions of the three high-frequency sub-bands. The local texture energy is used for subsequent adaptive selection of embedded subbands.

[0043] S704: Traverse each position The local energy of the three high-frequency subbands , , Sort in descending order to get , , If the energies are equal, then proceed according to... Determine priorities and dynamically embed using a 3-3-2 strategy: Write The lowest 3 bits will Write The lowest 3 bits will Write The lowest two bits; the calculation formula is as follows:

[0044] in, Indicates the currently selected target subband; This represents the ciphertext component to be embedded; or , indicating the embedding depth.

[0045] S705: After embedding at all positions, the modified high-frequency subband is obtained. , , The modified high-frequency subband is compared with the original subband. Perform inverse integer wavelet transform together to obtain the encrypted image. .

[0046] Example 2 Please see Figures 4 to 11 To verify the superiority of the method of the present invention, this embodiment provides a specific implementation process and verification experiment of an image encryption method based on compressed sensing and dynamic embedding. The method is performed according to the following steps: Step 1: Chaotic system initialization and key stream generation. For example... Figure 4 As shown, the input is a plaintext image of size 512×512. Like the House and four external random numbers. First, a SHA-256 hash operation is performed on the plaintext image. The resulting hash value is processed and converted into four decimal numbers. Combined with the external random numbers, the initial value of the four-dimensional hyperchaotic system is calculated using a preset formula. Then, the hyperchaotic system is iterated using this initial value to generate multiple sets of chaotic sequences with high complexity and randomness, which are used for all subsequent encryption and embedding operations.

[0047] Step 2: Sparsification and Scrambling of the Plaintext Image. Perform Discrete Wavelet Transform (DWT) on the plaintext image House to obtain four frequency sub-bands. For each sub-band, calculate and sort the energy of each coefficient. Adaptively determine the threshold for each sub-band based on a preset energy retention rate, and perform coefficient sparsification. After reassembling the sparsified coefficient matrix, use a two-dimensional Arnold transform to scramble the positions, obtaining a sparse scrambling matrix. .

[0048] Step 3: Compressed Sensing Encryption Based on Structured Measurement Matrix. Two orthogonal matrices and a partial Hadamard matrix generated from chaotic row selection are constructed from the chaotic sequence. Row and column measurement matrices are generated through Kronecker product operations. and Using these two measurement matrices to sparse scramble matrices Perform two-dimensional compressed sensing projection measurement to obtain the compressed measurement matrix. Then, it is linearly quantized to the [0,255] interval to obtain a quantization matrix of size 256×256. That is, encrypted images, such as Figure 5 As shown.

[0049] Step 4: Secondary scrambling and dynamic diffusion of the ciphertext image. The quantization matrix... The sequence is decomposed into a one-dimensional sequence based on concentric rings. The cyclic shift step size of each sequence is calculated using chaotic sequences, and the shifts are performed. The shifted sequences are then reassembled into a one-dimensional vector, and then filled back into a two-dimensional matrix using a Zigzag scan to obtain the scrambled matrix. Next, two key matrices are generated from the chaotic sequence, and a dynamic diffusion coefficient generation rule based on key bits is defined. First, for... Perform a forward (top left to bottom right) diffusion to obtain the intermediate matrix O; then perform a reverse (bottom right to top left) diffusion on O to finally obtain the ciphertext image C. This ciphertext image (i.e. Figure 5 The pixel values ​​are evenly distributed, and its histogram is as follows: Figure 9 As shown, this indicates that its statistical characteristics have been effectively masked, and the encryption effect is good.

[0050] Step 5: Dynamic embedding based on texture energy analysis. For example... Figure 6 As shown, the input is a carrier image Boat with a size of 512×512. First, the carrier image is subjected to Integer Wavelet Transform (IWT) to obtain the low-frequency subband CA and high-frequency subbands CH, CV, and CD. The stable high 5 bits of the coefficients of each high-frequency subband are extracted, and the local texture energy in the 3×3 neighborhood of each position is calculated. Each pixel of the ciphertext image C is decomposed into three components: high 3 bits, middle 2 bits, and low 3 bits. For each position in the carrier image, the three high-frequency subbands are sorted according to their local energy at that position, and a "3-3-2" strategy is used to dynamically embed the three ciphertext components into the least significant bit of the corresponding subband coefficient. After embedding, the modified high-frequency subbands and the original low-frequency subbands are subjected to Inverse Integer Wavelet Transform (IIWT), as follows. Figure 7 As shown, the reconstructed image is the carrier image. Compare it with the carrier image. Figure 6 With encrypted images Figure 7 Histograms (as shown below) Figure 10 and Figure 11As shown in the figure, the two are highly similar, indicating that the embedding process did not cause any perceptible changes in statistical features, and the visual concealment is excellent.

[0051] Step Six: Ciphertext Extraction and Decryption Reconstruction. From the ciphertext image, using the same integer wavelet transform and extraction rules based on local energy analysis, each bit component of the ciphertext image can be extracted losslessly and reconstructed into the ciphertext image C. Subsequently, following the reverse steps of the encryption process, reverse dynamic diffusion, inverse Zigzag and concentric ring reconstruction, compressed sensing reconstruction (solved through optimization algorithms), inverse Arnold scrambling, and inverse wavelet transform are performed to finally obtain the decrypted and reconstructed image (e.g., ...). Figure 8 As shown in the figure. Visual comparison and objective indicators (such as PSNR) both show that the reconstructed image is highly consistent with the original plaintext image, proving that the method can guarantee high-quality reconstruction capability while achieving high compression (size compressed from 512×512 to 256×256) and high-security encryption.

[0052] In summary, this embodiment verifies the effectiveness of the method through complete simulation experiments. Experimental results show that the method proposed in this invention can: 1) generate ciphertext with uniform statistical features, effectively resisting statistical analysis; 2) embed the ciphertext into the carrier with high concealment, making the ciphertext image visually indistinguishable from the carrier image; and 3) completely extract and decrypt the ciphertext from the ciphertext image to reconstruct a high-quality original image. This comprehensively demonstrates the superior performance of this method in terms of security, concealment, and reconstruction quality.

[0053] Example 3 Please see Figure 12 An image encryption system based on compressed sensing and dynamic embedding according to an embodiment of the present invention includes: Initialization module: Generates initial values ​​for the four-dimensional hyperchaotic system based on the plaintext image to be encrypted and external random numbers; Iteration module: Iterates the four-dimensional hyperchaotic system using the initial values ​​to obtain multiple sets of chaotic sequences; The first scrambling module performs discrete wavelet transform and energy-based adaptive sparsification on the plaintext image to be encrypted, and scrambles the positions of the obtained sparse coefficient matrix to obtain a sparse scrambling matrix. Quantization module: Constructs a measurement matrix using the multiple sets of chaotic sequences, and uses the measurement matrix to perform two-dimensional compressed sensing measurement and quantization processing on the sparse scrambled matrix to obtain a quantization matrix; The second scrambling module performs a scrambling operation on the quantization matrix based on the multiple sets of chaotic sequences to obtain a scrambled matrix; Diffusion module: Performs dynamic bidirectional diffusion operation on the scrambling matrix using the multiple sets of chaotic sequences to obtain the ciphertext image; Encryption module: Performs integer wavelet transform and local texture energy analysis on the carrier image to construct a dynamic embedding mechanism, decomposes the ciphertext image and adaptively embeds it into the high-frequency subband of the carrier image to obtain the encrypted image.

[0054] The system proposed in this embodiment is based on the method of embodiment 1. Therefore, the options proposed in embodiment 1 are also applicable to this embodiment. To avoid repetition, they will not be described again here.

[0055] In addition, this embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in Embodiment 1.

[0056] The readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks, optical storage, digital video discs (DVDs), Blu-ray discs (BDs), high-definition universal discs (HVDs), etc.) and semiconductor storage (such as read-only memory (ROMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), non-volatile memory (NAND flash), solid-state drives, etc.).

[0057] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. An image encryption method based on compressed sensing and dynamic embedding, characterized in that, The method includes the following steps: S1: Generate the initial values ​​of the four-dimensional hyperchaotic system based on the plaintext image to be encrypted and external random numbers; S2: Iterate the four-dimensional hyperchaotic system using the initial values ​​to obtain multiple sets of chaotic sequences; S3: Perform discrete wavelet transform and energy-based adaptive sparsification on the plaintext image to be encrypted, and scramble the positions of the obtained sparse coefficient matrix to obtain a sparse scrambled matrix. S4: Construct a measurement matrix using the multiple sets of chaotic sequences, and use the measurement matrix to perform two-dimensional compressed sensing measurement and quantization on the sparse scrambled matrix to obtain a quantization matrix; S5: Perform a scrambling operation on the quantization matrix based on the multiple sets of chaotic sequences to obtain a scrambled matrix; S6: Perform a dynamic bidirectional diffusion operation on the scrambling matrix using the multiple sets of chaotic sequences to obtain a ciphertext image; S7: Perform integer wavelet transform and local texture energy analysis on the carrier image to construct a dynamic embedding mechanism, and adaptively embed the ciphertext image into the high-frequency sub-band of the carrier image after decomposition to obtain the ciphertext image.

2. The method according to claim 1, characterized in that, S1 specifically includes: S101: Construct a four-dimensional hyperchaotic system. The mathematical model of the four-dimensional hyperchaotic system is as follows: in, , , , For system control parameters, , , , For system state variables; S102: Perform a SHA-256 hash operation on the plaintext image to be encrypted to obtain a 256-bit hash value; S103: Divide the 256-bit hash value into eight 32-bit blocks, perform cyclic shift and concatenation operations on the eight bit blocks to obtain eight 128-bit sequences; S104: Perform an XOR operation on the 8-bit sequence to obtain 4 128-bit fused sequences; S105: Convert the four 128-bit fused sequences into decimal numbers to obtain the corresponding decimal numbers; S106: Calculate the initial value of the four-dimensional hyperchaotic system using the decimal number and the external random number, using the following formula: in, This indicates the rounding operation. , This is the initial value.

3. The method according to claim 2, characterized in that, S2 specifically includes: substituting the initial value into the four-dimensional hyperchaotic system, iteratively calculating the new initial value until the iteration threshold is reached, and outputting multiple sets of chaotic sequences.

4. The method according to claim 1, characterized in that, S3 specifically includes: S301: Perform a discrete wavelet transform operation on the plaintext image to be encrypted to obtain four wavelet domain coefficient sub-bands. , , , ; S302: Calculate the energy of each coefficient within each wavelet domain coefficient sub-band, and sort the energies of all coefficients in each wavelet domain coefficient sub-band in descending order to obtain the energy sequence, denoted as... ,in, ; S303: Set the corresponding energy retention rate for each wavelet coefficient subband. Based on the energy sequence, calculate the minimum index position that satisfies the requirement that the cumulative energy percentage is not less than the energy retention rate. The calculation formula is as follows: S304: Based on the minimum index position From the energy sequence Take the first one from the middle The energy value, the first The square root of the energy value is used as the adaptive threshold for threshold sparsification of this subband. ; S305: Based on the calculated adaptive thresholds Quantize the corresponding sub-bands: quantize all sub-bands whose absolute values ​​are less than their corresponding adaptive thresholds. The coefficients are set to zero, and after performing the above thresholding process on the four wavelet domain coefficient sub-bands respectively, they are recombined to obtain the sparse coefficient matrix. ; S306: For the sparse coefficient matrix Perform a two-dimensional Arnold transformation to obtain a sparse scrambled matrix. .

5. The method according to claim 4, characterized in that, S4 specifically includes: S401: From the sequence of the multiple sets of chaotic sequences and The length of the cut-off is The subsequence, based on a preset sampling interval and dimensions L The two subsequences obtained are rearranged as follows: matrix sum matrix For the matrix sum matrix Perform orthogonalization on each side to obtain orthogonal matrices. and ; S402: Based on the preset row sampling rate With column sampling rate Preliminary calculations were made of the measured lengths in the row and column directions, and the two measured lengths were adjusted accordingly. L The final row measurement dimension is determined by multiples of the integer value of the row measurement dimension. Dimensions of column measurement The calculation formula is as follows: S403: Construction size is of Hadamard matrix ,in, The multiple sets of chaotic sequences are used to generate an index for row selection: (1). Extract a length of... from the chaotic sequence X. a subsequence of , convert the subsequence Sort the element values ​​in ascending order and record the sorted index sequence. Take the index sequence The former Each index value, from the Hadamard matrix Extract the corresponding rows from the data to form a structure of size . Part Hadamard matrix ; (2). Extract a length of... from the chaotic sequence Y. a subsequence of , convert the subsequence Sort the element values ​​in ascending order and record the sorted index sequence. Take the index sequence The former Each index value, from the Hadamard matrix Extract the corresponding rows from the data to form a structure of size . Part Hadamard matrix ; S404: Based on Kronecker product operation, the obtained part Hadamard matrix , Orthogonal matrix , Combined separately, the final size is Row measurement matrix Column measurement matrix ; S405: Based on row measurement matrix Column measurement matrix For the sparse scrambling matrix Perform two-dimensional projection measurement to obtain a compressed measurement matrix. ; S406: For the measured value matrix Linear quantization is performed to map all its element values ​​to the standard image pixel value range [0, 255], resulting in a quantization matrix. .

6. The method according to claim 5, characterized in that, S5 specifically includes: S501: Calculate the quantization matrix The total number of concentric rings The quantization matrix is ​​arranged in order from the outside to the inside. The algorithm is decomposed layer by layer into U concentric rings. For the k-th ring (k=1,2,…,U), the pixel extraction direction is determined by the parity of the ring number: if k is odd, all pixels on that ring are extracted clockwise; if k is even, pixels are extracted counterclockwise. After extraction from each ring, a one-dimensional pixel sequence is obtained, denoted as... ; S502: From the sequence of the multiple sets of chaotic sequences W Extract a subsequence of length U from the given data. For the k-th pixel sequence Using subsequences The k-th value in Calculate the shift step size of the sequence. Iterate through U sequences, performing a circular right shift operation on each sequence, with the shift amount being the corresponding shift step size, to obtain the shifted sequence. Among them, the shift step size is calculated. The formula is as follows: in, For the k-th sequence Length; S503: Obtain all U shifted sequences , ,..., Connect the rings from the outside to the inside, end to end, to form a ring with a total length of [missing information]. a one-dimensional vector ; S504: Create a size of A blank two-dimensional matrix, followed by a Zigzag scan path to transform a one-dimensional vector. The elements in the matrix are sequentially filled into the blank two-dimensional matrix to obtain the scrambled matrix. .

7. The method according to claim 6, characterized in that, S6 specifically includes: S601: From the sequence of the multiple sets of chaotic sequences Z The length of the cut-off is The subsequence, based on the Construct a two-dimensional matrix from subsequences and The calculation formula is as follows: in, Represents the modulo function. Represents the matrix reshaping function; S602: Define the diffusion coefficient used in dynamic two-way diffusion. Generation rules for the key matrix: exist position of element Extract the key matrix The lowest three bits of binary are directly constructed And set a non-zero verification mechanism: if the extracted If all values ​​are zero, then automatically... Setting it to [1,1,1] specifically means: in, Indicates from integers Extract the first to third least significant bits sequentially from the binary representation; S603: Using a two-dimensional matrix For the scrambling matrix Perform a forward dynamic diffusion from the top left corner to the bottom right corner to generate an intermediate ciphertext matrix. ; S604: Using a two-dimensional matrix For the intermediate ciphertext matrix Perform a reverse dynamic diffusion from the bottom right corner to the top left corner to generate the final ciphertext image. .

8. The method according to claim 7, characterized in that, S7 specifically includes: S701: Transfer the encrypted image Each pixel is divided into three groups based on bit segments: the highest 3 bits, the middle 2 bits, and the lowest 3 bits. These three groups are then converted into corresponding integer values ​​to generate the encrypted image. A bit segment component matrix of the same size is denoted as: , , ; S702: Input size is carrier image ,in, and For the carrier image Perform integer wavelet transform to obtain four values ​​of size 1. The sub-band is denoted as: , , , ; S703: Using the high 5 bits of each high-frequency subband coefficient as a stable representation of the texture complexity at that position, the stable high-frequency subband is obtained. The calculation formula is as follows: in, , , , ; S704: Zero-fill the stabilized high-frequency subbands to obtain the filling matrix. Calculate each position ( i , j The sum of the absolute values ​​of the coefficients within a 3×3 neighborhood is used as the local texture energy at that location in that subband, generating three energy matrices respectively. ; S704: Traverse each position Local energy of the three high-frequency subbands , , Sort in descending order to get , , If the energies are equal, then proceed according to... Determine priorities and dynamically embed using a 3-3-2 strategy: Write The lowest 3 bits will Write The lowest 3 bits will Write The lowest two bits; S705: After embedding at all positions, the modified high-frequency subband is obtained. , , The modified high-frequency subband is compared with the original subband. Perform inverse integer wavelet transform together to obtain the encrypted image. .

9. An image encryption system based on compressed sensing and dynamic embedding, characterized in that, The system is based on the method according to any one of claims 1 to 8, comprising: Initialization module: Generates initial values ​​for the four-dimensional hyperchaotic system based on the plaintext image to be encrypted and external random numbers; Iteration module: Iterates the four-dimensional hyperchaotic system using the initial values ​​to obtain multiple sets of chaotic sequences; First scrambling module: Performs discrete wavelet transform and energy-based adaptive sparsification on the plaintext image to be encrypted, and scrambles the positions of the obtained sparse coefficient matrix to obtain a sparse scrambling matrix. Quantization module: Constructs a measurement matrix using the multiple sets of chaotic sequences, and uses the measurement matrix to perform two-dimensional compressed sensing measurement and quantization processing on the sparse scrambled matrix to obtain a quantization matrix; The second scrambling module performs a scrambling operation on the quantization matrix based on the multiple sets of chaotic sequences to obtain a scrambled matrix; Diffusion module: Performs dynamic bidirectional diffusion operation on the scrambling matrix using the multiple sets of chaotic sequences to obtain the ciphertext image; Encryption module: Performs integer wavelet transform and local texture energy analysis on the carrier image to construct a dynamic embedding mechanism, decomposes the ciphertext image and adaptively embeds it into the high-frequency subband of the carrier image to obtain the encrypted image.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.