Image encryption method based on bidirectional diagonal cross transform
By employing an image encryption method based on bidirectional diagonal cross-transformation and codon-level multi-point cross-operation, combined with quaternary DNA encoding and chaotic sequences, the problems of weak security and low efficiency in existing image encryption technologies are solved, achieving a more efficient and secure image encryption effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2026-03-10
AI Technical Summary
Existing image encryption methods are weak in security and have low encryption efficiency, making it difficult to effectively guarantee the security of images during transmission and storage.
An image encryption method based on bidirectional diagonal crossover transformation and codon-level multi-point crossover operation is adopted, which combines quaternary DNA encoding and chaotic sequences. Through various steps such as bidirectional diagonal crossover transformation, chaotic sequence generation, dynamic encoding and scrambling, and diffusion operation, efficient image encryption is achieved.
It improves the security and efficiency of image encryption, and can effectively protect the security of images during transmission and storage.
Smart Images

Figure CN116684065B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, specifically to an image encryption method based on bidirectional diagonal cross transform. Background Technology
[0002] The rapid development of multimedia technology has led to the widespread application of digital images in fields such as medicine, transportation, and remote sensing. However, images are vulnerable to threats such as illegal modification, copying, and theft during transmission and storage. Therefore, ensuring the secure transmission and storage of images has become a research hotspot in academia and industry. Among the many methods for ensuring image security, image encryption is an effective approach. It ensures the security of the plaintext image by encrypting it before transmitting or storing the encrypted image.
[0003] To ensure image security and improve encryption efficiency, an image encryption method based on bidirectional diagonal cross-transformation and codon-level multi-point cross-operation is proposed. Bidirectional diagonal cross-transformation significantly reduces the correlation between adjacent pixels, thereby improving the security of the encryption method. The quaternary form of DNA encoding and codon-level multi-point cross-operation have high encoding and computational efficiency, thus improving encryption efficiency. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing methods by providing an image encryption method based on bidirectional diagonal cross transform, which offers enhanced security, improved encryption performance, and higher encryption efficiency.
[0005] The technical solution of this invention: To achieve the above objectives, four different bidirectional diagonal cross transformations are first designed, and then an encryption method based on the bidirectional diagonal cross transformation is designed, including the following steps:
[0006] Step 1: Key Generation: Let the plaintext image be... I 1, its size is m × n Calculate using the SHA-256 algorithm I The hash value corresponding to 1 is 256 bits long. The hash value is divided into groups of 8 bits, and the 256-bit hash value is converted into 32 decimal hash values. Based on the external key and the 32 decimal hash values, the three sets of initial conditions of the two-dimensional hyperchaotic system shown in formula (1) are calculated. μ 1, x 10 , y 10 ), ( μ 2, x 20 , y 20 )and( μ 3, x 30 , y 30 );
[0007] (1)
[0008] in, μ These are control parameters. x n and y n It is a state variable;
[0009] Step 2: Generation of chaotic sequences: based on ( μ 1, x 10 , y 10 ), ( μ 2, x 20 , y 20 ), ( μ 3, x 30 , y 30 The two-dimensional hyperchaotic system shown in equation (1) yields six chaotic sequences, denoted as follows: X 1, Y 1, X 2, Y 2, X 3 and Y 3;
[0010] Step 3: Bit-level scrambling: for I 1. By performing bit-plane decomposition, 8 bit-planes can be obtained. P 1, P 2, ..., P 8; P 5, P 6, P 7, P 8. Four different bidirectional diagonal cross transformations were used to scramble the bit planes, resulting in scrambled bit planes, denoted as follows: P' 5, P' 6, P' 7, P' 8; P 1, P 2, P 3, P 4, P' 5, P' 6, P' 7, P' 8. Merge the images to obtain a scrambled image.I 2;
[0011] Step 4: Dynamic Quaternary DNA Encoding: ... I Each pixel value in decimal form in step 2 is converted to its corresponding quaternary form, and the result is then converted into a vector, resulting in a quaternary vector. S 1; According to formula (2), the chaotic sequence X 1. Convert into an encoding rule vector R enc ;
[0012] R enc =mod(floor(1000×| X 1|),8)+1 (2)
[0013] Where mod(·) is the modulo operation, floor(·) is the floor function, and |·| is the absolute value operation; according to R enc Dynamically select one of eight quaternary DNA encoding methods to... S Encoding 1 yields the encoded quaternary DNA sequence. S 2;
[0014] Step 5: Transcription and RNA-level scrambling: According to the transcription rules in the central dogma of heredity, that is, using DNA as a template and ATP, UTP, GTP, and CTP as raw materials, RNA is synthesized under the action of RNA polymerase according to the base complementarity principle. S 2. Transcribed into a quaternary RNA sequence S 3; for Y 1. Sort in ascending order to obtain the index sequence. Y 1_index Using formula (3) to S 3. Scramble the RNA to obtain the scrambled RNA sequence. S 4;
[0015] S 4( i )= S 3( Y 1_index ( i )), i =1, 2, ..., 4 mn (3)
[0016] Step 6: Dynamic Quaternary RNA Calculation: Use formulas (4) and (5) to... X 2 and Y 2. Convert them into operation rule vectors respectively. R oper and chaotic RNA sequencesC RNA Use formula (6) to S 4. Diffusion is performed to obtain the diffused RNA sequence. S 5;
[0017] R oper =mod(floor(1000×| X 2|), 4)+1 (4)
[0018] C RNA =mod(floor(1000×| Y 2|), 4) (5)
[0019] (6)
[0020] Among them, f add (·), f sub (·), f xor (·) and f xnor (·) represent RNA addition, subtraction, XOR, and XNOR operations, respectively;
[0021] Step 7: Translation and multi-point cross-operation at the cryptographic sublevel: S 5 is translated into a codon sequence S 6. Every three bases form one codon; S 6 is divided into two sub-code sequences of equal length. S 6_1 and S 6_2 Using cryptographic sublevel multipoint crossover and binary sequences X 3_bin right S 6_1 and S 6_2 Recombining the two sub-codon sequences yields two recombined sub-codon sequences. S 6_3 and S 6_4 binary sequence X 3_bin Depend on X 3 and formula (7) are generated; combined S 6_3 and S 6_4 A new codon sequence can be obtained. S 7;
[0022] X 3_bin =mod(floor(1000×|X 3|), 2) (7)
[0023] Step 8: Reverse translation and reverse transcription: S 7 was reverse translated into an RNA sequence. S 8; S 8 was reverse transcribed into a DNA sequence S 9; Here, reverse transcription refers to the process of synthesizing DNA using RNA as a template through reverse transcriptase; reverse translation refers to the process of converting a codon sequence into an RNA sequence, breaking each codon into 3 bases;
[0024] Step 9: Dynamic Quaternary DNA Decoding: Using formula (8), Y 3. Convert into a decryption rule vector R dec ;according to R dec And 8 DNA decoding rules, S 9 is dynamically decoded into a quaternary sequence S 10 ;Will S 10 Convert to the corresponding decimal sequence S 11 ;Bundle S 11 Convert to size m × n Encrypted images I 3 ;
[0025] R dec =mod(floor(1000×| Y 3|), 8)+1 (8)
[0026] Furthermore, in step 3, four different bidirectional diagonal cross transformations are used, specifically: (1) The first bidirectional diagonal cross transformation: the first scan is from the matrix P Starting with the first element in the top left corner of the matrix (5), scan the top left triangle of the matrix from bottom to top, parallel to the main diagonal; the second scan starts from the matrix... P Starting with the first element in the bottom right corner of the matrix (5), scan the bottom right triangle of the matrix from top to bottom, parallel to the main diagonal. Then, place the elements obtained from the second scan in odd-numbered positions and the elements obtained from the first scan in even-numbered positions, resulting in a vector. Finally, convert the vector into a matrix by storing it column-wise. P' 5 Taking a fourth-order square matrix as an example, the specific scanning process is as follows: Figure 3As shown. (2) The second type of bidirectional diagonal cross transformation: the first scan is from the matrix P Starting with the first element in the top left corner of the matrix (6), scan the top left triangle of the matrix from top to bottom, parallel to the main diagonal; the second scan starts from the matrix... P Starting with the first element in the bottom right corner of the matrix (6), scan the lower right triangle of the matrix from bottom to top, parallel to the main diagonal. Then, place the elements obtained from the second scan in odd-numbered positions and the elements obtained from the first scan in even-numbered positions, resulting in a vector. Finally, convert the vector into a matrix by storing it column-wise. P' 6 Taking a fourth-order square matrix as an example, the specific scanning process is as follows: Figure 4 As shown. (3) The third type of bidirectional diagonal cross transformation: The first scan is from the matrix P Starting with the first element in the bottom left corner of the matrix 7, scan the lower left triangle portion of the matrix from bottom to top, parallel to the main diagonal; the second scan starts from the matrix... P Starting with the first element in the top right corner of the matrix 7, scan the upper right triangle of the matrix from top to bottom, parallel to the main diagonal. Then, place the elements obtained using the second scan into odd-numbered positions and the elements obtained using the first scan into even-numbered positions, resulting in a vector. Finally, convert the vector into a matrix by storing it column-wise. P' 7; Taking a fourth-order square matrix as an example, the specific scanning process is as follows: Figure 5 As shown. (4) The fourth type of bidirectional diagonal cross transformation: The first scan is from the matrix P Starting with the first element in the bottom left corner of the matrix (8), scan the lower left triangle portion of the matrix from top to bottom, parallel to the main diagonal; the second scan starts from the matrix... P Starting with the first element in the top right corner of the matrix (8), scan the upper right triangle of the matrix from bottom to top, parallel to the main diagonal. Then, place the elements obtained from the second scan in odd-numbered positions and the elements obtained from the first scan in even-numbered positions, resulting in a vector. Finally, convert the vector into a matrix by storing it column-wise. P' 8; Taking a fourth-order square matrix as an example, the specific scanning process is as follows: Figure 6 As shown.
[0027] The decryption process is the inverse of the encryption process; in the decryption process, the same chaotic sequence is used to decrypt the image. I 3. Decrypt the image to recover the plaintext image. I 1.
[0028] Beneficial effects: To address the problems of weak security and low encryption efficiency in existing image encryption methods, a bidirectional diagonal cross-transformation-based image encryption method is proposed. The main contributions are as follows: (1) A two-dimensional hyperchaotic system is proposed, which has a larger chaotic range and more complex dynamic behavior; (2) Four different bidirectional diagonal cross-transformations are proposed, which have better scrambling effects compared with ordinary diagonal transformations; (3) A cryptographic multi-point cross-operation is proposed, which can perform scrambling and diffusion simultaneously; (4) Based on the two-dimensional hyperchaotic system, bidirectional diagonal cross-transformation, and cryptographic multi-point cross-operation, an image encryption method is proposed; the method has good encryption effect, strong security and high efficiency, and can ensure the secure transmission and storage of digital images. Attached Figure Description
[0029] Figure 1 Flowchart of image encryption based on bidirectional diagonal cross transform;
[0030] Figure 2 Plain text image;
[0031] Figure 3 Schematic diagram of bidirectional diagonal cross transformation 1;
[0032] Figure 4 Schematic diagram of bidirectional diagonal cross transformation 2;
[0033] Figure 5 : Schematic diagram of bidirectional diagonal cross transformation 3;
[0034] Figure 6 : Schematic diagram of bidirectional diagonal cross transformation 4;
[0035] Figure 7 : Schematic diagram of multi-point crossover operation at the cryptographic sublevel;
[0036] Figure 8 Encrypted image. Detailed Implementation
[0037] Figure 1 This is a flowchart of image encryption based on bidirectional diagonal cross transform.
[0038] The simulation software used is Matlab R2022b. Figure 2 The Peppers grayscale image with a size of 256×256 shown is used as the plaintext image. The detailed implementation method and specific encryption steps are as follows.
[0039] Key generation: The values of the four external keys are set to 5, 10, 13 and 20 respectively. Combined with the decimal hash value obtained from the plaintext image and the SHA-256 algorithm, three pairs of initial conditions can be calculated as follows: (12, 0.1992, 0.6816), (24, 0.0352, 0.2256), (42, 0.6289, 0.1562).
[0040] Chaotic sequence generation and bit-level scrambling: Six chaotic sequences can be generated from three pairs of initial conditions and a two-dimensional hyperchaotic system. X 1, Y 1, X 2, Y 2, X 3, Y 3, all of which have a length of 65536; for plaintext images I 1. By performing bit-plane decomposition, 8 bit-planes can be obtained. P 1, P 2, ..., P 8; P 5. Use Figure 3 The bidirectional diagonal cross transformation 1 shown is scrambled, resulting in a planar shape. P ' 5; P 6 Use Figure 4 The bidirectional diagonal cross transformation 2 shown is scrambled, resulting in a planar shape. P' 6; P 7 Use Figure 5 The bidirectional diagonal cross transformation 3 shown is scrambled, resulting in a planar shape. P' 7; P 8 Use Figure 6 The bidirectional diagonal cross transformation 4 shown is scrambled, resulting in a planar shape. P' 8; Finally, regarding P 1, P 2, P 3, P 4, P' 5, P' 6, P' 7, P' 8. The scrambled image can be obtained. I 1.
[0041] Dynamic quaternary DNA encoding: I The decimal pixel values in step 1 are converted to their corresponding quaternary forms, and the results are then converted into a vector to obtain a quaternary vector. S 1; From chaotic sequences X The encoding rule vector can be calculated using formula (1) and equation (1). R enc ;rightS 1. Dynamic quaternary DNA encoding yields a quaternary DNA sequence of length 262144. S 2。
[0042] Transcription and RNA-level scrambling: According to the transcriptional rules in the central dogma of genetics, S 2. Transcription of an RNA sequence with a length of 65536. S 3; From chaotic sequences Y The index sequence of 1 and formula (2) for S 3. Scrambling yields the scrambled RNA sequence. S 4.
[0043] Dynamic Quaternary RNA Operations: Based on Chaotic Sequences X 2 and formula (3) can be used to calculate an operation rule vector. R oper ;Depend on Y 2 and formula (4) can be used to calculate a chaotic RNA sequence. C RNA ;Depend on R oper , C RNA And formula (5) S 4. Diffusion is performed to obtain the diffused sequence. S 5.
[0044] Translation and codon-level multi-point crossover: Based on the translation rules in the central dogma of genetics, S 5. Translate into the corresponding codon sequence S 6; From chaotic sequences X 3 and formula (6) can be a binary vector X 3_bin ;according to Figure 7 The cryptographic sublevel multi-point cross operation rules and X 3_bin codon sequence S 6 can be reassembled into a codon sequence S 7。
[0045] Reverse translation and reverse transcription: converting codon sequences S 7. Reverse translation into the corresponding RNA sequence S 8; Then, according to the reverse transcription rule in the central dogma of genetics, the... S 8. Reverse transcribe into the corresponding DNA sequence S 9.
[0046] Dynamic Quaternary DNA Decoding: By Y 3 and formula (7) can be used to calculate a decoding rule vector.R dec ; by decoding rules and R dec , S 9 is dynamically decoded into a quaternion vector S 10 ;Then, S 10 Vectors converted to their corresponding decimal form S 11 Finally, the conversion S 11 The encrypted image is obtained by converting the image to a size of 256×256. I 3 ,like Figure 8 As shown.
[0047] Decryption is the inverse of encryption; it involves using the same chaotic sequence to decrypt the image. I 3. Decrypt the image to recover the plaintext image. I 1, such as Figure 2 As shown.
Claims
1. An image encryption method based on bidirectional diagonal cross transformation, characterized in that, The encryption process comprises the following steps: Step 1: Key generation: let the plaintext image be I 1, the size of which is m × n , use the SHA-256 algorithm to calculate I 1 corresponding to a hash value with a length of 256 bits, divide the hash value, each group of 8 bits, convert the 256-bit hash value into 32 decimal number hash values; according to the external key and the 32 decimal number hash values, calculate three sets of initial conditions of the two-dimensional hyperchaotic system shown in formula (1) ( μ 1, x 10 , y 10 ), ( μ 2, x 20 , y 20 ) and ( μ 3, x 30 , y 30 ), (1) wherein μ is a control parameter, x n and y n is a state variable; Step 2: Generation of chaotic sequences: based on ( μ 1, x 10 , y 10 ), ( μ 2, x 20 , y 20 ), ( μ 3, x 30 , y 30 The two-dimensional hyperchaotic system shown in equation (1) yields six chaotic sequences, denoted as follows: X 1, Y 1, X 2, Y 2, X 3 and Y 3; Step 3: Bit-level scrambling: for I 1. By performing bit-plane decomposition, 8 bit-planes can be obtained. P 1, P 2, ..., P 8; P 5, P 6, P 7, P 8. Four different bidirectional diagonal cross transformations were used to scramble the bit planes, resulting in scrambled bit planes, denoted as follows: P' 5, P' 6, P' 7, P' 8; P 1, P 2, P 3, P 4, P' 5, P' 6, P' 7, P' 8. Merge the images to obtain a scrambled image. I 2; Step 4: Dynamic quaternary DNA encoding: Convert each pixel value in decimal form in Step 3 to its corresponding quaternary form and convert the result to a vector to obtain a quaternary vector I S 1; according to formula (2), convert the chaotic sequence X 1 into an encoding rule vector R enc , R enc =mod(floor(1000×| X 1|),8)+1 (2) Wherein, mod(·) is the modulo operation, floor(·) is the floor operation, |·| is the absolute value operation; according to R enc Dynamic selection of one of the eight quaternary DNA encoding methods, and S 1 is encoded, and the encoded quaternary DNA sequence S 2 can be obtained; Step 5: transcription and RNA level permutation: according to the transcription rule in the genetic center law, that is, taking DNA as the template, ATP, UTP, GTP and CTP as raw materials, and synthesizing RNA under the action of RNA polymerase according to the base complementary principle, the process of S 2 transcription into quaternary RNA sequence S 3; ascending order sorting is performed on Y 1 to obtain an index sequence Y 1_index ; and the RNA sequence after permutation is obtained by using formula (3) to permute S 3 S 4; S 4( i )= S 3( Y 1_index ( i )), i =1, 2, ..., 4 mn (3) Step 6: Dynamic quaternary RNA operation: Convert X 2 and Y 2 into operation rule vectors R oper and chaotic RNA sequence C RNA respectively using equations (4) and (5) S 4 is diffused using equation (6), and the diffused RNA sequence S 5 is obtained, R oper =mod(floor(1000×| X 2|), 4)+1 (4) C RNA =mod(floor(1000×| Y 2|), 4) (5) (6) wherein f add (·), f sub (·), f xor (·) and f xnor (·) represent RNA addition operation, subtraction operation, XOR operation and XNOR operation, respectively. Step 7: Translation with codon-level multi-point crossover operation: S 5 is translated into a codon sequence S 6, each three bases form a codon; divide S 6 into two equal-length sub-codon sequences S 6_1 and S 6_2 , using codon-level multi-point crossover operation and binary sequence X 3_bin on S 6_1 and S 6_2 , two recombined sub-codon sequences S 6_3 and S 6_4 are obtained; binary sequence X 3_bin is generated by X 3 and equation (7); merging S 6_3 and S 6_4 a new codon sequence S 7 is obtained; X 3_bin =mod(floor(1000×| X 3|), 2) (7) Step 8: Reverse translation and reverse transcription S 7 is reverse translated into an RNA sequence S 8; S 8 is reverse transcribed into a DNA sequence S 9; Reverse transcription refers to the process of synthesizing DNA from an RNA template by reverse transcriptase; reverse translation refers to the process of breaking down each codon into 3 bases from the codon sequence to the RNA sequence; Step 9: Dynamic quaternary DNA decoding: Using equation (8), convert Y 3 into a decryption rule vector R dec , R dec =mod(floor(1000×| Y 3|), 8)+1 (8) According to R dec and 8 DNA decoding rules, S 9 is dynamically decoded into a quaternary sequence S 10 ; the S 10 is converted into the corresponding decimal sequence S 11 ; the S 11 is converted into an encrypted image with size m × n I 3. 2. The method of claim 1, wherein: In step 3, four different bidirectional diagonal cross transforms are used, which are as follows: (1) the first bidirectional diagonal cross transform: the first scan is from the first element in the upper left corner of matrix 5 to scan the upper left triangular part of matrix 5 in a manner of from bottom to top parallel to the main diagonal; the second scan is from the first element in the lower right corner of matrix 5 to scan the lower right triangular part of matrix 5 in a manner of from top to bottom parallel to the main diagonal; then, the elements obtained by using the second scan are placed in odd positions, and the elements obtained by using the first scan are placed in even positions, to obtain a vector; finally, the vector is converted into a matrix 5 in a manner of storing by column; P (2) the second bidirectional diagonal cross transform: the first scan is from the first element in the upper left corner of matrix 6 to scan the upper left triangular part of matrix 6 in a manner of from top to bottom parallel to the main diagonal; the second scan is from the first element in the lower right corner of matrix 6 to scan the lower right triangular part of matrix 6 in a manner of from bottom to top parallel to the main diagonal; then, the elements obtained by using the second scan are placed in odd positions, and the elements obtained by using the first scan are placed in even positions, to obtain a vector; finally, the vector is converted into a matrix 6 in a manner of storing by column; P (3) the third bidirectional diagonal cross transform: the first scan is from the first element in the lower left corner of matrix 7 to scan the lower left triangular part of matrix 7 in a manner of from top to bottom parallel to the main diagonal; the second scan is from the first element in the upper right corner of matrix 7 to scan the upper right triangular part of matrix 7 in a manner of from bottom to top parallel to the main diagonal; then, the elements obtained by using the second scan are placed in odd positions, and the elements obtained by using the first scan are placed in even positions, to obtain a vector; finally, the vector is converted into a matrix 7 in a manner of storing by column; P' (4) the fourth bidirectional diagonal cross transform: the first scan is from the first element in the lower left corner of matrix 8 to scan the lower left triangular part of matrix 8 in a manner of from top to bottom parallel to the main diagonal; the second scan is from the first element in the upper right corner of matrix 8 to scan the upper right triangular part of matrix 8 in a manner of from bottom to top parallel to the main diagonal; then, the elements obtained by using the second scan are placed in odd positions, and the elements obtained by using the first scan are placed in even positions, to obtain a vector; finally, the vector is converted into a matrix 8 in a manner of storing by column; P P P' P P P' P P P' .