A compression and encryption method based on dual random phase-DNA iterative diffusion coding
By employing a dual-random phase-DNA iterative diffusion coding method, and utilizing a four-dimensional hyperchaotic system improved by combining zigzag block-embedded scrambling and inter-block scrambling, the problem of unidirectional diffusion in existing image encryption methods is solved, achieving complex diffusion and compression characteristics, and improving security and key space.
Patent Information
- Application Number
- CN202510076206.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Existing image encryption methods are unidirectional or fixed in the diffusion step, making it difficult to achieve complex and secure diffusion and vulnerable to attacks.
A dual random phase-DNA iterative diffusion coding method is adopted to divide the plaintext image into multiple sub-blocks. After zigzag scrambling within the block and inter-block scrambling, the sub-blocks are input into DRPE. Combined with an improved four-dimensional hyperchaotic system, random phase masks and DNA codes are generated to achieve complex diffusion directions and compression characteristics.
It achieves complex and hard-to-capture diffusion directions, improving security, and has a larger key space and key sensitivity. It also achieves compression characteristics through the segmentability and superpositionability of images, saving transmission space.
Smart Images

Figure CN119865304B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image encryption. Background Technology
[0002] Claude Shannon, the "father of information theory," proposed that general encryption systems include two basic steps: scrambling and diffusion. Most modern image encryption methods are based on this idea. Diffusion refers to hiding the information of each plaintext pixel within as many ciphertext pixels as possible, making any relationship between the ciphertext and plaintext difficult to detect. The degree of diffusion of information in each pixel of a plaintext image is a crucial factor in evaluating the security of an encryption method.
[0003] To date, image encryption diffusion typically involves segmenting and rearranging the plaintext image in a specific manner, then superimposing its pixel information in a predefined direction. Specifically, this can be categorized into three types: The first type treats the pixel values of the plaintext image as a one-dimensional sequence, performing pairwise operations on each pixel value to achieve diffusion. This method has a single diffusion direction and is vulnerable to attack. The second type treats the plaintext image as a two-dimensional matrix, performing pixel diffusion in different directions such as up / down, left / right, and diagonally. Although this increases the diffusion direction, the direction remains clear and fixed. The third type encodes or transforms the plaintext information, defining diffusion rules in the transform domain to achieve diffusion. While this further increases the dimensionality of diffusion, it still cannot achieve a diffusion that is both random in direction and securely complex. Therefore, it is necessary to design an image encryption method to achieve complex and difficult-to-detect diffusion. Summary of the Invention
[0004] This invention proposes a compression encryption method based on double random phase-DNA iterative diffusion coding to achieve compression properties and complex diffusion. Unlike previous diffusion methods, this invention uses double random phase coding (DRPE) combined with DNA coding as the diffusion structure, employing blocks and pixels within blocks as diffusion units to achieve double random phase-DNA iterative diffusion coding. The complex diffusion direction of this method is determined by the block segmentation method, the random scrambling of blocks, and DRPE. Furthermore, we propose an improved four-dimensional hyperchaotic system, which exhibits superior dynamic complexity and ergodicity compared to the original system, providing key sensitivity and key space for this encryption method.
[0005] The working principle of this invention is as follows: The plaintext image is divided into multiple sub-blocks, which are then sequentially input into DRPE after zigzag scrambling within and between blocks. Each output intermediate ciphertext undergoes DNA encoding and is then used as a subkey for the DRPE second-stage mask. After multiple iterations and superpositions, a ciphertext smaller than the original plaintext image size can be obtained. Throughout the process, a series of random phase masks and a dynamic encoding strategy for DNA encoding in the first stage of DRPE are generated using an improved four-dimensional hyperchaotic system.
[0006] The dual-random phase-DNA iterative diffusion coding compression encryption method of the present invention comprises three stages: key generation, encryption, and decryption.
[0007] (1) Key generation stage: The hash value of the plaintext image is combined with the external key to generate the initial chaotic value. Then, the improved four-dimensional hyperchaotic system is used to iteratively output a series of key streams. The key streams are subsequently used as a series of masks and DNA-encoded dynamic coding strategies in the first stage of DRPE.
[0008] (2) Encryption stage: The plaintext image is divided into multiple sub-blocks, which are then scrambled within and between blocks using zigzag. These sub-blocks are then used as input images for DRPE. The intermediate ciphertext output in each round is DNA encoded and used as a series of masks in the second stage of DRPE. After multiple iterations, a compressed ciphertext image is finally obtained. The encryption process is as follows: Figure 1 As shown;
[0009] (3) Decryption stage: A chaotic sequence is generated based on the chaotic initial value key. The intermediate ciphertext is DNA encoded to obtain a series of masks for the second stage of DRPE. The ciphertext image C is inverse DNA encoded and combined with the intermediate ciphertext to form a series of complex value matrices. After the inverse operation of DRPE, image blocks are obtained. Finally, inverse scrambling between blocks and inverse zigzag scrambling within blocks are performed to obtain a series of image blocks. The image blocks are reassembled to obtain the plaintext image. The decryption process is as follows: Figure 2 As shown.
[0010] The specific implementation process of step (1) is as follows:
[0011] (1a) Generate initial values for chaos For sizes of The plaintext image is processed using the SHA-256 algorithm to obtain a 256-bit binary digest of the plaintext image. Each 8 bits is treated as a group, producing 32 decimal numbers, represented as follows: The formula for calculating the initial value of chaos is as follows:
[0012]
[0013]
[0014] in, An external key representing a random integer in the range [0, 255].
[0015] (1b) Generate chaotic key stream Based on initial values Iterative approach to the improved four-dimensional hyperchaotic system Next, to avoid transient effects, remove the previous step. The result of this iteration is four sets of key streams. , , , The improved formula for a four-dimensional hyperchaotic system is as follows:
[0016]
[0017]
[0018] in , , , , , , , System parameters and their value ranges, For delay time and The results obtained in each round The chaotic sequence is obtained by outputting the sequence sequentially. .
[0019] The specific implementation process of step (2) is as follows:
[0020] (2a) Scrambling phase: The size is... plaintext images Divided into sizes Image blocks random numbers , ;right Obtained by scrambling within the block using zigzag. ;right Sort the results in an ascending order to obtain the corresponding index sequence, and then use the index sequence to... The images are reordered to obtain scrambled image blocks. ;
[0021] (2b) Keystream Reassembly Stage: Reassembling the keystream Arranged into The image was then divided into segments of size [size missing]. The blocks yield four block sequences. , , , ; and XOR operation on corresponding pixels to obtain , As the starting phase mask for the second stage of DRPE; using As the first stage random phase mask of DRPE Use them separately , , As a key image for DNA XOR, DNA encoding, and DNA decoding;
[0022] (2c) Double random phase-DNA iterative diffusion coding stage: for scrambled image patch sequences Execute sequentially Wheel DRPE; such as Figure 4 As shown, in the first In the wheel, parallel light enters from the left. With the first random phase plate in the input plane Multiplication; after Fourier transform into the Fourier transform domain, it is multiplied with the second random phase mask on the spectral plane. Multiplication; it is worth noting that, Depend on The real part is obtained through DNA encoding; further, a complex-valued matrix with white noise characteristics is obtained through inverse Fourier transform. Thus, after Round-double random phase-DNA iterative diffusion coding is obtained Finally, regarding The real number portion is encoded into DNA to obtain a compressed ciphertext image. The iterative expression for the double-random phase-DNA iterative diffusion coding is described by the following equation:
[0023]
[0024] in Indicates Fourier transform, This represents the inverse Fourier transform.
[0025] The specific implementation process of step (3) is as follows:
[0026] (3a) Keystream generation process: Based on the key Obtaining the key stream by iterating through a four-dimensional chaotic system The key stream is reassembled into four block sequences. , , , ;right and The initial random phase mask for the first stage of DRPE is obtained by performing an XOR operation on the corresponding pixels. ; for the key The real part is used to encode DNA to obtain the random phase mask of the second stage of DRPE. ;and , , These serve as key images for DNA XOR, DNA encoding, and DNA decoding, respectively.
[0027] (3b) DRPE inverse process: for encrypted images The real part is obtained by performing the DNA coding inverse operation. ,use As the first stage random phase mask of DRPE Combined with the second-stage random phase mask , respectively Perform the inverse DRPE operation to obtain scrambled image patches. ;
[0028] (3c) Reverse scrambling process: According to Obtain the inverted index sequence for the graphic block sequence. Reverse arrangement to obtain Then on The zigzag reverse scramble is obtained , Reconstructed into plaintext image .
[0029] Compared with traditional diffusion-based image encryption methods, the present invention has the following advantages:
[0030] (1) It can achieve relatively complex and difficult-to-capture diffusion. The diffusion direction of this method is determined by the block partitioning method, the random arrangement of blocks and DRPE, and it combines a chaotic system with nonlinear characteristics, which makes it more secure.
[0031] (2) The improved four-dimensional hyperchaotic system has higher dynamic complexity and ergodicity than the original system, which provides a larger key space, key sensitivity and nonlinear complexity for this method;
[0032] (3) The special compression characteristics can save transmission space, and unlike traditional compression, the compression characteristics of this method are based on the segmentability and superpositionability of images;
[0033] (4) It is scalable. This method can be extended to a multi-image encryption method. It only requires replacing the segmented image with multiple different images. Attached Figure Description
[0034] Figure 1 is a schematic diagram of the encryption stage of the method of the present invention.
[0035] Figure 2 is a schematic diagram of the decryption stage of the method of the present invention.
[0036] Figure 3 shows the schematic diagram of the DRPE-DNA encoding iterative diffusion principle.
[0037] Figures 4(a)-(c) are the plaintext image, encrypted image, and decrypted image in the embodiments of the present invention, respectively.
[0038] The figure labels in the above figures are:
[0039] 1 Lens Detailed Implementation
[0040] The present invention will be further described below with reference to the accompanying drawings, and a specific embodiment of the present invention will be described.
[0041] This example uses Matlab R2023b for simulation. The computer environment is configured as Windows 11, 32.00GB RAM, and an Intel(R) Core(TM) i9-13900HX 2.20 GHz processor. The "Photographer" setting (256) is selected. A 256 grayscale image is used as the sample. The segmented image patch size is... Parameters of chaotic systems , , , , , , , , .
[0042] The entire encryption and decryption process can be implemented in the following steps:
[0043] (1) Key generation stage
[0044] For a size of 256 The plaintext image of 256 bits is processed using the SHA-256 algorithm to obtain a 256-bit binary digest. This step incorporates plaintext features into the encryption process, effectively resisting specific plaintext attacks. Then, every 8 bits are grouped together to obtain 32 decimal numbers, represented as... Calculate according to formulas (1) and (2) The improved four-dimensional hyperchaotic system is iterated according to formulas (3) and (4). Next, to avoid transient effects, remove the previous step. The result of this iteration is four sets of key streams. , , , .
[0045] (2) Encryption stage
[0046] like Figure 1 As shown, the size is plaintext images Divided into sizes Image blocks , ,right Obtained by scrambling within the block using zigzag. ;right Sort the results in an ascending order to obtain the corresponding index sequence, and then process the results according to the index order. The images are reordered to obtain scrambled image blocks. ; key stream Arranged into The image was then divided into segments of size [size missing]. The blocks yield four block sequences. , , , ; and XOR operation on corresponding pixels to obtain , As the starting phase mask for the second stage of DRPE; using As the first stage random phase mask of DRPE Use them separately , , Images serving as keys for DNA XOR, DNA encoding, and DNA decoding; scrambled image block sequences. Perform 16 rounds of DRPE sequentially; for example Figure 3 As shown, in the first In the wheel, Parallel light enters from the left. With the first random phase plate in the input plane Multiplication; after Fourier transform into the Fourier transform domain, it is multiplied with the second random phase mask on the spectral plane. Multiplication; it is worth noting that, Depend on The real part is obtained through DNA encoding; further, a complex-valued matrix with white noise characteristics is obtained through inverse Fourier transform. Thus, after 16 rounds of double-random phase-DNA iterative diffusion coding, the following is obtained: Finally, regarding The real part of the data is encoded into DNA to obtain the superimposed ciphertext image. Iterative diffusion ensures that any pixel information in the plaintext image affects any pixel in the ciphertext image, and due to the characteristics of DRPE, the diffusion direction is random and complex, which increases the encryption method's resistance to plaintext attacks.
[0047] (3) Decryption stage
[0048] like Figure 2 As shown, based on the key Obtaining the key stream by iterating through a four-dimensional hyperchaotic system The key stream is reassembled into four block sequences. , , , ;right and The initial random phase mask for the first stage of DRPE is obtained by performing an XOR operation on the corresponding pixels. ; for the key The real part is used to encode DNA to obtain the random phase mask of the second stage of DRPE. ;and , , Key images used as DNA XOR, DNA encoding, and DNA decoding, respectively; ciphertext images The real part is obtained by performing the DNA coding inverse operation. ,use As the first stage random phase mask of DRPE Combined with the second-stage random phase mask , respectively Perform the inverse DRPE operation to obtain scrambled image patches. ; Traversal Obtain the inverted index sequence for the graphic block sequence. Reverse arrangement to obtain ,right The zigzag reverse scramble is obtained , Reconstructed into plaintext image .
[0049] like Figure 4 Images (a)-(c) show the plaintext, ciphertext, and decrypted images of the sample image, respectively. It can be seen that when the block size is selected... In this case, the ciphertext image size is 1 / 16th of the plaintext image, demonstrating the compression characteristics of the method of this invention. Unlike traditional compression, the compression of this invention is based on the divisibility and superpositionability of images, and the smaller the block size, the higher the compression ratio, while the quality of the decrypted image is not affected. However, under the DRPE-DNA iterative diffusion model, the smaller the block size, the smaller the projected area of the parallel light. In extreme cases, this may require a very small or even entirely new DRPE-DNA iterative diffusion architecture.
Claims
1. A compression and encryption method using dual random phase-DNA iterative diffusion coding; characterized in that, The compression and encryption method includes the following steps: (1) Key generation stage: The hash value of the plaintext image is combined with the external key to generate chaotic initial value. Then, the improved four-dimensional hyperchaotic system is used to iteratively output a series of key streams. The key streams are subsequently used as a series of masks and DNA-encoded dynamic coding strategies in the first stage of DRPE. (2) Encryption phase: (2a) Block Scrambling Stage: The plaintext image is divided into multiple sub-blocks. After zigzag scrambling within blocks and inter-block scrambling, the scrambled image blocks {S1,S2,...,S} are obtained. l }; (2b) Keystream Reassembly Stage: Arrange the keystreams X, Y, Z, W into an image MN, and then divide it into two parts of size 2. n ·2 n The blocks are divided into four block sequences {X1, X2, ..., X...}. l },{Y1,Y2,...,Y l },{Z1,Z2,...,Z l },{W1,W2,...,W l }; XORing the corresponding pixels of X1 and Y1 yields kb1, which serves as the starting phase mask for the second stage of DRPE; using {X1,X2,...,X... l } as the first stage random phase mask of DRPE {ka1,ka2,...,ka l }; respectively using {Y1,Y2,...,Y l }、{Z1,Z2,...,Z l }、{W1,W2,...,W l } as a key image for DNA XOR, DNA encoding, and DNA decoding; (2c) Double random phase-DNA iterative diffusion coding stage: The scrambled image block sequence {S1,S2,...,S...} is processed... l } Perform DRPE cycles l in sequence; in the i-th cycle, parallel light enters from the left, S i With the first random phase plate ka in the input plane i Multiply; after Fourier transform and entering the Fourier transform domain, multiply with the second random phase mask kb on the spectral plane. i Multiplication; it is worth noting that kb i (i = 2, 3, ..., l) are derived from C i-1 The real part is obtained through DNA encoding; further, a complex-valued matrix C with white noise characteristics is obtained through inverse Fourier transform. i Thus, after l rounds of double-random phase-DNA iterative diffusion coding, C is obtained. l Finally, regarding C l The real part is encoded into DNA to obtain a compressed ciphertext image C; the iterative expression of the double random phase-DNA iterative diffusion coding is described by the following equation: C i =FT -1 {FT{S i ka i }kb i } Where FT represents the Fourier transform, FT -1 This represents the inverse Fourier transform.
2. The compression and encryption method of dual random phase-DNA iterative diffusion coding according to claim 1, wherein the specific implementation process of step (1) is as follows: (1a) Generate initial chaotic values x0, y0, z0, w0: Apply the SHA-256 algorithm to a plaintext image of size MN to obtain a 256-bit binary digest of the plaintext image. Each 8 bits is treated as a group, generating 32 decimal numbers, represented as A = a1, a2, ..., a 32 The formula for calculating the initial value of chaos is as follows: in, r1, r2, r3, r4 represent random integer external keys in the range [0, 255]. (1b) Generating chaotic keystreams X, Y, Z, W: Iterate the improved four-dimensional hyperchaotic system n0+MN times based on the initial values x0, y0, z0, w0. To avoid transient effects, remove the results of the first n0 iterations to obtain four sets of keystreams X = {x1, x2, ..., x...} MN }, Y = {y1, y2, ..., y MN Z = {z1, z2, ..., z} MN }, W={w1,w2,...,w MN The improved formula for a four-dimensional hyperchaotic system is as follows: Where a = 8, b = -1, c = -40, d = 1, e = 2, n = 2, k = -14, m ∈ (3.6, 18] are system parameters and their range of values, τ is the delay time and τ > 0, and the values obtained in each round are... The chaotic sequence X, Y, Z, W is output sequentially.
3. The compression and encryption method of dual random phase-DNA iterative diffusion coding according to claim 1, wherein the specific implementation process of step (2a) is as follows: Divide the plaintext image P of size MN into two parts of size 2. n ·2 n Image blocks {P1,P2,...,P} l }, random numbers n=1,2,...,log2(min(M,N)), l=(MN) / (2 n ·2 n ); for {P1,P2,...,P l Using intra-block zigzag scrambling, we get {P1′, P2′, ..., P}. l ′};For x1,x2,...,x l Sort the results in an ascending order to obtain the corresponding index sequence. Then, based on the index sequence, select {P1′, P2′, ..., P...} l The images are reordered to obtain the scrambled image blocks {S1,S2,...,S}. l } 4. The compression and encryption method of dual random phase-DNA iterative diffusion coding according to claim 1, characterized in that, The sub-blocks in this method are replaced with multiple images of the same size, and then encrypted to obtain a ciphertext image of the size of a single image.
5. The compression and encryption method of dual random phase-DNA iterative diffusion coding according to claim 1, characterized in that... The compression and encryption method also includes a decryption phase; the specific implementation process of the decryption phase is as follows: (3a) Keystream generation process: Based on the keys x0, y0, z0, w0, the four-dimensional chaotic system is iterated to obtain the keystream X, Y, Z, W. The keystream is then reassembled into four block sequences {X1, X2, ..., X...}. l },{Y1,Y2,...,Y l },{Z1,Z2,...,Z l },{W1,W2,...,W l }; Perform an XOR operation on the corresponding pixels of X1 and Y1 to obtain the initial random phase mask kb1 for the first stage of DRPE; For the key {C1,C2,...,C l-1 The real part of} is used to encode DNA to obtain the random phase mask {kb2,kb3,...,kb} for the second stage of DRPE. l }; while {Y1,Y2,...,Y l }、{Z1,Z2,...,Z l }、{W1,W2,...,W l These serve as key images for DNA XOR, DNA encoding, and DNA decoding, respectively. (3b) DRPE inverse process: Perform DNA coding inverse operation on the real part of the ciphertext image C to obtain C l Using {X1,X2,...,X l } as the first stage random phase mask of DRPE {ka1,ka2,...,ka l }, combined with the second-stage random phase mask {kb1,kb2,...,kb l }, respectively for {C1,C2,...,C l Perform the inverse DRPE operation to obtain the scrambled image block {S1,S2,...,S}. l }; (3c) Reverse scrambling process: Traverse x1, x2, ..., x l Obtain the inverse index sequence for the graphic block sequence {S1,S2,...,S...} l Reverse the permutation to obtain {P1′, P2′, ..., P} l Then, for {P1′,P2′,...,P}, ... l The zigzag inverse scrambling of '} yields {P1, P2, ..., P}. l },{P1,P2,...,P l Reconstruct it into a plaintext image P.
Citation Information
Patent Citations
Image encryption method based on multidirectional diffusion and DNA coding
CN111008383A
Enterprise information image encryption method based on chaotic system and biological evolution strategy
CN116346302A