Error correction image encryption and decryption method based on DNA convolutional code

Through the error correction image encryption and decryption method based on DNA convolution code, the shortcomings of image encryption technology in the prior art in error correction capabilities and security are solved, and efficient protection of image data in transmission and storage processes is achieved.

CN119743559APending Publication Date: 2025-04-01NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411840339.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The existing image encryption technology has shortcomings in its ability to deal with complex attacks and error correction, and cannot effectively guarantee the security and integrity of image data during transmission and storage.

Method used

The error correction image encryption and decryption method based on DNA convolutional code is adopted, and the security and error correction ability of image data are enhanced by introducing an error correction mechanism, combining DNA encoding and convolutional encoding.

Benefits of technology

It significantly improves the security and integrity of image data in transmission and storage, enhances the robustness and reliability of the system, and can effectively deal with complex errors and attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743559A_ABST
    Figure CN119743559A_ABST
Patent Text Reader

Abstract

The invention discloses an error correction image encryption and decryption method based on a DNA convolutional code, and aims to enhance the security of image data in transmission and storage processes and the error correction capability of an image encryption technology. According to the technical scheme, firstly, an error correction image encryption and decryption system based on the DNA convolutional code is constructed; a key generation module of the sending end generates a key, and a DNA dynamic coding module and a DNA convolutional coding module cooperate to perform image encryption; and a DNA convolution decoding module at a receiving end constructs a grid chart, selects a path with the minimum error through branch metric calculation to update an accumulated error value of a state node, generates a decoding result by backtracking a survival path, and cooperates with other modules to complete image decryption. By adopting the method, single-point errors and large-range errors in the transmission process can be effectively repaired, and the integrity of image data is ensured; the security of the image in the transmission and storage process is guaranteed, effective encryption protection is realized, and the original image can be effectively recovered when the data is damaged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of information encryption, and in particular relates to an error-correcting image encryption and decryption method based on DNA convolutional codes. Background Art

[0002] With the development of technology, image data security is becoming increasingly important, and strong encryption methods are essential to prevent unauthorized access and tampering. Introducing error correction mechanisms in image encryption can enhance the integrity of data in the event of tampering, loss or attack, and improve the robustness of the system. Error correction mechanisms ensure that image data is reliably transmitted in complex communication environments, thereby reducing the risk of information leakage and erroneous transmission. Combining encryption with error correction, the system can meet the high requirements for data security and integrity in unstable environments such as wireless communications and cloud storage. Therefore, error correction mechanisms have important application value in image encryption. Although there are many existing image encryption technologies, there are still deficiencies in confidentiality and fault tolerance. Therefore, it has become an important topic to study more advanced image encryption technologies to improve data security and integrity.

[0003] A convolutional encoder is a finite-state memory system. Convolutional codes are usually described by (n, k, m), where k is the number of input code elements of the convolutional encoder (the number of code elements is referred to as the code number. Code elements refer to the basic units generated during the encoding process, usually data bits or symbols processed by the encoding algorithm), n is the number of output codes after convolutional encoding, and m is the memory length of the encoder, which usually refers to the number of past input bits considered by the encoder when generating the output. The code rate is R = k / n. Convolutional codes are channel codes with memory, which means that the n code elements they output are not only related to the current k input information code elements, but also to the previously input (m-1)×k code elements. The encoding process combines the input sequence with the internal structure of the encoder (such as shift registers and adders) to generate a new sequence. The encoding rules of the convolutional encoder are determined by the generating polynomial, which defines the conversion relationship between input and output bits.

[0004] Convolutional code decoding often uses Viterbi decoding. The mathematical basis of the Viterbi decoding algorithm is the maximum likelihood criterion. Its decoding structure and algorithm are simple, and its execution efficiency is high. It has become the mainstream algorithm for convolutional code decoding. Viterbi decoding uses a network graph to represent the transition between states, and completes the decoding of the transmitted sequence by finding the path with the minimum distance metric.

[0005] In exploring the security and error correction capabilities of image encryption technology, many studies have proposed solutions. The following is a simple evaluation of several existing methods in terms of technology and error correction capabilities. First, Wang et al. (Wang, B; Xie, YJ; Zhou, SH, et al. Correcting Errors in Image Encryption Based on DNA Coding[J]. Molecules. 2018, (No. 8): 1878. Translated as: Image encryption error correction method based on DNA coding) designed a new DNA coding rule that can effectively correct errors when a single base error occurs. Although the fault tolerance is improved by increasing the code length, this method leads to an increase in the amount of data and assumes that at most one error is allowed in each group of eight bases, which limits its effectiveness in practical applications. Secondly, Mohamed et al. (Heba G. Mohamed; Fadwa Alrowais; Dalia H. El Kamchouchi. Correcting Errors in Color Image Encryption Algorithm Based on Fault Tolerance Technique. Electronics. 2021. (No. 10): 2890.) combined fractional-order hyperchaotic Lorentz system and DNA computing to improve the robustness of image encryption. However, the error correction capability of this method is limited, and it can only handle up to three errors in three specific situations, which is difficult to deal with complex or large-scale errors. In addition, the method of Sun et al. (Sun YX, Zhan RJ, Yang Y, et al. A Watermark Algorithm for Image Content Authentication and Correcting Errors in Terms of Pixels. Journal of Interconnection Networks. 2015. (No. 3-4): 1540004. Translated as: A watermark method for image content authentication and pixel error correction) has certain innovations in image scrambling and watermark design, but its error correction capability is poor. It can only recover when there is one erroneous pixel in each image block, and can only ensure an error correction probability of about 80% when the number of errors is less than 0.21 times the total number of blocks.

[0006] In summary, although existing methods have made some progress in image encryption technology, the lack of error correction capability still limits their widespread use in practical applications. Future research should focus on improving the encryption method's ability to handle complex errors, thereby enhancing the overall robustness and reliability of the encryption method. Summary of the invention

[0007] The first technical problem to be solved by the present invention is to improve the security of image encryption technology. The existing technology has shortcomings in dealing with complex attacks, and there is an urgent need to develop a new encryption technology to significantly enhance the security of image data during transmission and storage. The second problem is to enhance the error correction capability of image encryption technology. Images are susceptible to noise, interference and transmission errors during transmission and storage, resulting in a decrease in the quality of decrypted images. The error correction capability of the existing technology is limited and cannot effectively deal with complex errors. Therefore, the present invention aims to provide an error-correcting image encryption and decryption method based on DNA convolutional codes, which reduces the impact of data damage on encryption technology by introducing an error correction mechanism, thereby improving the decryption quality and the overall reliability of the image.

[0008] The technical solution of the present invention is:

[0009] The first step is to build an error-correcting image encryption and decryption system based on DNA convolutional codes:

[0010] The error correction image encryption and decryption system based on DNA convolutional code is composed of a transmitting end and a receiving end. Both the transmitting end and the receiving end are servers. The transmitting end and the receiving end are connected by optical fiber or cable. The transmitting end is equipped with an input module, a key generation module, a first chaotic sequence generation module, a first DNA encoding rule generation module, a DNA dynamic encoding module, a first diffusion matrix generation module, a DNA diffusion module, a first DNA decoding rule generation module, a DNA convolutional encoding module, a first level scrambling module and a first image size adjustment module. The receiving end is equipped with a receiving module, a second chaotic sequence generation module, a second image size adjustment module, a second level scrambling module, a second DNA encoding rule generation module, a DNA convolutional decoding module, a second diffusion matrix generation module, a DNA reverse diffusion module, a second DNA decoding rule generation module, a DNA dynamic decoding module, a third image size adjustment module and an output module.

[0011] The input module of the sending end is connected to the key generation module and the DNA dynamic encoding module. The input module sends the original image P received from the user to the key generation module and the DNA dynamic encoding module.

[0012] The key generation module at the sending end is connected to the input module, the first chaotic sequence generation module, and the receiving module at the receiving end. The key generation module receives the original image P from the input module, calculates the hash value of P and further generates a key, and sends the key to the first chaotic sequence generation module and the receiving module at the receiving end.

[0013] The first chaotic sequence generation module at the transmitting end is connected with the key generation module, the first DNA encoding rule generation module, the first diffusion matrix generation module, the first DNA decoding rule generation module, and the first level scrambling module. The first chaotic sequence generation module receives the key from the key generation module, generates the first chaotic sequence U, the second chaotic sequence V, and the third chaotic sequence W according to the key, sends the first chaotic sequence U to the first DNA encoding rule generation module, sends the second chaotic sequence V to the first diffusion matrix generation module and the first DNA decoding rule generation module, and sends the third chaotic sequence W to the first level scrambling module.

[0014] The first DNA coding rule generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA dynamic coding module. The first DNA coding rule generation module receives the first chaotic sequence U from the first chaotic sequence generation module and generates the first DNA coding rule matrix K according to U. 1 , the first DNA encoding rule matrix K 1 Sent to the DNA dynamic encoding module.

[0015] The first diffusion matrix generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA diffusion module. The first diffusion matrix generation module receives the second chaotic sequence V from the first chaotic sequence generation module and generates the first chaotic DNA matrix V according to V. 2 , the first chaotic DNA matrix V 2 Sent to the DNA diffusion module.

[0016] The first DNA decoding rule generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA convolutional coding module. The first DNA decoding rule generation module receives the second chaotic sequence V from the first chaotic sequence generation module and generates the third DNA decoding rule matrix K according to V. 3 , the third DNA decoding rule matrix K 3 Sent to the DNA convolutional encoding module.

[0017] The DNA dynamic encoding module at the sending end is connected to the input module, the first DNA encoding rule generation module, and the DNA diffusion module. The DNA dynamic encoding module receives the original image P from the input module and the first DNA encoding rule matrix K from the first DNA encoding rule generation module. 1 , using K 1 Perform DNA dynamic encoding on P to obtain the DNA matrix P 1 , the DNA matrix P 1 Sent to the DNA diffusion module.

[0018] The DNA diffusion module at the sending end is connected to the DNA dynamic encoding module, the first diffusion matrix generation module, and the DNA convolution encoding module. The DNA diffusion module receives the DNA matrix P from the DNA dynamic encoding module. 1 , receiving the first chaotic DNA matrix V from the first diffusion matrix generation module 2 , for P 1 and V 2 Perform DNA XOR operation to obtain the DNA diffusion matrix P 2 , the DNA diffusion matrix P 2 Sent to the DNA convolutional encoding module.

[0019] The DNA convolutional coding module at the transmitting end is connected to the first DNA decoding rule generation module, the DNA diffusion module, and the first-order scrambling module. The DNA convolutional coding module is a DNA convolutional encoder that receives the third DNA decoding rule matrix K from the first DNA decoding rule generation module. 3 , receives the DNA diffusion matrix P from the DNA diffusion module 2 , using K 3 P 2 Perform DNA convolution coding to obtain the DNA convolution coding sequence P 5 , the DNA convolution coding sequence P 5 Sent to the first-level scrambling module.

[0020] The first level scrambling module of the transmitting end is connected to the first chaotic sequence generating module, the DNA convolutional coding module, and the first image size adjustment module. The first level scrambling module receives the DNA convolutional coding sequence P from the DNA convolutional coding module. 5 , receiving the third chaotic sequence W from the first chaotic sequence generation module, using W to generate P 5 Perform bit-level scrambling to obtain the first scrambled sequence P 6 , the first scrambled sequence P 6 Sent to the first image resizing module.

[0021] The first image size adjustment module is connected to the first-level scrambling module and the receiving module of the receiving end, and receives the first scrambling sequence P from the first-level scrambling module. 6 , P 6 The size is adjusted so that the adjusted image is easy to observe, and the final encrypted image E is obtained. The image encryption is completed and E is sent to the receiving module at the receiving end.

[0022] The receiving module of the receiving end is connected with the first image resizing module of the sending end, the key generating module of the sending end, the second chaotic sequence generating module of the receiving end and the second image resizing module of the receiving end. The receiving module receives the key from the key generating module of the sending end, receives the encrypted image E from the first image resizing module, sends the key to the second chaotic sequence generating module of the receiving end, and sends the encrypted image E to the second image resizing module of the receiving end.

[0023] The second chaotic sequence generation module at the receiving end is connected to the receiving module at the receiving end, the second DNA decoding rule generation module at the receiving end, the second diffusion matrix generation module at the receiving end, the second DNA encoding rule generation module at the receiving end, and the second bit-level scrambling module at the receiving end. The second chaotic sequence generation module at the receiving end receives the key from the receiving module, generates the first chaotic sequence U according to the key, and sends U to the second DNA decoding rule generation module at the receiving end. The second chaotic sequence generation module at the receiving end generates the second chaotic sequence V according to the key, and sends V to the second diffusion matrix generation module at the receiving end and the second DNA encoding rule generation module at the receiving end. The second chaotic sequence generation module at the receiving end generates the third chaotic sequence W according to the key, and sends W to the second bit-level scrambling module at the receiving end.

[0024] The second DNA decoding rule generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA dynamic decoding module at the receiving end. The DNA decoding rule generation module receives the first chaotic sequence U from the second chaotic sequence generation module and generates a fourth DNA decoding rule matrix K according to U. 4 , the fourth DNA decoding rule matrix K 4 Sent to the DNA dynamic decoding module.

[0025] The second diffusion matrix generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA inverse diffusion module at the receiving end. The diffusion matrix generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module and generates the second chaotic DNA matrix V according to V. 4 , the second chaotic DNA matrix V 4 Sent to the DNA reverse diffusion module.

[0026] The second DNA coding rule generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA convolution decoding module at the receiving end. The DNA coding rule generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module and generates the sixth DNA coding rule matrix K according to V. 6 , the sixth DNA encoding rule matrix K 6 Sent to the DNA convolution decoding module.

[0027] The second image resizing module at the receiving end is connected to the receiving module at the receiving end and the second bit-level scrambling module at the receiving end. The second image resizing module at the receiving end receives the encrypted image E from the receiving module, converts E from a decimal format to a binary format, and obtains an encrypted image E in a binary format. 1 , the encrypted image E in binary format 1 The second bit-level scrambling module sent to the receiving end.

[0028] The second bit-level scrambling module at the receiving end is connected to the second chaotic sequence generating module at the receiving end, the second image resizing module at the receiving end, and the DNA convolution decoding module at the receiving end. The second bit-level scrambling module at the receiving end receives the encrypted image E in binary format from the second image resizing module. 1 , receiving the third chaotic sequence W from the second chaotic sequence generation module, and generating the third chaotic sequence W according to W 1 Perform bit-level scrambling to obtain the second scrambled sequence E 2 , the second scrambled sequence E 2 The DNA convolutional decoding module sent to the receiving end.

[0029] The DNA convolutional decoding module at the receiving end is connected to the second bit-level scrambling module at the receiving end, the second DNA encoding rule generation module at the receiving end, and the DNA reverse diffusion module at the receiving end. The DNA convolutional decoding module at the receiving end is a convolutional decoder that receives the second scrambling sequence E from the second bit-level scrambling module. 2 , receiving the sixth DNA encoding rule matrix K from the second DNA encoding rule generation module 6 , using K 6 For E 2 Perform DNA convolution decoding to obtain the decoding DNA matrix E 5 , the decoding DNA matrix E 5 The DNA is sent to the reverse diffusion module at the receiving end.

[0030] The DNA reverse diffusion module at the receiving end is connected to the DNA convolution decoding module at the receiving end, the second diffusion matrix generation module at the receiving end, and the DNA dynamic decoding module at the receiving end. The DNA reverse diffusion module at the receiving end receives the decoding DNA matrix E from the DNA convolution decoding module. 5 , receiving the second chaotic DNA matrix V from the second diffusion matrix generation module 4 , E 5 and V 4 Perform DNA XOR operation to obtain the DNA inverse diffusion matrix E 6 , the DNA reverse diffusion matrix E 6 The DNA dynamic decoding module sent to the receiving end.

[0031] The DNA dynamic decoding module at the receiving end is connected to the DNA reverse diffusion module at the receiving end, the second DNA decoding rule generation module at the receiving end, and the third image size adjustment module at the receiving end. The DNA dynamic decoding module at the receiving end receives the DNA reverse diffusion matrix E from the DNA reverse diffusion module. 6 , receiving the fourth DNA decoding rule matrix K from the second DNA decoding rule generation module 4 , using K 4 For E 6 Perform DNA dynamic decoding to obtain the decoding sequence E 7 , the decoded sequence E 7 The third image resizing module is sent to the receiving end.

[0032] The third image size adjustment module at the receiving end is connected to the DNA dynamic decoding module at the receiving end and the output module at the receiving end. The third image size adjustment module at the receiving end receives the decoding sequence E from the DNA dynamic decoding module. 7 , adjust E 7 The size of the image is obtained, and the decrypted image D is sent to the output module of the receiving end.

[0033] The output module of the receiving end is connected to the third image size adjustment module of the receiving end. The output module receives the decrypted image D sent from the third image size adjustment module of the receiving end, completes image decryption, and outputs D.

[0034] In the second step, the input module at the sending end receives the original image P input by the user. The size of P is M×N, where M is a positive integer representing the number of rows of image pixels and N is a positive integer representing the number of columns of image pixels. P is sent to the key generation module and the DNA dynamic encoding module.

[0035] In the third step, the key generation module generates a key by:

[0036] 3.1 The key generation module receives the original image P from the input module;

[0037] 3.2 The key generation module uses the SHA-256 secure hash algorithm (National Institute of Standards and Technology. FIPS PUB 180-4: Secure hash standard (SHS). USD Department of Commerce, 2011. Translated as: Secure Hash Standard (SHA)) to calculate the hash value sequence H of P K , H K =[k1,k2,…,k s ,…,k 64 ], 1≤s≤64, k sIt is a hexadecimal number. The key is generated using formula 1. The key is x 1 、r 1 、x 2 、r 2 、x 3 and r 3 is a six-tuple, namely (x 1 , r 1 , x 2 , r 2 , x 3 , r 3 ). Among them, x 1 、x 2 、x 3 ∈(0,1), used as the initial value of chaos, r 1 、r 2 、r 3 ∈(0,4], used as a control parameter of chaos.

[0038]

[0039] in Represents the exclusive-or operation.

[0040] 3.3 Send the key to the first chaotic sequence generation module and the receiving module at the receiving end.

[0041] In the fourth step, the first chaotic sequence generation module generates the first chaotic sequence U, the second chaotic sequence V, and the third chaotic sequence W by:

[0042] 4.1 The first chaotic sequence generation module receives the key from the key generation module.

[0043] 4.2 The first chaotic sequence generation module uses the chaotic sequence generation method to utilize x 1 、r 1 Generate the first chaotic sequence U by:

[0044] 4.2.1 Let the initial value x0 = x 1 , let the control parameter r = r 1 , set the total number of iterations Epoch to 1000+MN. Initialize the first chaotic sequence U to be empty, and U is used to store chaotic values. Set the number of iterations n=1.

[0045] 4.2.2 Calculate the nth chaos value:

[0046] 4.2.2.1 Calculate the value x using Formula 2 n .

[0047] x n =rx n-1 (1-x n-1 ). Formula 2

[0048] 4.2.2.2 If n<1000, go directly to 4.2.2.3; if n>1000, change x n Add it to the first chaotic sequence U and go to 4.2.2.3.

[0049] 4.2.2.3 Let n=n+1.

[0050] 4.2.2.4 If n≤Epoch, go to 4.2.2.1 to continue generating chaotic values. If n>Epoch, it means that enough chaotic values ​​have been generated and the first chaotic sequence U is obtained. U contains MN chaotic values, which are between 0 and 1, and go to 4.3.

[0051] 4.3 Send the first chaotic sequence U to the first DNA coding rule generation module.

[0052] 4.4 The first chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 2 、r 2 Generate a second chaotic sequence V. Send V to the first diffusion matrix generation module and the first DNA decoding rule generation module.

[0053] 4.5 The first chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 3 、r 3 Generate a third chaotic sequence W and send W to the first-level scrambling module.

[0054] Step 5: The first DNA coding rule generation module generates the first DNA coding rule matrix K 1 , the method is:

[0055] 5.1 The first DNA coding rule generation module receives the first chaotic sequence U from the first chaotic sequence generation module.

[0056] 5.2 The first DNA coding rule generation module uses formula 3 to integerize U and generate the first DNA coding rule matrix K 1 , whose elements are integers from 1 to 8,

[0057] K 1 =mod(floor(U×10 8 ),8)+1, Formula 3

[0058] Among them, mod(·) represents the modulus operation, floor(·) represents the floor function, floor(U×10 8 ) means multiplying the MN chaotic values ​​in the matrix U by 10 8 Then round down to get a new integer matrix. mod(floor(U×108 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(U×10 8 ),8)+1 to obtain a first DNA encoding rule matrix K with a value in the integer range [1,8] 1 .

[0059] 5.3 The first DNA encoding rule matrix K 1 Sent to the DNA dynamic encoding module.

[0060] Step 6: The first diffusion matrix generation module generates the first chaotic DNA matrix V 2 , the method is:

[0061] 6.1 The first diffusion matrix generation module receives the second chaotic sequence V from the first chaotic sequence generation module.

[0062] 6.2 The first diffusion matrix generation module uses formula 4 to integerize the second chaotic sequence V to generate the first integer sequence V 1 , whose elements are integers from 0 to 255,

[0063] V 1 =mod(floor(V×10 8 ),256). Formula 4

[0064] Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),256) means that each element in the new integer matrix is ​​subjected to a 256 modulo operation and mapped to the integer range of [0,255].

[0065] 6.3 The first diffusion matrix generation module uses formula five to V 1 Integerize to generate the second DNA encoding rule matrix K 2 , whose elements are integers from 1 to 8,

[0066] K 2 =mod(floor(V 1 ×10 8 ),8)+1. Formula 5

[0067] Among them, floor(V 1 ×10 8 ) represents the matrix V 1 The MN chaos values ​​in are multiplied by 10 8Then round down to get a new integer matrix. mod(floor(V 1 ×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V 1 ×10 8 ),8)+1 to obtain a second DNA encoding rule matrix K with a value in the integer range [1,8] 2 .

[0068] 6.4 The first diffusion matrix generation module uses K 2 Using formula six to V 1 DNA encoding is performed to obtain the first chaotic DNA matrix V of size M×4N 2 ,

[0069] V 2 =DNA_encode(V 1 ,K 2 ), Formula 6

[0070] Among them, DNA_encode(V 1 ,K 2 ) function is the DNA encoding function, which means that V 1 According to the second DNA encoding rule matrix K 2 Perform DNA encoding to obtain the DNA base matrix, V 2 Each element in the nucleotide sequence corresponds to a specific DNA base, including adenine (A), cytosine (C), guanine (G) and thymine (T). The DNA coding rule is designed based on the complementary pairing of DNA bases. 1 The elements in are encoded by DNA bases in binary, wherein the complementary pairing of DNA bases refers to the complementarity between A and T, and between G and C; the second DNA encoding rule matrix K 2 The value in determines the 1Which DNA encoding rule is used for the corresponding position elements in; the eight DNA encoding rules are: the first rule is 00→A, 01→C, 10→G, 11→T, the second rule is 00→A, 01→G, 10→C, 11→T, the third rule is 00→C, 01→A, 10→T, 11→G, the fourth rule is 00→G, 01→A, 10→T, 11→C, the fifth rule is 00→C, 01→T, 10→A, 11→G, the sixth rule is 00→G, 01→T, 10→A, 11→C, the seventh rule is 00→T, 01→C, 10→G, 11→A, and the eighth rule is 00→T, 01→G, 10→C, 11→A. For example:

[0071] like DNA_encode(V 1 ,K 2 ) is:

[0072] (1) V 1 The "1" in the binary code corresponds to "00000001", and K 2 DNA encoding of rule 5 at the corresponding position yields "CCCT".

[0073] (2) V 1 The "2" in the binary code corresponds to "00000010", using K 2 The DNA encoding of rule 6 at the corresponding position gives "GGGA".

[0074] (3) V 1 The "3" in the binary code corresponds to "00000011", and K 2 DNA encoding of rule 7 at the corresponding position yields "TTTA".

[0075] (4) V 1 The "4" in the code corresponds to the binary number "00000100", using K 2 DNA encoding of rule 8 at the corresponding position yields "TTGT".

[0076] The final DNA coding result

[0077] 6.5 The first chaotic DNA matrix V 2 Sent to the DNA diffusion module.

[0078] Step 7: The first DNA decoding rule generation module generates the third DNA decoding rule matrix K 3 , the method is:

[0079] 7.1 The first DNA decoding rule generation module receives the second chaotic sequence V from the first chaotic sequence generation module.

[0080] 7.2 The first DNA decoding rule generation module uses formula 7 to integerize V and generate the third DNA decoding rule matrix K 3 , whose elements are integers from 1 to 8,

[0081] K 3 =mod(floor(V×10 8 ),8)+1, Formula 7

[0082] Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V×10 8 ),8)+1 to obtain a third DNA decoding rule matrix K with a value in the integer range [1,8] 3 .

[0083] 7.3 The first DNA decoding rule generation module converts the third DNA decoding rule matrix K 3 Sent to the DNA convolutional encoding module.

[0084] In the eighth step, the DNA dynamic encoding module performs DNA dynamic encoding, and the method is:

[0085] 8.1 The DNA dynamic encoding module receives the original image P from the input module and receives the first DNA encoding rule matrix K from the first DNA encoding rule generation module 1 .

[0086] 8.2 DNA Dynamic Encoding Module Using K 1 Perform DNA encoding on P according to formula 8 to obtain a DNA matrix P of size M×4N 1 .

[0087] P 1 =DNA_encode(P,K 1 ), Formula 8

[0088] Among them, DNA_encode(P,K 1 ) means that P is converted into K 1 DNA coding.

[0089] 8.3 DNA matrix P 1Sent to the DNA diffusion module.

[0090] In the ninth step, the DNA diffusion module performs DNA diffusion as follows:

[0091] 9.1 DNA Diffusion Module Receives DNA Matrix P from DNA Dynamic Encoding Module 1 , receiving the first chaotic DNA matrix V from the first diffusion matrix generation module 2 .

[0092] 9.2 P 1 and V 2 Perform DNA XOR operation, the calculation formula is shown in Formula 9, and the DNA diffusion matrix P with a size of M×4N is obtained 2 ,

[0093] P 2 =DNA_xor(P 1 ,V 2 ), Formula 9

[0094] Among them, DNA_xor(P 1 ,V 2 ) function is the DNA XOR function, which means that P 1 ,V 2 Perform DNA XOR operation. DNA XOR operation is designed based on DNA coding rules. Under the same coding rules, each base corresponds to a unique binary representation, which determines that the result of the XOR operation is fixed and unique. Therefore, there is only one DNA XOR operation rule, specifically: DNA_xor(A,A)=A, DNA_xor(A,T)=T, DNA_xor(A,C)=C, DNA_xor(A,G)=G, DNA_xor(T,A)=T, DNA_xor(T,T)=A, DNA_xor(T,C)=G, DNA_ xor(T,G)=C, DNA_xor(C,A)=C, DNA_xor(C,T)=G, DNA_xor(C,C)=A, DNA_xor(C,G)=T, DNA_xor(G,A)=G, DNA_xor(G,T)=C, DNA_xor(G,C)=T, DNA_xor(G,G)=A. For example:

[0095] like The first rule is 00→A, 01→C, 10→G, 11→T, DNA_xor(P 1 ,K 2 ) is:

[0096] (1)P 1 The "A" in the binary code corresponds to "00", V 2The "T" in the code corresponds to "11" in binary. The XOR result of "00" and "11" is "11", and the corresponding base is "T", that is, DNA_xor(A,T)=T.

[0097] (2)P 1 The "T" in the binary code corresponds to "11", V 2 The "C" in the sequence corresponds to "01" in binary. The XOR result of "11" and "01" is "10", and the corresponding base is "G", that is, DNA_xor(T,C)=G.

[0098] (3)P 1 The "G" in the binary code corresponds to "10", V 2 The "A" in the sequence corresponds to "00" in binary, and the XOR result of "10" and "00" is "10", and the corresponding base is "G", that is, DNA_xor(G,A)=G.

[0099] (4)P 1 The "C" in the code corresponds to "01" in binary. 2 The "G" in the code corresponds to "10" in binary. The XOR result of "01" and "10" is "11", and the corresponding base is "T", that is, DNA_xor(C,G)=T.

[0100] Final DNA XOR raw result If the second rule is 00→A, 01→G, 10→C, 11→T, DNA_xor(P 1 ,K 2 ) is:

[0101] (1)P 1 The "A" in the binary code corresponds to "00", V 2 The "T" in the code corresponds to "11" in binary. The XOR result of "00" and "11" is "11", and the corresponding base is "T", that is, DNA_xor(A,T)=T.

[0102] (2)P 1 The "T" in the binary code corresponds to "11", V 2 The "C" in the sequence corresponds to "10" in binary. The XOR result of "11" and "10" is "01", and the corresponding base is "G", that is, DNA_xor(T,C)=G.

[0103] (3)P 1 The "G" in the binary code corresponds to "01", V 2The "A" in the sequence corresponds to "00" in binary, and the XOR result of "01" and "00" is "01", and the corresponding base is "G", that is, DNA_xor(G,A)=G.

[0104] (4)P 1 The "C" in the binary code corresponds to "10", V 2 The "G" in the code corresponds to "01" in binary, and the result of XORing "10" and "01" is "11", and the corresponding base is "T", that is, DNA_xor(C,G)=T.

[0105] Final DNA XOR raw result

[0106] Therefore, the above example proves that under the same encoding rules, each base corresponds to a unique binary representation, the result of the XOR operation is fixed and unique, and there is only one DNA XOR operation rule.

[0107] 9.3 DNA diffusion matrix P 2 Sent to the DNA convolutional encoding module.

[0108] In the tenth step, the DNA convolutional coding module performs DNA convolutional coding, the method is:

[0109] 10.1 DNA Convolutional Coding Module Initialize all states of the DNA convolutional encoder to “0”.

[0110] 10.2 The DNA convolutional encoding module receives the DNA diffusion matrix P from the DNA diffusion module 2 , receiving the third DNA decoding rule matrix K from the first DNA decoding rule generation module 3 .

[0111] 10.3 Using Formula 10, P 2 Convert to DNA diffusion sequence P 3 , using formula 11 to convert K 3 Convert to the fourth DNA decoding rule sequence K 4 ,

[0112] P 3 = reshape(P 2 ,[1,4MN]), formula ten

[0113] K 4 = reshape(K 3 ,[1,MN]), Formula 11

[0114] Among them, reshape(P 2 ,[1,4MN]) function is the size conversion function, which means that P 2Converted to a DNA diffusion sequence P with a length of 4MN 3 ,reshape(K 3 ,[1,MN]) means K 3 Converted to the fourth DNA decoding rule sequence K of length MN 4 .

[0115] 10.4 DNA convolutional coding module uses formula 12 to adopt K 4 P 3 The bases in the sequence are decoded dynamically to obtain the DNA decoding sequence P 4 ,

[0116]

[0117] Where i = 1, 2, ..., M × N, Indicates P 4 The binary numbers from the (8i-7)th to the 8ith digits in the Indicates P 3 The DNA bases from position (4i-3) to position 4i in K 4 The DNA decoding rule for the ith position in , Function is the DNA decoding function, which means that P 3 The DNA bases from position (4i-3) to position 4i follow the rule Decoding DNA, The value of Which DNA decoding rule is used for the DNA bases? The DNA decoding rules correspond to the DNA encoding rules. There are eight DNA decoding rules in total. The eight DNA decoding rules are: the first rule is A→00, C→01, G→10, T→11, the second rule is A→00, G→01, C→10, T→11, the third rule is C→00, A→01, T→10, G→11, the fourth rule is G→00, A→01, T→10, C→11, the fifth rule is C→00, T→01, A→10, G→11, the sixth rule is G→00, T→01, A→10, C→11, the seventh rule is T→00, C→01, G→10, A→11, and the eighth rule is T→00, G→01, C→10, A→11. For example:

[0118] If P 3 =[CCCTGGGATTTATTGT], K 4 =

[5678] ,P 4 =DNA_decode(P 3 ,K 4 ) is:

[0119] (1) right Corresponding DNA base [CCCT] uses K 4 DNA decoding of rule 5 at the corresponding position yields

[0120] (2) right The corresponding DNA base [GGGA] uses K 4 DNA decoding of rule 6 at the corresponding position yields

[0121] (3) right The corresponding DNA base [TTTA] uses K 4 DNA decoding of rule 7 at the corresponding position yields

[0122] (4) right The corresponding DNA base [TTGT] uses K 4 DNA decoding of rule 8 at the corresponding position yields

[0123] The final DNA decoding result P 4 =[00000001000000100000001100000100].

[0124] 10.5 DNA Convolutional Coding Module for DNA Decoding Sequence P 4 The binary numbers in are encoded according to the rules of the DNA convolutional encoder to obtain a DNA convolutional coding sequence P with a length of 16MN. 5 , the DNA convolution coding sequence P 5 Sent to the first-level scrambling module.

[0125] Step 11: The first-level scrambling module performs 5 Perform bit-level scrambling by:

[0126] 11.1 The first-level scrambling module receives the third chaotic sequence W from the first chaotic sequence generation module and receives the DNA convolutional coding sequence P from the DNA convolutional coding module. 5 .

[0127] 11.2 The first-level scrambling module sorts the third chaotic sequence W in ascending order to obtain the first index sequence W 1 , W 1 The elements in it are integer values ​​ranging from [1, MN].

[0128] 11.3 The first-level scrambling module uses formula 13 to encode the DNA convolution sequence P 5 Perform bit-level scrambling operation to obtain the first scrambling sequence P with a length of 16MN 6 .

[0129] Formula 13

[0130] Where, j = 1, 2, ..., 16MN, Indicates P 6 The j-th binary number in Indicates P 5 Zhongyou The binary number at the specified position, It is W 1 The index value of the jth position in is a value in the range [1, MN].

[0131] 11.4 The first-level scrambling module converts the first scrambling sequence P 6 Sent to the first image resizing module.

[0132] In step 12, the first image size adjustment module adjusts the image size to complete image encryption, the method is:

[0133] 12.1 The first image resizing module receives the first scrambling sequence P from the first-level scrambling module 6 .

[0134] 12.2 The first image resizing module converts P 6 Convert from binary format to decimal format to get the second decimal scrambled sequence P 7 .

[0135] 12.3 The first image resizing module uses Formula 14 to resize P 7 The image size is converted so that the converted image is easy to observe. If the size obtained during the conversion process is not an integer, a zero-filling operation is performed to obtain the final encrypted image E.

[0136]

[0137] in, Function is the conversion size function, which means to convert P 7 Convert to size The encrypted image E.

[0138] 12.4 The first image resizing module sends the encrypted image E to the receiving module at the receiving end.

[0139] In step 13, the receiving module at the receiving end receives the key from the key generation module and receives the encrypted image E from the first image resizing module. The receiving module at the receiving end sends the key to the second chaotic sequence generation module at the receiving end and sends the encrypted image E to the second image resizing module.

[0140] In step 14, the second chaotic sequence generation module at the receiving end generates a chaotic sequence by:

[0141] 14.1 The second chaotic sequence generation module at the receiving end receives the key (x 1 , r 1 , x 2 , r 2 , x 3 , r 3 ).

[0142] 14.2 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 1 , r 1 A first chaotic sequence U is generated, and U is sent to a second DNA decoding rule generation module at the receiving end.

[0143] 14.3 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 2 、r 2 A second chaotic sequence V is generated, and V is sent to a second diffusion matrix generation module at the receiving end and a second DNA coding rule generation module at the receiving end.

[0144] 14.4 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 3 、r 3 Generate a third chaotic sequence W, and send W to the second bit-level scrambling module at the receiving end.

[0145] Step 15: The second DNA decoding rule generation module at the receiving end generates the fifth DNA decoding rule matrix K 5 , the method is:

[0146] 15.1 The second DNA decoding rule generation module at the receiving end receives the first chaotic sequence U from the second chaotic sequence generation module.

[0147] 15.2 The second DNA decoding rule generation module uses formula 15 to integerize U and generate the fifth DNA decoding rule matrix K 5 , whose elements are integers from 1 to 8,

[0148] K 5 =mod(floor(U×10 8 ),8)+1, Formula 15

[0149] Among them, floor(U×10 8 ) means multiplying the MN chaotic values ​​in the matrix U by 10 8 Then round down to get a new integer matrix. mod(floor(U×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(U×10 8 ),8)+1 to obtain a fifth DNA decoding rule matrix K with a value in the integer range [1,8]. 5 .

[0150] 15.3 The second DNA decoding rule generation module converts the fifth DNA decoding rule matrix K 5 The DNA dynamic decoding module sent to the receiving end.

[0151] Step 16: The second diffusion matrix generation module at the receiving end generates the second chaotic DNA matrix V 4 , the method is:

[0152] 16.1 The second diffusion matrix generation module at the receiving end receives the second chaotic sequence V from the chaotic sequence generation module.

[0153] 16.2 The second diffusion matrix generation module uses formula 16 to integerize V and generate the second integer sequence V 3 , whose elements are integers from 0 to 255,

[0154] V 3 =mod(floor(V×10 8 ),256), Formula 16

[0155] Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),256) means that each element in the new integer matrix is ​​subjected to a 256 modulo operation and mapped to the integer range of [0,255].

[0156] 16.3 The second diffusion matrix generation module uses formula 17 to V 3 Integerize to generate the sixth DNA encoding rule matrix K 6 , whose elements are integers from 1 to 8,

[0157] K 6 =mod(floor(V 3×10 8 ),8)+1, Formula 17

[0158] Among them, floor(V 3 ×10 8 ) represents the matrix V 3 The MN chaos values ​​in are multiplied by 10 8 Then round down to get a new integer matrix. mod(floor(V 3 ×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V 3 ×10 8 ),8)+1 to obtain a sixth DNA coding rule matrix K with a value in the integer range [1,8] 6 .

[0159] 16.4 The second diffusion matrix generation module uses K 6 Using formula 18, V 3 DNA encoding is performed to obtain the second chaotic DNA matrix V with a size of M×4N 4 ,

[0160] V 4 =DNA_encode(V 3 ,K 6 ). Formula 18

[0161] Among them, DNA_encode(V 3 ,K 6 ) refers to the V 3 According to K 6 DNA coding.

[0162] 16.5 The second diffusion matrix generation module converts the second chaotic DNA matrix V 4 The DNA is sent to the reverse diffusion module at the receiving end.

[0163] Step 17: The second DNA encoding rule generation module at the receiving end generates the seventh DNA encoding rule matrix K 7 , the method is:

[0164] 17.1 The second DNA coding rule generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module.

[0165] 17.2 The second DNA coding rule generation module uses formula 19 to integerize V and generate the seventh DNA coding rule matrix K 7 , whose elements are integers from 1 to 8,

[0166] K 7 =mod(floor(V×10 8 ),8)+1, Formula 19

[0167] Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V×10 8 ),8)+1 to obtain the seventh DNA coding rule matrix K with a value in the integer range [1,8] 7 .

[0168] 17.3 The second DNA encoding rule generation module converts the seventh DNA encoding rule matrix K 7 The DNA convolutional decoding module sent to the receiving end.

[0169] In step 18, the second image size adjustment module at the receiving end adjusts the image size by:

[0170] 18.1 The second image resizing module at the receiving end receives the encrypted image E from the receiving module.

[0171] 18.2 The second image resizing module converts the encrypted image E from decimal format to 8-bit binary format and deletes the zeros added by the zero padding operation in step 12.3 to obtain the encrypted image E in binary format. 1 .

[0172] 18.3 The second image resizing module converts the encrypted image E in binary format 1 The second bit-level scrambling module sent to the receiving end.

[0173] Step 19: The second bit-level scrambling module at the receiving end performs a random operation on E 1 Perform bit-level scrambling by:

[0174] 19.1 The second bit-level scrambling module at the receiving end receives the encrypted image E in binary format from the second image resizing module 1 , receiving the third chaotic sequence W from the second chaotic sequence generating module.

[0175] 19.2 The second bit-level scrambling module sorts the third chaotic sequence W in ascending order to obtain the second index sequence W 2 , W 2 The elements in it are integer values ​​ranging from [1, MN].

[0176] 19.3 The second bit-level scrambling module uses formula 20 to E 1 Perform bit-level scrambling operation to obtain the third scrambled sequence E with a length of 16MN 2 .

[0177]

[0178] Where, q=1,2,…,16MN, Indicates E 2 Zhongyou The binary number at the specified position, It is W 2 The index value of the qth bit in , that is, a value in the range [1, MN]. Indicates E 1 The qth binary number in .

[0179] 19.4 The second bit-level scrambling module converts the third scrambling sequence E 2 The DNA convolutional decoding module sent to the receiving end.

[0180] In the twentieth step, the DNA convolution decoding module at the receiving end performs DNA convolution decoding, and the method is:

[0181] 20.1 The DNA convolutional decoding module receives the third scrambled sequence E from the second bit-level scrambling module 2 , receiving the seventh DNA encoding rule matrix K from the second DNA encoding rule generation module 7 .

[0182] 20.2 The DNA convolutional decoding module constructs a grid graph according to the encoding and state transition rules of the DNA convolutional encoder. The grid graph consists of state nodes arranged in chronological order, and each state node represents a possible state of the DNA convolutional encoder after processing the input bit sequence. The state nodes of the grid graph start from the initial state, and the state nodes are gradually updated as each input signal enters the DNA convolutional encoding module. The paths in the grid graph represent state transitions, and each path corresponds to the state change and possible output of the encoder. These paths will be used for subsequent branch metric calculations and path selection to evaluate the errors and possible correct paths during decoding. The method to construct the grid graph is:

[0183] 20.2.1 Determine the DNA convolutional encoder parameters.

[0184] According to the design of the convolutional encoder, the values ​​of the parameters of the DNA convolutional encoder are determined, including the constraint length, code rate, number of registers, and generating polynomial. The constraint length refers to the length of the historical input that the convolutional encoder relies on when processing the input sequence, which determines that the encoder's calculation of the current output not only depends on the current input bit, but also involves the historical information of the previous input bits. The code rate refers to the ratio between the input bit stream and the output bit stream, usually expressed as k / n, where k is the number of input code elements and n is the number of output code elements, which determines the efficiency of the encoder. The number of registers refers to the number of shift registers inside the convolutional encoder, which directly affects the size of the encoder's state space and the encoder's memory capacity. The generating polynomial determines the encoder's output sequence and state transition rules, and defines the conversion relationship between input bits and output bits. These parameters determine the structure and size of the grid graph.

[0185] 20.2.2 According to the initial state of the DNA convolutional encoder, an initial state node is set in the grid diagram; the metric value of the initial state node is set to 0, indicating that there is no error when decoding starts; the metric value refers to the difference between the DNA convolutional encoding path and the third scrambling sequence E received from the second bit-level scrambling module. 2 The degree of matching between data is used to measure the cumulative error from the initial state to the current state; the smaller the metric value, the closer the path is to the actual received data and the smaller the error.

[0186] 20.2.3 According to the state transition rule of the DNA convolutional encoder, add transitions from the current state node to the next state node in the grid graph. Each transition corresponds to a possible sequence of input bits and output bits, indicating the state change of the DNA convolutional encoder when processing input bits. In the grid graph, these transitions are represented as directed edges, connecting different state nodes.

[0187] 20.2.4 Set the final state; determine the final state node of the grid graph, which corresponds to the state of the DNA convolutional encoder after processing all input bits.

[0188] 20.3 DNA convolutional decoding module receives E in turn 2 The binary data in .

[0189] 20.4 DNA Convolutional Decoding Module calculates the branch metric for each binary data received by traversing the state nodes in the grid graph, calculating the branch metric from the previous state node to the current state node, and measuring the error size of the path. The branch metric is calculated by comparing the difference between the received input sequence and the possible input bit sequence inferred by the decoder, usually using the Hamming distance as the metric.

[0190] Since the encrypted image is transmitted through an insecure channel that may be risky, it may be interfered by channel noise or attacked maliciously by attackers. When performing DNA convolution decoding at the receiving end, the received sequence may be subject to noise or interference, resulting in the DNA convolution decoder being unable to determine whether it is completely correct. To correct possible errors, the DNA convolution decoder deduces the possible sequences sent by the DNA convolution encoder based on the known DNA convolution coding rules and the grid diagram, and these sequences are the possible input bit sequences. Therefore, the possible input bit sequence is the sequence that the DNA convolution decoder deduces based on the DNA convolution coding rules and the grid diagram, and that may be sent in each state of the grid diagram.

[0191] 20.5 Select the survivor path. For each state node of the trellis graph, compare the branch metrics corresponding to all possible input bit sequences and select the path with the smallest metric as the survivor path. The survivor path is the path that the DNA convolutional decoder determines is most likely to be the original transmitted sequence.

[0192] 20.6 Based on the selected surviving path, the metric value of the current state node is updated to the cumulative sum of the metric values ​​of all branches on the surviving path, which represents the total error size from the initial state to the current state path.

[0193] 20.7 Backtrack the surviving path and get the decoding result. The method is:

[0194] 20.7.1 Set the traceback depth H, where H is the number of steps the convolutional decoder traces back in the grid graph. The traceback depth is adjusted based on channel conditions and performance requirements.

[0195] 20.7.2 Backtracking the survivor path: Starting from the final state node, backtrack to the initial state node or the specified backtracking depth according to the previously recorded survivor path information; during the backtracking process, the DNA convolution decoder tracks the survivor path of each state node until the backtracking depth is reached or backtracks to the initial state node; at the same time, the DNA convolution decoder constructs the entire survivor path sequence; the survivor path sequence is the DNA decoding sequence P obtained by the DNA convolution decoder performing DNA dynamic decoding on the DNA convolution module at the sending end in step 10.4 4 best estimate of .

[0196] 20.7.3 The DNA convolution decoder takes the surviving path sequence as the decoding result, i.e., the preliminary DNA convolution decoding sequence E 3 , E 3 The length of E is 8MN. It should be noted that the encrypted image is transmitted through a potentially insecure channel and may be subject to channel noise or malicious attacks. In this case, the E generated by the DNA convolutional decoder is 3It is a best estimate based on current reception conditions and is designed to identify and correct errors in transmission, thereby improving data reliability.

[0197] 20.8 E 3 Use formula 21 to convert to the preliminary DNA convolution decoding matrix E 4 ,

[0198] E 4 = reshape(E 3 ,[M,8N]), Formula 21

[0199] Among them, reshape(E 3 ,[M,8N]) function is the size conversion function, which means that E 3 Converted to a preliminary DNA convolution decoding matrix E of size M×8N 4 .

[0200] 20.9 Using K 7 For E 4 Perform dynamic DNA encoding, the calculation formula is Formula 22, and the decoding DNA matrix E with a size of M×4N is obtained 5 ,

[0201] E 5 =DNA_encode(E 4 ,K 7 ), Formula 22

[0202] Among them, DNA_encode(E 4 ,K 7 ) means that E 4 According to K 7 DNA coding.

[0203] 20.10 The DNA convolutional decoding module decodes the DNA matrix E 5 Sent to the DNA reverse diffusion module.

[0204] In the 21st step, the DNA reverse diffusion module at the receiving end performs DNA reverse diffusion, the method is:

[0205] 21.1 The DNA reverse diffusion module at the receiving end receives the decoded DNA matrix E from the DNA convolution decoding module 5 , receiving the second chaotic DNA matrix V from the second diffusion matrix generation module 4 .

[0206] 21.2 DNA Reverse Diffusion Module 5 and V 4 Perform DNA XOR operation, the calculation formula is shown in Formula 23, and the DNA reverse diffusion matrix E with a size of M×4N is obtained 6,

[0207] E 6 =DNA_xor(E 5 ,V 4 ), Formula 23

[0208] Among them, DNA_xor(E 5 ,V 4 ) means to convert E 5 and V 4 Perform DNA XOR operation.

[0209] 21.3 DNA Back-Diffusion Matrix E 6 The DNA dynamic decoding module sent to the receiving end.

[0210] In step 22, the DNA dynamic decoding module at the receiving end performs DNA dynamic decoding, the method is:

[0211] 22.1 The DNA dynamic decoding module at the receiving end receives the DNA reverse diffusion matrix E from the DNA reverse diffusion module 6 , receiving the fifth DNA decoding rule matrix K from the second DNA decoding rule generation module 5 .

[0212] 22.2 DNA dynamic decoding module using K 5 For E 6 Perform DNA dynamic decoding, the decoding formula is Formula 24, and the decoding sequence E with a length of MN is obtained 7 ,

[0213] E 7 =DNA_decode(E 6 ,K 5 ). Formula 24

[0214] Among them, DNA_decode(E 6 ,K 5 ) means that E 6 According to K 5 Decoding DNA.

[0215] 22.3 DNA dynamic decoding module will decode sequence E 7 The third image resizing module is sent to the receiving end.

[0216] In step 23, the third image size adjustment module at the receiving end adjusts the image size by:

[0217] 23.1 The third image resizing module receives the decoding sequence E from the DNA dynamic decoding module 7 .

[0218] 23.2 The third image resizing module uses formula 25 to convert E 7 Convert it to the same size as the original image P to get the final decrypted image D.

[0219] D = reshape(E 7 ,[M,N]), Formula 25, where reshape(E 7 ,[M,N]) is the conversion size function, which means that E 7 Converted to a decrypted image D of size M×N.

[0220] 23.3 The third image resizing module sends the decrypted image D to the output module of the receiving end.

[0221] In step 24, the output module at the receiving end receives the decrypted image D from the third image resizing module, outputs the decrypted image D, and completes image decryption.

[0222] The present invention can achieve the following beneficial effects:

[0223] (1) In the tenth step, the present invention performs DNA convolution encoding with strong error correction capability on the DNA diffusion matrix received from the DNA diffusion module at the receiving end; based on the redundancy characteristics of the convolution code, in the twentieth step of the DNA convolution decoding process, the surviving path selection and the surviving path backtracking are adopted to select the most likely original sequence from multiple possible paths, that is, the path with the smallest cumulative Hamming distance, to effectively repair single-point and large-scale errors in the transmission. This error correction mechanism can effectively repair single-point errors and large-scale errors in the transmission process, especially in a strong interference or noise environment, ensuring the integrity of the image data, and significantly improving the robustness and reliability of the present invention.

[0224] (2) The ninth step of the present invention combines the chaotic sequence to realize DNA diffusion, and the eleventh step combines the chaotic sequence to realize bit-level scrambling. The ninth step DNA diffusion module performs DNA diffusion, making the change of pixel value more complicated. The eleventh step bit-level scrambling rearranges the value and position of pixels in the image at the binary level, further disrupts the correlation between pixels, and enhances the unpredictability of the encrypted image, thereby effectively ensuring the security of the image during transmission and storage.

[0225] (3) The present invention proposes an error-correcting image encryption and decryption method based on DNA convolutional codes. This method combines the error correction capability of DNA convolutional codes with the high randomness of chaotic sequences, achieving both effective encryption protection and effective restoration of the original image when the data is damaged. In particular, in unstable environments such as wireless communications and cloud storage, the security and integrity of image data are guaranteed, and it has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0226] Figure 1It is a logical structure diagram of the error correction image encryption and decryption system based on DNA convolutional code constructed in the first step of the present invention.

[0227] Figure 2 It is the overall flow chart of the present invention.

[0228] Figure 3 It is the original image input in the second step of Example 1.

[0229] Figure 4 It is the (2,1,3) DNA convolution encoder used in the tenth step of Example 1.

[0230] Figure 5 This is the encrypted image obtained in the twelfth step of Example 1.

[0231] Figure 6 This is the decrypted image obtained in the twenty-third step of Example 1. DETAILED DESCRIPTION

[0232] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments. To verify the effect of the present invention, the following experiments are conducted in conjunction with the embodiments.

[0233] Experimental environment: This example is carried out on an image processing platform equipped with high-performance computing resources and capable of processing image data. The error correction image encryption and decryption system based on DNA convolutional code consists of a transmitter and a receiver. Figure 3 The original image P shown in the figure is obtained through the encryption process from the first step to the twelfth step. Figure 5 The encrypted image E shown in the figure is encrypted. The encrypted image E is transmitted to the receiving end through a channel with certain noise interference to simulate the data transmission process in the actual environment. The receiving end decrypts the encrypted image E through the decoding process from step 13 to step 24 to obtain the following: Figure 6 The decrypted image D shown completes image decryption.

[0234] Figure 2 : is an overall flow chart of the present invention, and an embodiment of the present invention includes the following steps:

[0235] The first step is to build an error-correcting image encryption and decryption system based on DNA convolutional codes:

[0236] The error-correcting image encryption and decryption system based on DNA convolutional code is as follows: Figure 1As shown, it is composed of a sending end and a receiving end. Both the sending end and the receiving end are servers. The sending end and the receiving end are connected by an optical fiber or a cable. The sending end is equipped with an input module, a key generation module, a first chaotic sequence generation module, a first DNA encoding rule generation module, a DNA dynamic encoding module, a first diffusion matrix generation module, a DNA diffusion module, a first DNA decoding rule generation module, a DNA convolutional encoding module, a first level scrambling module and a first image size adjustment module. The receiving end is equipped with a receiving module, a second chaotic sequence generation module, a second image size adjustment module, a second level scrambling module, a second DNA encoding rule generation module, a DNA convolutional decoding module, a second diffusion matrix generation module, a DNA reverse diffusion module, a second DNA decoding rule generation module, a DNA dynamic decoding module, a third image size adjustment module and an output module.

[0237] The input module of the sending end is connected to the key generation module and the DNA dynamic encoding module. The input module sends the original image P received from the user to the key generation module and the DNA dynamic encoding module.

[0238] The key generation module at the sending end is connected to the input module, the first chaotic sequence generation module, and the receiving module at the receiving end. The key generation module receives the original image P from the input module, calculates the hash value of P and further generates a key, and sends the key to the first chaotic sequence generation module and the receiving module at the receiving end.

[0239] The first chaotic sequence generation module at the transmitting end is connected with the key generation module, the first DNA encoding rule generation module, the first diffusion matrix generation module, the first DNA decoding rule generation module, and the first level scrambling module. The first chaotic sequence generation module receives the key from the key generation module, generates the first chaotic sequence U, the second chaotic sequence V, and the third chaotic sequence W according to the key, sends the first chaotic sequence U to the first DNA encoding rule generation module, sends the second chaotic sequence V to the first diffusion matrix generation module and the first DNA decoding rule generation module, and sends the third chaotic sequence W to the first level scrambling module.

[0240] The first DNA coding rule generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA dynamic coding module. The first DNA coding rule generation module receives the first chaotic sequence U from the first chaotic sequence generation module and generates the first DNA coding rule matrix K according to U. 1 , the first DNA encoding rule matrix K 1 Sent to the DNA dynamic encoding module.

[0241] The first diffusion matrix generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA diffusion module. The first diffusion matrix generation module receives the second chaotic sequence V from the first chaotic sequence generation module and generates the first chaotic DNA matrix V according to V. 2 , the first chaotic DNA matrix V 2 Sent to the DNA diffusion module.

[0242] The first DNA decoding rule generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA convolutional coding module. The first DNA decoding rule generation module receives the second chaotic sequence V from the first chaotic sequence generation module and generates the third DNA decoding rule matrix K according to V. 3 , the third DNA decoding rule matrix K 3 Sent to the DNA convolutional encoding module.

[0243] The DNA dynamic encoding module at the sending end is connected to the input module, the first DNA encoding rule generation module, and the DNA diffusion module. The DNA dynamic encoding module receives the original image P from the input module and the first DNA encoding rule matrix K from the first DNA encoding rule generation module. 1 , using K 1 Perform DNA dynamic encoding on P to obtain the DNA matrix P 1 , the DNA matrix P 1 Sent to the DNA diffusion module.

[0244] The DNA diffusion module at the sending end is connected to the DNA dynamic encoding module, the first diffusion matrix generation module, and the DNA convolution encoding module. The DNA diffusion module receives the DNA matrix P from the DNA dynamic encoding module. 1 , receiving the first chaotic DNA matrix V from the first diffusion matrix generation module 2 , for P 1 and V 2 Perform DNA XOR operation to obtain the DNA diffusion matrix P 2 , the DNA diffusion matrix P 2 Sent to the DNA convolutional encoding module.

[0245] The DNA convolutional coding module at the transmitting end is connected to the first DNA decoding rule generation module, the DNA diffusion module, and the first-order scrambling module. The DNA convolutional coding module is a DNA convolutional encoder that receives the third DNA decoding rule matrix K from the first DNA decoding rule generation module. 3 , receives the DNA diffusion matrix P from the DNA diffusion module 2 , using K 3 P 2 Perform DNA convolution coding to obtain the DNA convolution coding sequence P 5, the DNA convolution coding sequence P 5 Sent to the first-level scrambling module.

[0246] The first level scrambling module of the transmitting end is connected to the first chaotic sequence generating module, the DNA convolutional coding module, and the first image size adjustment module. The first level scrambling module receives the DNA convolutional coding sequence P from the DNA convolutional coding module. 5 , receiving the third chaotic sequence W from the first chaotic sequence generation module, using W to generate P 5 Perform bit-level scrambling to obtain the first scrambled sequence P 6 , the first scrambled sequence P 6 Sent to the first image resizing module.

[0247] The first image size adjustment module is connected to the first-level scrambling module and the receiving module of the receiving end, and receives the first scrambling sequence P from the first-level scrambling module. 6 , P 6 The size is adjusted so that the adjusted image is easy to observe, and the final encrypted image E is obtained. The image encryption is completed and E is sent to the receiving module at the receiving end.

[0248] The receiving module of the receiving end is connected with the first image resizing module of the sending end, the key generating module of the sending end, the second chaotic sequence generating module of the receiving end and the second image resizing module of the receiving end. The receiving module receives the key from the key generating module of the sending end, receives the encrypted image E from the first image resizing module, sends the key to the second chaotic sequence generating module of the receiving end, and sends the encrypted image E to the second image resizing module of the receiving end.

[0249] The second chaotic sequence generation module at the receiving end is connected to the receiving module at the receiving end, the second DNA decoding rule generation module at the receiving end, the second diffusion matrix generation module at the receiving end, the second DNA encoding rule generation module at the receiving end, and the second bit-level scrambling module at the receiving end. The second chaotic sequence generation module at the receiving end receives the key from the receiving module, generates the first chaotic sequence U according to the key, and sends U to the second DNA decoding rule generation module at the receiving end. The second chaotic sequence generation module at the receiving end generates the second chaotic sequence V according to the key, and sends V to the second diffusion matrix generation module at the receiving end and the second DNA encoding rule generation module at the receiving end. The second chaotic sequence generation module at the receiving end generates the third chaotic sequence W according to the key, and sends W to the second bit-level scrambling module at the receiving end.

[0250] The second DNA decoding rule generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA dynamic decoding module at the receiving end. The DNA decoding rule generation module receives the first chaotic sequence U from the second chaotic sequence generation module and generates a fourth DNA decoding rule matrix K according to U. 4 , the fourth DNA decoding rule matrix K 4 Sent to the DNA dynamic decoding module.

[0251] The second diffusion matrix generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA inverse diffusion module at the receiving end. The diffusion matrix generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module and generates the second chaotic DNA matrix V according to V. 4 , the second chaotic DNA matrix V 4 Sent to the DNA reverse diffusion module.

[0252] The second DNA coding rule generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA convolution decoding module at the receiving end. The DNA coding rule generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module and generates the sixth DNA coding rule matrix K according to V. 6 , the sixth DNA encoding rule matrix K 6 Sent to the DNA convolution decoding module.

[0253] The second image resizing module at the receiving end is connected to the receiving module at the receiving end and the second bit-level scrambling module at the receiving end. The second image resizing module at the receiving end receives the encrypted image E from the receiving module, converts E from a decimal format to a binary format, and obtains an encrypted image E in a binary format. 1 , the encrypted image E in binary format 1 The second bit-level scrambling module sent to the receiving end.

[0254] The second bit-level scrambling module at the receiving end is connected to the second chaotic sequence generating module at the receiving end, the second image resizing module at the receiving end, and the DNA convolution decoding module at the receiving end. The second bit-level scrambling module at the receiving end receives the encrypted image E in binary format from the second image resizing module. 1 , receiving the third chaotic sequence W from the second chaotic sequence generation module, and generating the third chaotic sequence W according to W 1 Perform bit-level scrambling to obtain the second scrambled sequence E 2 , the second scrambled sequence E 2 The DNA convolutional decoding module sent to the receiving end.

[0255] The DNA convolutional decoding module at the receiving end is connected to the second bit-level scrambling module at the receiving end, the second DNA encoding rule generation module at the receiving end, and the DNA reverse diffusion module at the receiving end. The DNA convolutional decoding module at the receiving end is a convolutional decoder that receives the second scrambling sequence E from the second bit-level scrambling module. 2 , receiving the sixth DNA encoding rule matrix K from the second DNA encoding rule generation module 6 , using K 6 For E 2 Perform DNA convolution decoding to obtain the decoding DNA matrix E 5 , the decoding DNA matrix E 5 The DNA is sent to the reverse diffusion module at the receiving end.

[0256] The DNA reverse diffusion module at the receiving end is connected to the DNA convolution decoding module at the receiving end, the second diffusion matrix generation module at the receiving end, and the DNA dynamic decoding module at the receiving end. The DNA reverse diffusion module at the receiving end receives the decoding DNA matrix E from the DNA convolution decoding module. 5 , receiving the second chaotic DNA matrix V from the second diffusion matrix generation module 4 , E 5 and V 4 Perform DNA XOR operation to obtain the DNA inverse diffusion matrix E 6 , the DNA reverse diffusion matrix E 6 The DNA dynamic decoding module sent to the receiving end.

[0257] The DNA dynamic decoding module at the receiving end is connected to the DNA reverse diffusion module at the receiving end, the second DNA decoding rule generation module at the receiving end, and the third image size adjustment module at the receiving end. The DNA dynamic decoding module at the receiving end receives the DNA reverse diffusion matrix E from the DNA reverse diffusion module. 6 , receiving the fourth DNA decoding rule matrix K from the second DNA decoding rule generation module 4 , using K 4 For E 6 Perform DNA dynamic decoding to obtain the decoding sequence E 7 , the decoded sequence E 7 The third image resizing module is sent to the receiving end.

[0258] The third image size adjustment module at the receiving end is connected to the DNA dynamic decoding module at the receiving end and the output module at the receiving end. The third image size adjustment module at the receiving end receives the decoding sequence E from the DNA dynamic decoding module. 7 , adjust E 7 The size of the image is obtained, and the decrypted image D is sent to the output module of the receiving end.

[0259] The output module of the receiving end is connected to the third image size adjustment module of the receiving end. The output module receives the decrypted image D sent from the third image size adjustment module of the receiving end, completes image decryption, and outputs D.

[0260] In the second step, the input module at the sending end receives the original image P input by the user. The size of P is 512×512, that is, the number of rows and columns of image pixels is 512. In the experiment, the original image P is as follows: Figure 3 As shown. Send P to the key generation module and the DNA dynamic encoding module.

[0261] In the third step, the key generation module generates a key by:

[0262] 3.1 The key generation module receives the original image P from the input module;

[0263] 3.2 The key generation module uses the SHA-256 secure hash algorithm (National Institute of Standards and Technology. FIPS PUB 180-4: Secure hash standard (SHS). USD Department of Commerce, 2011. Translated as: Secure Hash Standard (SHA)) to calculate the hash value sequence H of P K , H K =[k1,k2,…,k s ,…,k 64 ], 1≤s≤64, k s It is a hexadecimal number. The key is generated using formula 1. The key is x 1 、r 1 、x 2 、r 2 、x 3 and r 3 is a six-tuple, namely (x 1 , r 1 , x 2 , r 2 , x 3 , r 3 ). Among them, x 1 、x 2 、x 3 ∈(0,1), used as the initial value of chaos, r 1 、r 2 、r 3 ∈(0,4], used as a control parameter of chaos.

[0264]

[0265] in Represents the exclusive-or operation.

[0266] 3.3 Send the key to the first chaotic sequence generation module and the receiving module at the receiving end.

[0267] In the fourth step, the first chaotic sequence generation module generates the first chaotic sequence U, the second chaotic sequence V, and the third chaotic sequence W by:

[0268] 4.1 The first chaotic sequence generation module receives the key (x) from the key generation module 1 , r 1 , x 2 , r 2 , x 3 , r 3 ).

[0269] 4.2 The first chaotic sequence generation module uses the chaotic sequence generation method to utilize x 1 、r 1 Generate the first chaotic sequence U by:

[0270] 4.2.1 Let the initial value x0 = x 1 , let the control parameter r = r 1 , set the total number of iterations Epoch to 263144. Initialize the first chaotic sequence U to be empty, and U is used to store chaotic values. Set the number of iterations n = 1.

[0271] 4.2.2 Calculate the nth chaos value:

[0272] 4.2.2.1 Calculate the value x using Formula 2 n .

[0273] x n =rx n-1 (1-x n-1 ). Formula 2

[0274] 4.2.2.2 If n<1000, go directly to 4.2.2.3; if n>1000, change x n Add it to the first chaotic sequence U and go to 4.2.2.3.

[0275] 4.2.2.3 Let n=n+1.

[0276] 4.2.2.4 If n≤263144, go to 4.2.2.1 to continue generating chaotic values. If n>263144, it means that enough chaotic values ​​have been generated and the first chaotic sequence U is obtained. U contains 262144 chaotic values, which are between 0 and 1, go to 4.3.

[0277] 4.3 Send the first chaotic sequence U to the first DNA coding rule generation module.

[0278] 4.4 The first chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 2 、r 2 Generate a second chaotic sequence V. Send V to the first diffusion matrix generation module and the first DNA decoding rule generation module.

[0279] 4.5 The first chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 3 、r 3 Generate a third chaotic sequence W and send W to the first-level scrambling module.

[0280] Step 5: The first DNA coding rule generation module generates the first DNA coding rule matrix K 1 , the method is:

[0281] 5.1 The first DNA coding rule generation module receives the first chaotic sequence U from the first chaotic sequence generation module.

[0282] 5.2 The first DNA coding rule generation module uses formula 3 to integerize U and generate the first DNA coding rule matrix K 1 , whose elements are integers from 1 to 8,

[0283] K 1 =mod(floor(U×10 8 ),8)+1, Formula 3

[0284] Among them, mod(·) represents the modulus operation, floor(·) represents the floor function, floor(U×10 8 ) means multiplying the 262144 chaotic values ​​in the matrix U by 10 8 Then round down to get a new integer matrix. mod(floor(U×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(U×10 8 ),8)+1 to obtain a first DNA encoding rule matrix K with a value in the integer range [1,8] 1 .

[0285] 5.3 The first DNA encoding rule matrix K 1 Sent to the DNA dynamic encoding module.

[0286] Step 6: The first diffusion matrix generation module generates the first chaotic DNA matrix V 2 , the method is:

[0287] 6.1 The first diffusion matrix generation module receives the second chaotic sequence V from the first chaotic sequence generation module.

[0288] 6.2 The first diffusion matrix generation module uses formula 4 to integerize the second chaotic sequence V to generate the first integer sequence V 1 , whose elements are integers from 0 to 255,

[0289] V 1 =mod(floor(V×10 8 ),256). Formula 4

[0290] Among them, floor(V×10 8 ) means multiplying the 262144 chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),256) means that each element in the new integer matrix is ​​subjected to a 256 modulo operation and mapped to the integer range of [0,255].

[0291] 6.3 The first diffusion matrix generation module uses formula five to V 1 Integerize to generate the second DNA encoding rule matrix K 2 , whose elements are integers from 1 to 8,

[0292] K 2 =mod(floor(V 1 ×10 8 ),8)+1. Formula 5

[0293] Among them, floor(V 1 ×10 8 ) represents the matrix V 1 The 262144 chaos values ​​in are multiplied by 10 8 Then round down to get a new integer matrix. mod(floor(V 1 ×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V 1 ×10 8 ),8)+1 to obtain a second DNA encoding rule matrix K with a value in the integer range [1,8] 2 .

[0294] 6.4 The first diffusion matrix generation module uses K 2 Using formula six to V 1DNA encoding is performed to obtain the first chaotic DNA matrix V with a size of 512×2048 2 ,

[0295] V 2 =DNA_encode(V 1 ,K 2 ), Formula 6

[0296] Among them, DNA_encode(V 1 ,K 2 ) function is the DNA encoding function, which means that V 1 According to the second DNA encoding rule matrix K 2 Perform DNA encoding to obtain the DNA base matrix, V 2 Each element in the nucleotide sequence corresponds to a specific DNA base, including adenine (A), cytosine (C), guanine (G) and thymine (T). The DNA coding rule is designed based on the complementary pairing of DNA bases. 1 The elements in are encoded by DNA bases in binary, wherein the complementary pairing of DNA bases refers to the complementarity between A and T, and between G and C; the second DNA encoding rule matrix K 2 The value in determines the 1 Which DNA encoding rule is used for the corresponding position elements in; the eight DNA encoding rules are: the first rule is 00→A, 01→C, 10→G, 11→T, the second rule is 00→A, 01→G, 10→C, 11→T, the third rule is 00→C, 01→A, 10→T, 11→G, the fourth rule is 00→G, 01→A, 10→T, 11→C, the fifth rule is 00→C, 01→T, 10→A, 11→G, the sixth rule is 00→G, 01→T, 10→A, 11→C, the seventh rule is 00→T, 01→C, 10→G, 11→A, and the eighth rule is 00→T, 01→G, 10→C, 11→A. For example:

[0297] like DNA_encode(V 1 ,K 2 ) is:

[0298] (1) V 1 The "1" in the binary code corresponds to "00000001", and K 2 DNA encoding of rule 5 at the corresponding position yields "CCCT".

[0299] (2) V 1The "2" in the binary code corresponds to "00000010", using K 2 The DNA encoding of rule 6 at the corresponding position gives "GGGA".

[0300] (3) V 1 The "3" in the binary code corresponds to "00000011", and K 2 DNA encoding of rule 7 at the corresponding position yields "TTTA".

[0301] (4) V 1 The "4" in the code corresponds to the binary number "00000100", using K 2 DNA encoding of rule 8 at the corresponding position yields "TTGT".

[0302] The final DNA coding result

[0303] 6.5 The first chaotic DNA matrix V 2 Sent to the DNA diffusion module.

[0304] Step 7: The first DNA decoding rule generation module generates the third DNA decoding rule matrix K 3 , the method is:

[0305] 7.1 The first DNA decoding rule generation module receives the second chaotic sequence V from the first chaotic sequence generation module.

[0306] 7.2 The first DNA decoding rule generation module uses formula 7 to integerize V and generate the third DNA decoding rule matrix K 3 , whose elements are integers from 1 to 8,

[0307] K 3 =mod(floor(V×10 8 ),8)+1, Formula 7

[0308] Among them, floor(V×10 8 ) means multiplying the 262144 chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V×10 8 ),8)+1 to obtain a third DNA decoding rule matrix K with a value in the integer range [1,8] 3 .

[0309] 7.3 The first DNA decoding rule generation module converts the third DNA decoding rule matrix K 3 Sent to the DNA convolutional encoding module.

[0310] In the eighth step, the DNA dynamic encoding module performs DNA dynamic encoding, and the method is:

[0311] 8.1 The DNA dynamic encoding module receives the original image P from the input module and receives the first DNA encoding rule matrix K from the first DNA encoding rule generation module 1 .

[0312] 8.2 DNA Dynamic Encoding Module Using K 1 Perform DNA encoding on P according to formula 8 to obtain a DNA matrix P with a size of 512×2048 1 .

[0313] P 1 =DNA_encode(P,K 1 ), Formula 8

[0314] Among them, DNA_encode(P,K 1 ) means that P is converted into K 1 DNA coding.

[0315] 8.3 DNA matrix P 1 Sent to the DNA diffusion module.

[0316] In the ninth step, the DNA diffusion module performs DNA diffusion as follows:

[0317] 9.1 DNA Diffusion Module Receives DNA Matrix P from DNA Dynamic Encoding Module 1 , receiving the first chaotic DNA matrix V from the first diffusion matrix generation module 2 .

[0318] 9.2 P 1 and V 2 Perform DNA XOR operation, the calculation formula is shown in Formula 9, and the DNA diffusion matrix P with a size of 512×2048 is obtained. 2 ,

[0319] P 2 =DNA_xor(P 1 ,V 2 ), Formula 9

[0320] Among them, DNA_xor(P 1 ,V 2 ) function is the DNA XOR function, which means that P 1 ,V 2Perform DNA XOR operation. DNA XOR operation is designed based on DNA coding rules. Under the same coding rules, each base corresponds to a unique binary representation, which determines that the result of the XOR operation is fixed and unique. Therefore, there is only one DNA XOR operation rule, specifically: DNA_xor(A,A)=A, DNA_xor(A,T)=T, DNA_xor(A,C)=C, DNA_xor(A,G)=G, DNA_xor(T,A)=T, DNA_xor(T,T)=A, DNA_xor(T,C)=G, DNA_ xor(T,G)=C, DNA_xor(C,A)=C, DNA_xor(C,T)=G, DNA_xor(C,C)=A, DNA_xor(C,G)=T, DNA_xor(G,A)=G, DNA_xor(G,T)=C, DNA_xor(G,C)=T, DNA_xor(G,G)=A. For example:

[0321] like The first rule is 00→A, 01→C, 10→G, 11→T, DNA_xor(P 1 ,K 2 ) is:

[0322] (1)P 1 The "A" in the binary code corresponds to "00", V 2 The "T" in the code corresponds to "11" in binary. The XOR result of "00" and "11" is "11", and the corresponding base is "T", that is, DNA_xor(A,T)=T.

[0323] (2)P 1 The "T" in the binary code corresponds to "11", V 2 The "C" in the sequence corresponds to "01" in binary. The XOR result of "11" and "01" is "10", and the corresponding base is "G", that is, DNA_xor(T,C)=G.

[0324] (3)P 1 The "G" in the binary code corresponds to "10", V 2 The "A" in the sequence corresponds to "00" in binary, and the XOR result of "10" and "00" is "10", and the corresponding base is "G", that is, DNA_xor(G,A)=G.

[0325] (4)P 1 The "C" in the code corresponds to "01" in binary. 2 The "G" in the code corresponds to "10" in binary. The XOR result of "01" and "10" is "11", and the corresponding base is "T", that is, DNA_xor(C,G)=T.

[0326] Final DNA XOR raw result If the second rule is 00→A, 01→G, 10→C, 11→T, DNA_xor(P 1 ,K 2 ) is:

[0327] (1)P 1 The "A" in the binary code corresponds to "00", V 2 The "T" in the code corresponds to "11" in binary. The XOR result of "00" and "11" is "11", and the corresponding base is "T", that is, DNA_xor(A,T)=T.

[0328] (2)P 1 The "T" in the binary code corresponds to "11", V 2 The "C" in the sequence corresponds to "10" in binary. The XOR result of "11" and "10" is "01", and the corresponding base is "G", that is, DNA_xor(T,C)=G.

[0329] (3)P 1 The "G" in the binary code corresponds to "01", V 2 The "A" in the sequence corresponds to "00" in binary, and the XOR result of "01" and "00" is "01", and the corresponding base is "G", that is, DNA_xor(G,A)=G.

[0330] (4)P 1 The "C" in the binary code corresponds to "10", V 2 The "G" in the code corresponds to "01" in binary, and the result of XORing "10" and "01" is "11", and the corresponding base is "T", that is, DNA_xor(C,G)=T.

[0331] Final DNA XOR raw result

[0332] Therefore, the above example proves that under the same encoding rules, each base corresponds to a unique binary representation, the result of the XOR operation is fixed and unique, and there is only one DNA XOR operation rule.

[0333] 9.3 DNA diffusion matrix P 2 Sent to the DNA convolutional encoding module.

[0334] In the tenth step, the DNA convolutional coding module performs DNA convolutional coding, the method is:

[0335] 10.1 This embodiment uses a (2,1,3) DNA convolutional encoder such as Figure 4As shown in FIG. 1 , the DNA convolutional encoder consists of two shift registers and two modulo-2 adders. Each input bit generates two outputs, i.e., the code rate R = 2. The connection polynomial of the DNA convolutional encoder is G(t) = [1 + t 2 ,1+t+t 2 ]. Where t is a shift operator, indicating time delay. Specifically, t k It means delaying the input bit by k time units, that is, delaying k input bits. The DNA convolution encoder receives the base sequence of DNA as input. The sequence is first decoded according to a specific decoding rule to produce a decoding result. Subsequently, these decoding results are introduced into the starting state of the state machine. The state machine consists of three states, namely state 1, state 2 and state 3. The connection method of these three states is determined by the connection polynomial of the DNA convolution encoder, and they are connected and operated using a modulo-2 adder. Finally, the state machine generates two output signals and places them in two shift registers. These two signals together constitute the final output of the DNA convolution encoder.

[0336] Initialize all DNA convolution encoder states to “0”.

[0337] 10.2 The DNA convolutional encoding module receives the DNA diffusion matrix P from the DNA diffusion module 2 , receiving the third DNA decoding rule matrix K from the first DNA decoding rule generation module 3 .

[0338] 10.3 Using Formula 10, P 2 Convert to DNA diffusion sequence P 3 , using formula 11 to convert K 3 Convert to the fourth DNA decoding rule sequence K 4 ,

[0339] P 3 = reshape(P 2 ,[1,1048576]), Formula 10

[0340] K 4 = reshape(K 3 ,[1,262144]), Formula 11

[0341] Among them, reshape(P 2 ,[1,1048576]) function is the size conversion function, which means to convert P 2 Converted to a DNA diffusion sequence P with a length of 1048576 3 ,reshape(K 3 ,[1,262144]) refers to K 3Converted to the fourth DNA decoding rule sequence K with a length of 262144 4 .

[0342] 10.4 DNA convolutional coding module uses formula 12 to adopt K 4 P 3 The bases in the sequence are decoded dynamically to obtain the DNA decoding sequence P 4 ,

[0343]

[0344] Where i = 1, 2, ..., 262144, Indicates P 4 The binary numbers from the (8i-7)th to the 8ith digits in the Indicates P 3 The DNA bases from position (4i-3) to position 4i in K 4 The DNA decoding rule for the ith position in , Function is the DNA decoding function, which means that P 3 The DNA bases from position (4i-3) to position 4i follow the rule k i 4 Decoding DNA. The value of Which DNA decoding rule is used for the DNA bases? The DNA decoding rules correspond to the DNA encoding rules. There are eight DNA decoding rules in total. The eight DNA decoding rules are: the first rule is A→00, C→01, G→10, T→11, the second rule is A→00, G→01, C→10, T→11, the third rule is C→00, A→01, T→10, G→11, the fourth rule is G→00, A→01, T→10, C→11, the fifth rule is C→00, T→01, A→10, G→11, the sixth rule is G→00, T→01, A→10, C→11, the seventh rule is T→00, C→01, G→10, A→11, and the eighth rule is T→00, G→01, C→10, A→11. For example:

[0345] If P 3 =[CCCTGGGATTTATTGT], K 4 =

[5678] ,P 4 =DNA_decode(P 3 ,K 4 ) is:

[0346] (1) right Corresponding DNA base [CCCT] uses K4 DNA decoding of rule 5 at the corresponding position yields

[0347] (2) right The corresponding DNA base [GGGA] uses K 4 DNA decoding of rule 6 at the corresponding position yields

[0348] (3) right The corresponding DNA base [TTTA] uses K 4 DNA decoding of rule 7 at the corresponding position yields

[0349] (4) right The corresponding DNA base [TTGT] uses K 4 DNA decoding of rule 8 at the corresponding position yields

[0350] The final DNA decoding result P 4 =[00000001000000100000001100000100].

[0351] 10.5 DNA Convolutional Coding Module for DNA Decoding Sequence P 4 The binary numbers in are encoded according to the rules of the DNA convolutional encoder to obtain a DNA convolutional coding sequence P with a length of 4194304. 5 , the DNA convolution coding sequence P 5 Sent to the first-level scrambling module.

[0352] Step 11: The first-level scrambling module performs 5 Perform bit-level scrambling by:

[0353] 11.1 The first-level scrambling module receives the third chaotic sequence W from the first chaotic sequence generation module and receives the DNA convolutional coding sequence P from the DNA convolutional coding module. 5 .

[0354] 11.2 The first-level scrambling module sorts the third chaotic sequence W in ascending order to obtain the first index sequence W 1 , W 1 The elements in it are integer values ​​ranging from [1,262144].

[0355] 11.3 The first-level scrambling module uses formula 13 to encode the DNA convolution sequence P 5Perform bit-level scrambling operation to obtain the first scrambled sequence P with a length of 4194304 6 .

[0356] Formula 13

[0357] Where j = 1, 2, ..., 4194304, Indicates P 6 The j-th binary number in Indicates P 5 Zhongyou The binary number at the specified position, It is W 1 The index value of the jth position in is a value in the range [1,262144].

[0358] 11.4 The first-level scrambling module converts the first scrambling sequence P 6 Sent to the first image resizing module.

[0359] In step 12, the first image size adjustment module adjusts the image size to complete image encryption, the method is:

[0360] 12.1 The first image resizing module receives the first scrambling sequence P from the first-level scrambling module 6 .

[0361] 12.2 The first image resizing module converts P 6 Convert from binary format to decimal format to get the second decimal scrambled sequence P 7 .

[0362] 12.3 The first image resizing module uses Formula 14 to resize P 7 The image size is converted so that the converted image is easy to observe. If the size obtained during the conversion process is not an integer, a zero-filling operation is performed to obtain the final encrypted image E.

[0363] E = reshape(P 7 ,[725,725]), Formula 14

[0364] Among them, reshape(P 7 ,[725,725]) function is the size conversion function, which means to convert P 7 The encrypted image E is converted to a size of 725×725. The encrypted image E obtained in this embodiment is as follows: Figure 5 shown. Figure 5 Similar to a noisy image, it effectively hides the information of the original image.

[0365] 12.4 The first image resizing module sends the encrypted image E to the receiving module at the receiving end.

[0366] In step 13, the receiving module at the receiving end receives the key from the key generation module and receives the encrypted image E from the first image resizing module. The receiving module at the receiving end sends the key to the second chaotic sequence generation module at the receiving end and sends the encrypted image E to the second image resizing module.

[0367] In step 14, the second chaotic sequence generation module at the receiving end generates a chaotic sequence by:

[0368] 14.1 The second chaotic sequence generation module at the receiving end receives the key (x 1 , r 1 , x 2 , r 2 , x 3 , r 3 ).

[0369] 14.2 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 1 , r 1 A first chaotic sequence U is generated, and U is sent to a second DNA decoding rule generation module at the receiving end.

[0370] 14.3 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 2 、r 2 A second chaotic sequence V is generated, and V is sent to a second diffusion matrix generation module at the receiving end and a second DNA coding rule generation module at the receiving end.

[0371] 14.4 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 3 、r 3 Generate a third chaotic sequence W, and send W to the second bit-level scrambling module at the receiving end.

[0372] Step 15: The second DNA decoding rule generation module at the receiving end generates the fifth DNA decoding rule matrix K 5 , the method is:

[0373] 15.1 The second DNA decoding rule generation module at the receiving end receives the first chaotic sequence U from the second chaotic sequence generation module.

[0374] 15.2 The second DNA decoding rule generation module uses formula 15 to integerize U and generate the fifth DNA decoding rule matrix K 5 , whose elements are integers from 1 to 8,

[0375] K 5 =mod(floor(U×108 ),8)+1, Formula 15

[0376] Among them, floor(U×10 8 ) means multiplying the 262144 chaotic values ​​in the matrix U by 10 8 Then round down to get a new integer matrix. mod(floor(U×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(U×10 8 ),8)+1 to obtain a fifth DNA decoding rule matrix K with a value in the integer range [1,8]. 5 .

[0377] 15.3 The second DNA decoding rule generation module converts the fifth DNA decoding rule matrix K 5 The DNA dynamic decoding module sent to the receiving end.

[0378] Step 16: The second diffusion matrix generation module at the receiving end generates the second chaotic DNA matrix V 4 , the method is:

[0379] 16.1 The second diffusion matrix generation module at the receiving end receives the second chaotic sequence V from the chaotic sequence generation module.

[0380] 16.2 The second diffusion matrix generation module uses formula 16 to integerize V and generate the second integer sequence V 3 , whose elements are integers from 0 to 255,

[0381] V 3 =mod(floor(V×10 8 ),256), Formula 16

[0382] Among them, floor(V×10 8 ) means multiplying the 262144 chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),256) means that each element in the new integer matrix is ​​subjected to a 256 modulo operation and mapped to the integer range of [0,255].

[0383] 16.3 The second diffusion matrix generation module uses formula 17 to V 3 Integerize to generate the sixth DNA encoding rule matrix K 6 , whose elements are integers from 1 to 8,

[0384] K6 =mod(floor(V 3 ×10 8 ),8)+1, Formula 17

[0385] Among them, floor(V 3 ×10 8 ) represents the matrix V 3 The 262144 chaos values ​​in are multiplied by 10 8 Then round down to get a new integer matrix. mod(floor(V 3 ×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V 3 ×10 8 ),8)+1 to obtain a sixth DNA coding rule matrix K with a value in the integer range [1,8] 6 .

[0386] 16.4 The second diffusion matrix generation module uses K 6 Using formula 18, V 3 DNA encoding is performed to obtain the second chaotic DNA matrix V with a size of 512×2048 4 ,

[0387] V 4 =DNA_encode(V 3 ,K 6 ). Formula 18

[0388] Among them, DNA_encode(V 3 ,K 6 ) refers to the V 3 According to K 6 DNA coding.

[0389] 16.5 The second diffusion matrix generation module converts the second chaotic DNA matrix V 4 The DNA is sent to the reverse diffusion module at the receiving end.

[0390] Step 17: The second DNA encoding rule generation module at the receiving end generates the seventh DNA encoding rule matrix K 7 , the method is:

[0391] 17.1 The second DNA coding rule generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module.

[0392] 17.2 The second DNA coding rule generation module uses formula 19 to integerize V and generate the seventh DNA coding rule matrix K7 , whose elements are integers from 1 to 8,

[0393] K 7 =mod(floor(V×10 8 ),8)+1, Formula 19

[0394] Among them, floor(V×10 8 ) means multiplying the 262144 chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix. mod(floor(V×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range [0,7]. Finally, mod(floor(V×10 8 ),8)+1 to obtain the seventh DNA coding rule matrix K with a value in the integer range [1,8] 7 .

[0395] 17.3 The second DNA encoding rule generation module converts the seventh DNA encoding rule matrix K 7 The DNA convolutional decoding module sent to the receiving end.

[0396] In step 18, the second image size adjustment module at the receiving end adjusts the image size by:

[0397] 18.1 The second image resizing module at the receiving end receives the encrypted image E from the receiving module.

[0398] 18.2 The second image resizing module converts the encrypted image E from decimal format to 8-bit binary format and deletes the zeros added by the zero padding operation in step 12.3 to obtain the encrypted image E in binary format. 1 .

[0399] 18.3 The second image resizing module converts the encrypted image E in binary format 1 The second bit-level scrambling module sent to the receiving end.

[0400] Step 19: The second bit-level scrambling module at the receiving end performs a random operation on E 1 Perform bit-level scrambling by:

[0401] 19.1 The second bit-level scrambling module at the receiving end receives the encrypted image E in binary format from the second image resizing module 1 , receiving the third chaotic sequence W from the second chaotic sequence generating module.

[0402] 19.2 The second bit-level scrambling module sorts the third chaotic sequence W in ascending order to obtain the second index sequence W 2 , W2 The elements in it are integer values ​​ranging from [1,262144].

[0403] 19.3 The second bit-level scrambling module uses formula 20 to E 1 Perform bit-level scrambling operation to obtain the third scrambled sequence E with a length of 4194304 2 .

[0404]

[0405] Where, q=1,2,…,4194304, Indicates E 2 Zhongyou The binary number at the specified position, It is W 2 The index value of the qth bit in , that is, a value in the range [1, MN]. Indicates E 1 The qth binary number in .

[0406] 19.4 The second bit-level scrambling module converts the third scrambling sequence E 2 The DNA convolutional decoding module sent to the receiving end.

[0407] In the twentieth step, the DNA convolution decoding module at the receiving end performs DNA convolution decoding, and the method is:

[0408] 20.1 The DNA convolutional decoding module receives the third scrambled sequence E from the second bit-level scrambling module 2 , receiving the seventh DNA encoding rule matrix K from the second DNA encoding rule generation module 7 .

[0409] 20.2 The DNA convolutional decoding module constructs a grid graph according to the encoding and state transition rules of the DNA convolutional encoder. The grid graph consists of state nodes arranged in chronological order, and each state node represents a possible state of the DNA convolutional encoder after processing the input bit sequence. The state nodes of the grid graph start from the initial state, and the state nodes are gradually updated as each input signal enters the DNA convolutional encoding module. The paths in the grid graph represent state transitions, and each path corresponds to the state change and possible output of the encoder. These paths will be used for subsequent branch metric calculations and path selection to evaluate the errors and possible correct paths during decoding. The method to construct the grid graph is:

[0410] 20.2.1 Determine the DNA convolutional encoder parameters.

[0411] According to the design of the convolutional encoder, the values ​​of the parameters of the DNA convolutional encoder are determined, including the constraint length, code rate, number of registers, and generating polynomial. The constraint length refers to the length of the historical input that the convolutional encoder relies on when processing the input sequence, which determines that the encoder's calculation of the current output not only depends on the current input bit, but also involves the historical information of the previous input bits. The code rate refers to the ratio between the input bit stream and the output bit stream, usually expressed as k / n, where k is the number of input code elements and n is the number of output code elements, which determines the efficiency of the encoder. The number of registers refers to the number of shift registers inside the convolutional encoder, which directly affects the size of the encoder's state space and the encoder's memory capacity. The generating polynomial determines the encoder's output sequence and state transition rules, and defines the conversion relationship between input bits and output bits. These parameters determine the structure and size of the grid graph.

[0412] 20.2.2 According to the initial state of the DNA convolutional encoder, an initial state node is set in the grid diagram; the metric value of the initial state node is set to 0, indicating that there is no error when decoding starts; the metric value refers to the difference between the DNA convolutional encoding path and the third scrambling sequence E received from the second bit-level scrambling module. 2 The degree of matching between data is used to measure the cumulative error from the initial state to the current state; the smaller the metric value, the closer the path is to the actual received data and the smaller the error.

[0413] 20.2.3 According to the state transition rule of the DNA convolutional encoder, add transitions from the current state node to the next state node in the grid graph. Each transition corresponds to a possible sequence of input bits and output bits, indicating the state change of the DNA convolutional encoder when processing input bits. In the grid graph, these transitions are represented as directed edges, connecting different state nodes.

[0414] 20.2.4 Set the final state; determine the final state node of the grid graph, which corresponds to the state of the DNA convolutional encoder after processing all input bits.

[0415] 20.3 DNA convolutional decoding module receives E in turn 2 The binary data in .

[0416] 20.4 DNA Convolutional Decoding Module calculates the branch metric for each binary data received by traversing the state nodes in the grid graph, calculating the branch metric from the previous state node to the current state node, and measuring the error size of the path. The branch metric is calculated by comparing the difference between the received input sequence and the possible input bit sequence inferred by the decoder, usually using the Hamming distance as the metric.

[0417] To correct possible errors, the DNA convolutional decoder derives the sequences that the DNA convolutional encoder may send in each state of the trellis diagram based on the known DNA convolutional coding rules and the trellis diagram. These sequences are the possible input bit sequences.

[0418] 20.5 Select the survivor path. For each state node of the trellis graph, compare the branch metrics corresponding to all possible input bit sequences and select the path with the smallest metric as the survivor path. The survivor path is the path that the DNA convolutional decoder determines is most likely to be the original transmitted sequence.

[0419] 20.6 Based on the selected surviving path, the metric value of the current state node is updated to the cumulative sum of the metric values ​​of all branches on the surviving path, which represents the total error size from the initial state to the current state path.

[0420] 20.7 Backtrack the surviving path and get the decoding result. The method is:

[0421] 20.7.1 Set the backtracking depth to 34.

[0422] 20.7.2 Backtracking the survivor path: Starting from the final state node, backtrack to the initial state node or the specified backtracking depth according to the previously recorded survivor path information; during the backtracking process, the DNA convolution decoder tracks the survivor path of each state node until the backtracking depth is reached or backtracks to the initial state node; at the same time, the DNA convolution decoder constructs the entire survivor path sequence; the survivor path sequence is the DNA decoding sequence P obtained by the DNA convolution decoder performing DNA dynamic decoding on the DNA convolution module at the sending end in step 10.4 4 best estimate of .

[0423] 20.7.3 The DNA convolution decoder outputs the surviving path sequence as the decoding result, which is the preliminary DNA convolution decoding sequence E 3 , E 3 The length of is 2097152. It is worth noting that since the encrypted image is transmitted through an unsafe channel that may be risky, it may be interfered by channel noise or attacked by malicious attackers. In this context, the E obtained by the DNA convolutional decoder is 3 It is the best estimate based on the current receiving conditions and aims to identify and correct errors that may occur during the transmission process, thereby effectively improving the overall reliability of the data.

[0424] 20.8 E 3 Use formula 21 to convert to the preliminary DNA convolution decoding matrix E 4 ,

[0425] E 4= reshape(E 3 ,[512,4096]), Formula 21

[0426] Among them, reshape(E 3 ,[512,4096]) function is the size conversion function, which means that E 3 Converted to a preliminary DNA convolution decoding matrix E of size 512×4096 4 .

[0427] 20.9 Using K 7 For E 4 Perform dynamic DNA encoding, the calculation formula is formula 22, and the decoding DNA matrix E with a size of 512×2048 is obtained 5 ,

[0428] E 5 =DNA_encode(E 4 ,K 7 ), Formula 22

[0429] Among them, DNA_encode(E 4 ,K 7 ) means that E 4 According to K 7 DNA coding.

[0430] 20.10 The DNA convolutional decoding module decodes the DNA matrix E 5 Sent to the DNA reverse diffusion module.

[0431] In the 21st step, the DNA reverse diffusion module at the receiving end performs DNA reverse diffusion, the method is:

[0432] 21.1 The DNA reverse diffusion module at the receiving end receives the decoded DNA matrix E from the DNA convolution decoding module 5 , receiving the second chaotic DNA matrix V from the second diffusion matrix generation module 4 .

[0433] 21.2 DNA Reverse Diffusion Module 5 and V 4 Perform DNA XOR operation, the calculation formula is shown in Formula 23, and the DNA reverse diffusion matrix E with a size of 512×2048 is obtained 6 ,

[0434] E 6 =DNA_xor(E 5 ,V 4 ), Formula 23

[0435] Among them, DNA_xor(E 5 ,V4 ) means to convert E 5 and V 4 Perform DNA XOR operation.

[0436] 21.3 DNA Back-Diffusion Matrix E 6 The DNA dynamic decoding module sent to the receiving end.

[0437] In step 22, the DNA dynamic decoding module at the receiving end performs DNA dynamic decoding, the method is:

[0438] 22.1 The DNA dynamic decoding module at the receiving end receives the DNA reverse diffusion matrix E from the DNA reverse diffusion module 6 , receiving the fifth DNA decoding rule matrix K from the second DNA decoding rule generation module 5 .

[0439] 22.2 DNA dynamic decoding module using K 5 For E 6 Perform DNA dynamic decoding, the decoding formula is Formula 24, and the decoding sequence E with a length of 262144 is obtained 7 ,

[0440] E 7 =DNA_decode(E 6 ,K 5 ). Formula 24

[0441] Among them, DNA_decode(E 6 ,K 5 ) means that E 6 According to K 5 Decoding DNA.

[0442] 22.3 DNA dynamic decoding module will decode sequence E 7 The third image resizing module is sent to the receiving end.

[0443] In step 23, the third image size adjustment module at the receiving end adjusts the image size by:

[0444] 23.1 The third image resizing module receives the decoding sequence E from the DNA dynamic decoding module 7 .

[0445] 23.2 The third image resizing module uses formula 25 to convert E 7 Convert it to the same size as the original image P to get the final decrypted image D. The final decrypted image D is as follows Figure 6 shown. Figure 6 The original image input in the second step Figure 3 Exactly the same, indicating that this method can effectively decrypt.

[0446] D = reshape(E 7 ,[512,512]), Formula 25

[0447] Among them, reshape(E 7 ,[512,512]) is the conversion size function, which means that E 7 Convert to a decrypted image D of size 512×512.

[0448] 23.3 The third image resizing module sends the decrypted image D to the output module of the receiving end.

[0449] In step 24, the output module at the receiving end receives the decrypted image D from the third image resizing module, outputs the decrypted image D, and completes image decryption.

[0450] The above is a detailed introduction to the error correction image encryption and decryption method based on DNA convolution provided by the present invention. This article explains the principles and implementation methods of the present invention, and the above description is used to help understand the core idea of ​​the present invention. It should be pointed out that for ordinary researchers in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A DNA convolutional code-based error correction image encryption and decryption method, characterized in that The following steps are involved: The first step is to build an error-correcting image encryption and decryption system based on DNA convolutional codes: The error correction image encryption and decryption system based on DNA convolutional code is composed of a sending end and a receiving end; both the sending end and the receiving end are servers; the sending end and the receiving end are connected by optical fiber or cable; the sending end is equipped with an input module, a key generation module, a first chaotic sequence generation module, a first DNA encoding rule generation module, a DNA dynamic encoding module, a first diffusion matrix generation module, a DNA diffusion module, a first DNA decoding rule generation module, a DNA convolutional encoding module, a first level scrambling module and a first image size adjustment module; the receiving end is equipped with a receiving module, a second chaotic sequence generation module, a second image size adjustment module, a second level scrambling module, a second DNA encoding rule generation module, a DNA convolutional decoding module, a second diffusion matrix generation module, a DNA reverse diffusion module, a second DNA decoding rule generation module, a DNA dynamic decoding module, a third image size adjustment module and an output module; The input module of the sending end is connected to the key generation module and the DNA dynamic encoding module; the input module sends the original image P received from the user to the key generation module and the DNA dynamic encoding module; The key generation module at the sending end is connected to the input module, the first chaotic sequence generation module, and the receiving module at the receiving end; the key generation module receives the original image P from the input module, calculates the hash value of P and further generates a key, and sends the key to the first chaotic sequence generation module and the receiving module at the receiving end; The first chaotic sequence generation module at the transmitting end is connected with the key generation module, the first DNA encoding rule generation module, the first diffusion matrix generation module, the first DNA decoding rule generation module, and the first level scrambling module; the first chaotic sequence generation module receives the key from the key generation module, generates the first chaotic sequence U, the second chaotic sequence V, and the third chaotic sequence W according to the key, sends the first chaotic sequence U to the first DNA encoding rule generation module, sends the second chaotic sequence V to the first diffusion matrix generation module and the first DNA decoding rule generation module, and sends the third chaotic sequence W to the first level scrambling module; The first DNA coding rule generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA dynamic coding module; the first DNA coding rule generation module receives the first chaotic sequence U from the first chaotic sequence generation module, and generates the first DNA coding rule matrix K according to U 1 , K 1 Send to DNA dynamic encoding module; The first diffusion matrix generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA diffusion module; the first diffusion matrix generation module receives the second chaotic sequence V from the first chaotic sequence generation module, and generates the first chaotic DNA matrix V according to V 2 , V 2 Send to DNA diffusion module; The first DNA decoding rule generation module at the transmitting end is connected to the first chaotic sequence generation module and the DNA convolutional coding module; the first DNA decoding rule generation module receives the second chaotic sequence V from the first chaotic sequence generation module, and generates a third DNA decoding rule matrix K according to V 3 , K 3 Send to DNA convolutional coding module; The DNA dynamic encoding module at the sending end is connected to the input module, the first DNA encoding rule generation module, and the DNA diffusion module; the DNA dynamic encoding module receives the original image P from the input module and receives the first DNA encoding rule matrix K from the first DNA encoding rule generation module. 1 , using K 1 Perform DNA dynamic encoding on P to obtain the DNA matrix P 1 , P 1 Send to DNA diffusion module; The DNA diffusion module at the sending end is connected to the DNA dynamic encoding module, the first diffusion matrix generation module, and the DNA convolution encoding module; the DNA diffusion module receives the DNA matrix P from the DNA dynamic encoding module. 1 , receiving the first chaotic DNA matrix V from the first diffusion matrix generation module 2 , for P 1 and V 2 Perform DNA XOR operation to obtain the DNA diffusion matrix P 2 , P 2 Send to DNA convolutional coding module; The DNA convolutional coding module at the transmitting end is connected to the first DNA decoding rule generation module, the DNA diffusion module, and the first-order scrambling module; the DNA convolutional coding module is a DNA convolutional encoder, which receives the third DNA decoding rule matrix K from the first DNA decoding rule generation module. 3 , receiving the DNA diffusion matrix P from the DNA diffusion module 2 , using K 3 P 2 Perform DNA convolution coding to obtain the DNA convolution coding sequence P 5 , P 5 Send to the first-level scrambling module; The first level scrambling module at the transmitting end is connected to the first chaotic sequence generating module, the DNA convolutional coding module, and the first image size adjusting module; the first level scrambling module receives the DNA convolutional coding sequence P from the DNA convolutional coding module. 5 , receiving the third chaotic sequence W from the first chaotic sequence generation module, using W to generate P 5 Perform bit-level scrambling to obtain the first scrambled sequence P 6 , P 6 Sending to a first image resizing module; The first image size adjustment module is connected to the first-level scrambling module and the receiving module of the receiving end, and receives the first scrambling sequence P from the first-level scrambling module. 6 , P 6 The image is resized to obtain the final encrypted image E, the image encryption is completed, and E is sent to the receiving module at the receiving end; The receiving module of the receiving end is connected with the first image size adjustment module of the sending end, the key generation module of the sending end, the second chaotic sequence generation module of the receiving end and the second image size adjustment module of the receiving end; the receiving module receives the key from the key generation module of the sending end, receives the encrypted image E from the first image size adjustment module, sends the key to the second chaotic sequence generation module of the receiving end, and sends the encrypted image E to the second image size adjustment module of the receiving end; The second chaotic sequence generation module at the receiving end is connected with the receiving module at the receiving end, the second DNA decoding rule generation module at the receiving end, the second diffusion matrix generation module at the receiving end, the second DNA encoding rule generation module at the receiving end, and the second bit-level scrambling module at the receiving end; the second chaotic sequence generation module at the receiving end receives the key from the receiving module, generates a first chaotic sequence U according to the key, and sends U to the second DNA decoding rule generation module at the receiving end; the second chaotic sequence generation module at the receiving end generates a second chaotic sequence V according to the key, and sends V to the second diffusion matrix generation module at the receiving end and the second DNA encoding rule generation module at the receiving end; the second chaotic sequence generation module at the receiving end generates a third chaotic sequence W according to the key, and sends W to the second bit-level scrambling module at the receiving end; The second DNA decoding rule generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA dynamic decoding module at the receiving end; the DNA decoding rule generation module receives the first chaotic sequence U from the second chaotic sequence generation module, and generates a fourth DNA decoding rule matrix K according to U 4 , K 4 Send to DNA dynamic decoding module; The second diffusion matrix generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA inverse diffusion module at the receiving end; the diffusion matrix generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module, and generates a second chaotic DNA matrix V according to V 4 , V 4 Send to DNA reverse diffusion module; The second DNA coding rule generation module at the receiving end is connected to the second chaotic sequence generation module at the receiving end and the DNA convolution decoding module at the receiving end; the DNA coding rule generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module, and generates the sixth DNA coding rule matrix K according to V 6 , K 6 Send to DNA convolution decoding module; The second image resizing module at the receiving end is connected to the receiving module at the receiving end and the second bit-level scrambling module at the receiving end; the second image resizing module at the receiving end receives the encrypted image E from the receiving module, converts E from a decimal format to a binary format, and obtains an encrypted image E in a binary format. 1 , E 1 A second bit-level scrambling module sent to the receiving end; The second bit-level scrambling module at the receiving end is connected to the second chaotic sequence generating module at the receiving end, the second image resizing module at the receiving end, and the DNA convolution decoding module at the receiving end; the second bit-level scrambling module at the receiving end receives the encrypted image E in binary format from the second image resizing module 1 , receiving the third chaotic sequence W from the second chaotic sequence generation module, and generating the third chaotic sequence W according to W 1 Perform bit-level scrambling to obtain the second scrambled sequence E 2 , E 2 The DNA convolutional decoding module sent to the receiving end; The DNA convolutional decoding module at the receiving end is connected to the second bit-level scrambling module at the receiving end, the second DNA encoding rule generation module at the receiving end, and the DNA reverse diffusion module at the receiving end; the DNA convolutional decoding module at the receiving end is a convolutional decoder that receives the second scrambling sequence E from the second bit-level scrambling module 2 , receiving the sixth DNA encoding rule matrix K from the second DNA encoding rule generation module 6 , using K 6 For E 2 Perform DNA convolution decoding to obtain the decoding DNA matrix E 5 , E 5 DNA reverse diffusion module sent to the receiving end; The DNA reverse diffusion module at the receiving end is connected to the DNA convolution decoding module at the receiving end, the second diffusion matrix generation module at the receiving end, and the DNA dynamic decoding module at the receiving end; the DNA reverse diffusion module at the receiving end receives the decoding DNA matrix E from the DNA convolution decoding module 5 , receiving the second chaotic DNA matrix V from the second diffusion matrix generation module 4 , E 5 and V 4 Perform DNA XOR operation to obtain the DNA inverse diffusion matrix E 6 , E 6 DNA dynamic decoding module sent to the receiving end; The DNA dynamic decoding module at the receiving end is connected to the DNA reverse diffusion module at the receiving end, the second DNA decoding rule generation module at the receiving end, and the third image size adjustment module at the receiving end; the DNA dynamic decoding module at the receiving end receives the DNA reverse diffusion matrix E from the DNA reverse diffusion module 6 , receiving the fourth DNA decoding rule matrix K from the second DNA decoding rule generation module 4 , using K 4 For E 6 Perform DNA dynamic decoding to obtain the decoding sequence E 7 , E 7 a third image resizing module sent to a receiving end; The third image size adjustment module at the receiving end is connected to the DNA dynamic decoding module at the receiving end and the output module at the receiving end; the third image size adjustment module at the receiving end receives the decoding sequence E from the DNA dynamic decoding module 7 , adjust E 7 The size of the image is obtained, and the decrypted image D is sent to the output module of the receiving end; The output module of the receiving end is connected to the third image resizing module of the receiving end, and the output module receives the decrypted image D sent from the third image resizing module of the receiving end, completes the image decryption, and outputs D; In the second step, the input module of the sending end receives the original image P input by the user. The size of P is M×N, where M represents the number of rows of image pixels, which is a positive integer; N represents the number of columns of image pixels, which is a positive integer; Send P to the key generation module and the DNA dynamic encoding module; In the third step, the key generation module generates a key by: 3.1 The key generation module receives the original image P from the input module; 3.2 The key generation module calculates the hash value sequence H of P K , H K =[k1,k2,…,k s ,…,k 64 ], 1≤s≤64, k s Is a hexadecimal number; and use formula 1 to generate the key, the key is x 1 、r 1 、x 2 、r 2 、x 3 and r 3 is a six-tuple, namely (x 1 , r 1 , x 2 , r 2 , x 3 , r 3 ), where x 1 、x 2 、x 3 ∈(0,1), used as the initial value of chaos, r 1 、r 2 、r 3 ∈(0,4], used as a control parameter of chaos; in Represents XOR operation; 3.3 Sending the key to the first chaotic sequence generation module and the receiving module at the receiving end; In the fourth step, the first chaotic sequence generation module generates the first chaotic sequence U, the second chaotic sequence V, and the third chaotic sequence W by: 4.1 The first chaotic sequence generation module receives the key from the key generation module; 4.2 The first chaotic sequence generation module uses the chaotic sequence generation method to utilize x 1 、r 1 Generate the first chaotic sequence U by: 4.2.1 Let the initial value x0 = x 1 , let the control parameter r = r 1 , set the total number of iterations Epoch to 1000+MN; initialize the first chaotic sequence U to be empty, U is used to store chaotic values; set the number of iterations n=1; 4.2.2 Calculate the nth chaos value: 4.2.2.1 Calculate the value x using Formula 2 n ; x n =rx n-1 (1-x n-1 ); Formula 2 4.2.2.2 If n<1000, go directly to 4.2.2.3; if n>1000, change x n Add it to the first chaotic sequence U and go to 4.2.2.3; 4.2.2.3 Let n = n + 1; 4.2.2.4 If n≤Epoch, go to 4.2.2.1 to continue generating chaotic values; if n>Epoch, it means that enough chaotic values ​​have been generated and the first chaotic sequence U is obtained. U contains MN chaotic values, and these values ​​are between 0 and 1, go to 4.3; 4.3 Sending the first chaotic sequence U to the first DNA coding rule generation module; 4.4 The first chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 2 、r 2 Generate a second chaotic sequence V; send V to the first diffusion matrix generation module and the first DNA decoding rule generation module; 4.5 The first chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 3 、r 3 Generate a third chaotic sequence W, and send W to the first-level scrambling module; Step 5: The first DNA coding rule generation module generates the first DNA coding rule matrix K 1 , the method is: 5.1 The first DNA coding rule generation module receives the first chaotic sequence U from the first chaotic sequence generation module; 5.2 The first DNA coding rule generation module uses formula 3 to integerize U and generate the first DNA coding rule matrix K 1 , whose elements are integers from 1 to 8, K 1 = mod(floor(U×10 8 ),8)+1, formula 3 Among them, mod(·) represents the modulus operation, floor(·) represents the floor function, floor(U×10 8 ) means multiplying the MN chaotic values ​​in the matrix U by 10 8 Then round down to get a new integer matrix; mod(floor(U×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range of [0,7]; finally, mod(floor(U×10 8 ),8)+1 to obtain a first DNA encoding rule matrix K with a value in the integer range [1,8] 1 ; 5.3 The first DNA encoding rule matrix K 1 Send to DNA dynamic encoding module; Step 6: The first diffusion matrix generation module generates the first chaotic DNA matrix V 2 , the method is: 6.1 The first diffusion matrix generation module receives the second chaotic sequence V from the first chaotic sequence generation module; 6.2 The first diffusion matrix generation module uses formula 4 to integerize the second chaotic sequence V to generate the first integer sequence V 1 , whose elements are integers from 0 to 255, V 1 =mod(floor(V×10 8 ),256); Formula 4 Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix; mod(floor(V×10 8 ),256) means that each element in the new integer matrix is ​​subjected to a 256 modulo operation and mapped to the integer range of [0,255]; 6.3 The first diffusion matrix generation module uses formula five to V 1 Integerize to generate the second DNA encoding rule matrix K 2 , whose elements are integers from 1 to 8, K 2 =mod(floor(V 1 ×10 8 ),8)+1; Formula 5 Among them, floor(V 1 ×10 8 ) represents the matrix V 1 The MN chaos values ​​in are multiplied by 10 8 Then round down to get a new integer matrix; mod(floor(V 1 ×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range of [0,7]; finally, mod(floor(V 1 ×10 8 ),8)+1 to obtain a second DNA encoding rule matrix K with a value in the integer range [1,8] 2 ; 6.4 The first diffusion matrix generation module uses K 2 Using formula six to V 1 DNA encoding is performed to obtain the first chaotic DNA matrix V of size M×4N 2 , V 2 =DNA_encode(V 1 ,K 2 ), Formula 6 Among them, DNA_encode(V 1 ,K 2 ) function is the DNA encoding function, which means that V 1 According to the second DNA encoding rule matrix K 2 Perform DNA encoding to obtain the DNA base matrix, V 2 Each element in the nucleotide sequence corresponds to a DNA base, which includes adenine (A), cytosine (C), guanine (G) and thymine (T). The DNA coding rule is designed based on the complementary pairing of DNA bases. 1 The elements in are encoded by DNA bases in binary, wherein the complementary pairing of DNA bases refers to the complementarity between A and T, and between G and C; the second DNA encoding rule matrix K 2 The value in determines the V 1 Which DNA encoding rule is used for the corresponding position elements in? 6.5 The first chaotic DNA matrix V 2 Send to DNA diffusion module; Step 7: The first DNA decoding rule generation module generates the third DNA decoding rule matrix K 3 , the method is: 7.1 The first DNA decoding rule generation module receives the second chaotic sequence V from the first chaotic sequence generation module; 7.2 The first DNA decoding rule generation module uses formula 7 to integerize V and generate the third DNA decoding rule matrix K 3 , whose elements are integers from 1 to 8, K 3 = mod(floor(V × 10 8 ),8)+1, formula 7 Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix; mod(floor(V×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range of [0,7]; finally, mod(floor(V×10 8 ),8)+1 to obtain a third DNA decoding rule matrix K with a value in the integer range [1,8] 3 ; 7.3 The first DNA decoding rule generation module converts the third DNA decoding rule matrix K 3 Send to DNA convolutional coding module; In the eighth step, the DNA dynamic encoding module performs DNA dynamic encoding, and the method is: 8.1 The DNA dynamic encoding module receives the original image P from the input module and receives the first DNA encoding rule matrix K from the first DNA encoding rule generation module 1 ; 8.2 DNA Dynamic Encoding Module Using K 1 Perform DNA encoding on P according to formula 8 to obtain a DNA matrix P of size M×4N 1 ; P 1 =DNA_encode(P,K 1 ), Formula 8 Among them, DNA_encode(P,K 1 ) means that P is converted into K 1 DNA encoding; 8.3 DNA matrix P 1 Send to DNA diffusion module; In the ninth step, the DNA diffusion module performs DNA diffusion as follows: 9.1 The DNA diffusion module receives the DNA matrix P from the DNA dynamic encoding module 1 , receiving the first chaotic DNA matrix V from the first diffusion matrix generation module 2 ; 9.2 P 1 and V 2 Perform DNA XOR operation, the calculation formula is shown in Formula 9, and the DNA diffusion matrix P with a size of M×4N is obtained 2 , P 2 =DNA_xor(P 1 ,V 2 ), Formula 9 Among them, DNA_xor(P 1 ,V 2 ) function is the DNA XOR function, which means that P 1 ,V 2 Perform DNA XOR operation; 9.3 DNA diffusion matrix P 2 Send to DNA convolutional coding module; In the tenth step, the DNA convolutional coding module performs DNA convolutional coding, the method is: 10.1 DNA convolutional coding module initializes all states of the DNA convolutional encoder to "0"; 10.2 The DNA convolutional encoding module receives the DNA diffusion matrix P from the DNA diffusion module 2 , receiving the third DNA decoding rule matrix K from the first DNA decoding rule generation module 3 ; 10.3 Using Formula 10, P 2 Convert to DNA diffusion sequence P 3 , using formula 11 to convert K 3 Convert to the fourth DNA decoding rule sequence K 4 , P 3 = reshape(P 2 ,[1,4MN]), Formula 1 K 4 = reshape(K 3 ,[1,MN]), Formula 11 Among them, reshape(P 2 ,[1,4MN]) function is the size conversion function, which means that P 2 Converted to a DNA diffusion sequence P with a length of 4MN 3 ,reshape(K 3 ,[1,MN]) means K 3 Converted to the fourth DNA decoding rule sequence K of length MN 4 ; 10.4 DNA convolutional coding module uses formula 12 to adopt K 4 P 3 The bases in the sequence are decoded dynamically to obtain the DNA decoding sequence P 4 , Where i = 1, 2, ..., M × N, Indicates P 4 The binary numbers from the (8i-7)th to the 8ith digits, Indicates P 3 The DNA bases from position (4i-3) to position 4i in K 4 The DNA decoding rule for the i-th position in , Function is the DNA decoding function, which means that P 3 The DNA bases from position (4i-3) to position 4i follow the rule Decoding DNA, The value of Which DNA decoding rule is used for DNA bases? 10.5 DNA Convolutional Coding Module for DNA Decoding Sequence P 4 The binary numbers in are encoded according to the rules of the DNA convolutional encoder to obtain a DNA convolutional coding sequence P with a length of 16MN. 5 , P 5 Send to the first-level scrambling module; Step 11: The first-level scrambling module performs 5 Perform bit-level scrambling by: 11.1 The first-level scrambling module receives the third chaotic sequence W from the first chaotic sequence generation module and receives the DNA convolutional coding sequence P from the DNA convolutional coding module. 5 ; 11.2 The first-level scrambling module sorts the third chaotic sequence W in ascending order to obtain the first index sequence W 1 , W 1 The elements in it are integer values ​​ranging from [1, MN]; 11.3 The first-level scrambling module uses formula 13 to P 5 Perform bit-level scrambling operation to obtain the first scrambling sequence P with a length of 16MN 6 ; Where, j = 1, 2, ..., 16MN, Indicates P 6 The j-th binary number in Indicates P 5 Zhongyou The binary number at the specified position, It is W 1 The index value of the jth position in , that is, a value in the range [1, MN]; 11.4 The first-level scrambling module will 6 Sending to a first image resizing module; In step 12, the first image size adjustment module adjusts the image size to complete image encryption, the method is: 12.1 The first image resizing module receives the first scrambling sequence P from the first-level scrambling module 6 ; 12.2 The first image resizing module converts P 6 Convert from binary format to decimal format to get the second decimal scrambled sequence P 7 ; 12.3 The first image resizing module uses Formula 14 to resize P 7 The image size is converted. If the size obtained during the conversion process is not an integer, a zero padding operation is performed to obtain the final encrypted image E; in, Function is the conversion size function, which means to convert P 7 Convert to size The encrypted image E; 12.4 The first image resizing module sends the encrypted image E to the receiving module at the receiving end; In step 13, the receiving module at the receiving end receives the key from the key generation module and receives the encrypted image E from the first image size adjustment module; the receiving module at the receiving end sends the key to the second chaotic sequence generation module at the receiving end and sends the encrypted image E to the second image size adjustment module; In step 14, the second chaotic sequence generation module at the receiving end generates a chaotic sequence by: 14.1 The second chaotic sequence generation module at the receiving end receives the key (x 1 , r 1 , x 2 , r 2 , x 3 , r 3 ); 14.2 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 1 , r 1 Generate a first chaotic sequence U, and send U to a second DNA decoding rule generation module at the receiving end; 14.3 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 2 、r 2 Generate a second chaotic sequence V, and send V to a second diffusion matrix generation module at the receiving end and a second DNA coding rule generation module at the receiving end; 14.4 The second chaotic sequence generation module adopts the chaotic sequence generation method described in step 4.2 using x 3 、r 3 Generate a third chaotic sequence W, and send W to a second bit-level scrambling module at the receiving end; Step 15: The second DNA decoding rule generation module at the receiving end generates the fifth DNA decoding rule matrix K 5 , the method is: 15.1 The second DNA decoding rule generation module at the receiving end receives the first chaotic sequence U from the second chaotic sequence generation module; 15.2 The second DNA decoding rule generation module uses formula 15 to integerize U and generate the fifth DNA decoding rule matrix K 5 , whose elements are integers from 1 to 8, K 5 = mod(floor(U×10 8 ),8)+1, Official 15 Among them, floor(U×10 8 ) means multiplying the MN chaotic values ​​in the matrix U by 10 8 Then round down to get a new integer matrix; mod(floor(U×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range of [0,7]; finally, mod(floor(U×10 8 ),8)+1 to obtain a fifth DNA decoding rule matrix K with a value in the integer range [1,8]. 5 ; 15.3 The second DNA decoding rule generation module converts K 5 DNA dynamic decoding module sent to the receiving end; Step 16: The second diffusion matrix generation module at the receiving end generates the second chaotic DNA matrix V 4 , the method is: 16.1 The second diffusion matrix generation module at the receiving end receives the second chaotic sequence V from the chaotic sequence generation module; 16.2 The second diffusion matrix generation module uses formula 16 to integerize V and generate the second integer sequence V 3 , whose elements are integers from 0 to 255, V 3 =mod(floor(V×10 8 ),256), Formula 16 Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix; mod(floor(V×10 8 ),256) means that each element in the new integer matrix is ​​subjected to a 256 modulo operation and mapped to the integer range of [0,255]; 16.3 The second diffusion matrix generation module uses formula 17 to V 3 Integerize to generate the sixth DNA encoding rule matrix K 6 , whose elements are integers from 1 to 8, K 6 =mod(floor(V 3 ×10 8 ),8)+1, Formula 17 Among them, floor(V 3 ×10 8 ) represents the matrix V 3 The MN chaos values ​​in are multiplied by 10 8 Then round down to get a new integer matrix; mod(floor(V 3 ×10 8 ),8) means to perform modulo 8 operation on each element in the new integer matrix and map it to the integer range of [0,7]; finally, mod(floor(V 3 ×10 8 ),8)+1 to obtain a sixth DNA coding rule matrix K with a value in the integer range [1,8] 6 ; 16.4 The second diffusion matrix generation module uses K 6 Using formula 18, V 3 DNA encoding is performed to obtain the second chaotic DNA matrix V with a size of M×4N 4 , V 4 =DNA_encode(V 3 ,K 6 ); Formula 18 Among them, DNA_encode(V 3 ,K 6 ) refers to the V 3 According to K 6 DNA encoding; 16.5 The second diffusion matrix generation module converts the second chaotic DNA matrix V 4 DNA reverse diffusion module sent to the receiving end; Step 17: The second DNA encoding rule generation module at the receiving end generates the seventh DNA encoding rule matrix K 7 , the method is: 17.1 The second DNA coding rule generation module at the receiving end receives the second chaotic sequence V from the second chaotic sequence generation module; 17.2 The second DNA coding rule generation module uses formula 19 to integerize V and generate the seventh DNA coding rule matrix K 7 , whose elements are integers from 1 to 8, K 7 = mod(floor(V × 10 8 ),8)+1, formula 19 Among them, floor(V×10 8 ) means multiplying the MN chaotic values ​​in the matrix V by 10 8 Then round down to get a new integer matrix; mod(floor(V×10 8 ),8) means to perform modulo 8 operation on each element of the new integer matrix and map it to the integer range of [0,7]; finally, mod(floor(V×10 8 ),8)+1 to obtain the seventh DNA coding rule matrix K with a value in the integer range [1,8] 7 ; 17.3 The second DNA encoding rule generation module converts the seventh DNA encoding rule matrix K 7 The DNA convolutional decoding module sent to the receiving end; In step 18, the second image size adjustment module at the receiving end adjusts the image size by: 18.1 The second image resizing module at the receiving end receives the encrypted image E from the receiving module; 18.2 The second image resizing module converts the encrypted image E from decimal format to 8-bit binary format and deletes the zeros added by the zero padding operation in step 12.3 to obtain the encrypted image E in binary format. 1 ; 18.3 The second image resizing module converts E 1 A second bit-level scrambling module sent to the receiving end; Step 19: The second bit-level scrambling module at the receiving end performs a random operation on E 1 Perform bit-level scrambling by: 19.1 The second bit-level scrambling module at the receiving end receives the encrypted image E in binary format from the second image resizing module 1 , receiving a third chaotic sequence W from the second chaotic sequence generating module; 19.2 The second bit-level scrambling module sorts the third chaotic sequence W in ascending order to obtain the second index sequence W 2 , W 2 The elements in it are integer values ​​ranging from [1, MN]; 19.3 The second bit-level scrambling module uses formula 20 to E 1 Perform bit-level scrambling operation to obtain the third scrambled sequence E with a length of 16MN 2 ; Where, q=1,2,…,16MN, Indicates E 2 Zhongyou The binary number at the specified position, It is W 2 The index value of the qth bit in , that is, a value in the range [1, MN]; Indicates E 1 The qth binary number in ; 19.4 The second bit-level scrambling module converts E 2 The DNA convolutional decoding module sent to the receiving end; In the twentieth step, the DNA convolution decoding module at the receiving end performs DNA convolution decoding, and the method is: 20.1 The DNA convolutional decoding module receives the third scrambled sequence E from the second bit-level scrambling module 2 , receiving the seventh DNA encoding rule matrix K from the second DNA encoding rule generation module 7 ; 20.2 The DNA convolution decoding module constructs a grid diagram according to the encoding and state transition rules of the DNA convolution encoder; the grid diagram consists of state nodes arranged in chronological order, each state node represents a possible state of the DNA convolution encoder after processing the input bit sequence; the state nodes of the grid diagram start from the initial state, and as each input signal enters the DNA convolution encoding module, the state nodes are gradually updated; the paths in the grid diagram represent state transitions, and each path corresponds to the state change and possible output of the encoder; these paths will be used for subsequent branch metric calculations and path selection to evaluate the error and correct path during decoding; 20.3DNA convolutional decoding module receives E in turn 2 Binary data in ; 20.4 The DNA convolutional decoding module calculates the branch metric for each binary data received by traversing the state nodes in the grid graph, calculating the branch metric from the previous state node to the current state node, and measuring the error size of the path; 20.5 Select a surviving path; for each state node of the grid graph, compare the branch metrics corresponding to all possible input bit sequences, and select the path with the smallest metric value as the surviving path; 20.6 Based on the selected surviving path, the metric value of the current state node is updated to the cumulative sum of the metric values ​​of all branches on the surviving path, which represents the total error size from the initial state to the current state path; 20.7 Backtrack the surviving path and get the decoding result. The method is: 20.7.1 Set the traceback depth H, where H is the number of steps the convolutional decoder traces back in the grid graph. The traceback depth is adjusted based on channel conditions and performance requirements. 20.7.2 Backtracking the survivor path: Starting from the final state node, backtrack to the initial state node or the specified backtracking depth according to the previously recorded survivor path information; during the backtracking process, the DNA convolution decoder tracks the survivor path of each state node until the backtracking depth is reached or backtracks to the initial state node; at the same time, the DNA convolution decoder constructs the entire survivor path sequence; the survivor path sequence is the DNA decoding sequence P obtained by the DNA convolution decoder performing DNA dynamic decoding on the DNA convolution module at the sending end in step 10.4 4 best estimate of; 20.7.3 The DNA convolution decoder outputs the surviving path sequence as the decoding result, i.e., the preliminary DNA convolution decoding sequence E 3 , E 3 The length is 8MN; 20.8 E 3 Use formula 21 to convert to the preliminary DNA convolution decoding matrix E 4 , E 4 = reshape(E 3 ,[M,8N]), Formula 21 Among them, reshape(E 3 ,[M,8N]) function is the size conversion function, which means that E 3 Converted to a preliminary DNA convolution decoding matrix E of size M×8N 4 ; 20.9 Using K 7 For E 4 Perform dynamic DNA encoding, the calculation formula is Formula 22, and the decoding DNA matrix E with a size of M×4N is obtained 5 , E 5 =DNA_encode(E 4 ,K 7 ), Formula 22 Among them, DNA_encode(E 4 ,K 7 ) means that E 4 According to K 7 DNA encoding; 20.10 The DNA convolution decoding module decodes the DNA matrix E 5 Send to DNA reverse diffusion module; In the 21st step, the DNA reverse diffusion module at the receiving end performs DNA reverse diffusion, the method is: 21.1 The DNA reverse diffusion module at the receiving end receives the decoded DNA matrix E from the DNA convolution decoding module 5 , receiving the second chaotic DNA matrix V from the second diffusion matrix generation module 4 ; 21.2 DNA reverse diffusion module 5 and V 4 Perform DNA XOR operation, the calculation formula is shown in Formula 23, and the DNA reverse diffusion matrix E with a size of M×4N is obtained 6 , E 6 =DNA_xor(E 5 ,V 4 ), Formula 23 Among them, DNA_xor(E 5 ,V 4 ) means to convert E 5 and V 4 Perform DNA XOR operation; 21.3 E 6 DNA dynamic decoding module sent to the receiving end; In step 22, the DNA dynamic decoding module at the receiving end performs DNA dynamic decoding, the method is: 22.1 The DNA dynamic decoding module at the receiving end receives the DNA reverse diffusion matrix E from the DNA reverse diffusion module 6 , receiving the fifth DNA decoding rule matrix K from the second DNA decoding rule generation module 5 ; 22.2 DNA dynamic decoding module using K 5 For E 6 Perform DNA dynamic decoding, the decoding formula is Formula 24, and the decoding sequence E with a length of MN is obtained 7 , E 7 =DNA_decode(E 6 ,K 5 ); Formula 24 Among them, DNA_decode(E 6 ,K 5 ) means that E 6 According to K 5 Perform DNA decoding; 22.3DNA dynamic decoding module will decode sequence E 7 a third image resizing module sent to a receiving end; In step 23, the third image size adjustment module at the receiving end adjusts the image size by: 23.1 The third image resizing module receives the decoding sequence E from the DNA dynamic decoding module 7 ; 23.2 The third image resizing module uses formula 25 to convert E 7 Convert it to the same size as the original image P to obtain the final decrypted image D; D = reshape(E 7 ,[M,N]), Formula 25 Among them, reshape(E 7 ,[M,N]) is the conversion size function, which means that E 7 Convert to a decrypted image D of size M×N; 23.3 The third image resizing module sends the decrypted image D to the output module of the receiving end; In step 24, the output module at the receiving end receives the decrypted image D from the third image resizing module, outputs the decrypted image D, and completes image decryption.

2. The error-correcting image encryption and decryption method based on DNA convolutional code as claimed in claim 1, characterized in that The key generation module in step 3.2 calculates the hash value sequence H of P K The method is the SHA-256 secure hash algorithm.

3. The error-correcting image encryption and decryption method based on DNA convolutional code as claimed in claim 1, characterized in that There are eight DNA encoding rules described in step 6.4, and the eight DNA encoding rules are: the first rule is 00→A, 01→C, 10→G, 11→T, the second rule is 00→A, 01→G, 10→C, 11→T, the third rule is 00→C, 01→A, 10→T, 11→G, the fourth rule is 00→G, 01→A, 10→T, 11→C, the fifth rule is 00→C, 01→T, 10→A, 11→G, the sixth rule is 00→G, 01→T, 10→A, 11→C, the seventh rule is 00→T, 01→C, 10→G, 11→A, and the eighth rule is 00→T, 01→G, 10→C, 11→A.

4. The error-correcting image encryption and decryption method based on DNA convolutional code as described in claim 1 or 3, characterized in that The DNA XOR operation described in step 9.2 is based on DNA coding rules, and the DNA XOR operation rules are: DNA_xor(A,A)=A, DNA_xor(A,T)=T, DNA_xor(A,C)=C, DNA_xor(A,G)=G, DNA_xor(T,A)=T, DNA_xor(T,T)=A, DNA_xor(T,C)=G, DNA_xor(T,G)=C, DNA_xor(C,A)=C, DNA_xor(C,T)=G, DNA_xor(C,C)=A, DNA_xor(C,G)=T, DNA_xor(G,A)=G, DNA_xor(G,T)=C, DNA_xor(G,C)=T, DNA_xor(G,G)=A.

5. The error-correcting image encryption and decryption method based on DNA convolutional code as claimed in claim 1, characterized in that There are eight DNA decoding rules in step 10.4, and the eight DNA decoding rules are: the first rule is A→00, C→01, G→10, T→11, the second rule is A→00, G→01, C→10, T→11, the third rule is C→00, A→01, T→10, G→11, the fourth rule is G→00, A→01, T→10, C→11, the fifth rule is C→00, T→01, A→10, G→11, the sixth rule is G→00, T→01, A→10, C→11, the seventh rule is T→00, C→01, G→10, A→11, and the eighth rule is T→00, G→01, C→10, A→11.

6. The error-correcting image encryption and decryption method based on DNA convolutional code as claimed in claim 1, characterized in that The method for constructing the grid diagram of the DNA convolution decoding module in step 20.2 according to the encoding rules and state transition of the DNA convolution encoder is: 20.2.1 According to the design of the convolutional encoder, determine the values ​​of the parameters of the DNA convolutional encoder, including the constraint length, code rate, number of registers, and generating polynomial; the constraint length refers to the length of the historical input that the convolutional encoder relies on when processing the input sequence, which determines that the encoder's calculation of the current output depends not only on the current input bits, but also on the historical information of the previous input bits; the code rate refers to the ratio between the input bit stream and the output bit stream, expressed as k / n, where k is the number of input code elements and n is the number of output code elements, which determines the efficiency of the encoder; the number of registers refers to the number of shift registers inside the convolutional encoder, which directly affects the size of the encoder's state space and the encoder's memory capacity; the generating polynomial determines the encoder's output sequence and state transition rules, and defines the conversion relationship between input bits and output bits; these parameters determine the structure and size of the grid graph; 20.2.2 According to the initial state of the DNA convolutional encoder, an initial state node is set in the grid diagram; the metric value of the initial state node is set to 0, indicating that there is no error when decoding starts; the metric value refers to the difference between the DNA convolutional encoding path and the third scrambling sequence E received from the second bit-level scrambling module. 2 The degree of matching between data is used to measure the cumulative error from the initial state to the current state; The smaller the metric value, the closer the path is to the actual received data and the smaller the error; 20.2.3 According to the state transition rule of the DNA convolutional encoder, add transitions from the current state node to the next state node in the grid graph; each transition corresponds to a possible input bit and output bit sequence, indicating the state change of the DNA convolutional encoder when processing the input bit; in the grid graph, these transitions are represented as directed edges, connecting different state nodes; 20.2.4 Set the final state; determine the final state node of the grid graph, which corresponds to the state of the DNA convolutional encoder after processing all input bits.

7. The error-correcting image encryption and decryption method based on DNA convolutional code as claimed in claim 1, characterized in that The backtracking depth H in step 20.7.1 is set to twice the memory length of the convolutional encoder of the DNA convolutional coding module.

8. The error-correcting image encryption and decryption method based on DNA convolutional code as claimed in claim 1, characterized in that The branch metric described in step 20.4 is calculated by comparing the difference between the received input sequence and the possible input bit sequence inferred by the decoder, using the Hamming distance as the metric; the possible input bit sequence is derived by the decoder based on the DNA convolutional coding rule and the grid diagram, representing the sequence that the encoder may send in each state of the grid diagram.