An Image Encryption Method and System Based on Improved DNA Coding

Through the improved DNA encoding method, the SHA-256 hash function and chaotic system are used to scramble and base mutation of plaintext images and solve the security risk problem of fixed DNA encoding rules in the prior art, and achieve efficient image encryption effect.

CN120091092BActive Publication Date: 2025-07-11GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510570713.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-07-11
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

In the existing image encryption technology based on DNA encoding, the DNA encoding rules remain unchanged, resulting in the algorithm's poor performance in resisting exhaustive attacks, lack of universality, and poses security risks.

Method used

The improved DNA encoding method is adopted to generate the initial value and system parameters of the chaotic system through the SHA-256 hash function, and the plaintext image is encoded in combination with the chaotic system, expanding it into a three-dimensional DNA cube, and scrambling operations and local base mutations are performed in different directions. Finally, the chaotic matrix is diffused to generate a ciphertext image.

Benefits of technology

It improves the key space, enhances the information entropy of image encryption, shows super chaotic performance, can effectively resist cropping and noise attacks, and has good robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120091092B_ABST
    Figure CN120091092B_ABST
Patent Text Reader

Abstract

The present invention discloses an image encryption method and system based on improved DNA coding, which relates to the technical field of image encryption. The method includes inputting a plaintext image into the SHA-256 hash function to generate a hash value of the plaintext image, and generating an initial value of a chaotic system and system parameters of the chaotic system in combination with external parameters; using the system parameters of the chaotic system to perform DNA coding on the plaintext image to obtain DNA coding data of the plaintext image, and expanding it into a three-dimensional DNA cube; performing scrambling operations on the three-dimensional DNA cube in different directions, and performing local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube after local base mutations; decoding the three-dimensional DNA cube after local base mutations back into a two-dimensional matrix, and performing diffusion processing through a chaotic matrix to generate a ciphertext image. The present invention shows good robustness against cropping and noise attacks and can effectively resist various typical attacks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image encryption, and particularly to an image encryption method and system based on improved DNA coding. Background Art

[0002] A large number of pictures can be communicated and transmitted in real time on the network, greatly improving the efficiency of people obtaining information. However, the rapid progress of digital technology has led to a series of information security incidents, and the information security problem of images has become one of the highly concerned issues for many people.

[0003] The protection of images mainly prevents unauthorized access through encryption. To seek safe and effective encryption methods, many protection mechanisms have been developed for the characteristics of digital images. Among them, the cross-combination of DNA and chaos technology has become one of the most extensive and well-known methods. In the currently proposed chaotic image encryption technology based on DNA coding, the adopted DNA coding rules are often fixed, which will lead to poor performance of the algorithm in resisting brute-force attacks and easily cause security risks. The research of the prior art has achieved good results in improving mapping defects, but some construction methods lack universality. Summary of the Invention

[0004] The purpose of this part is to outline some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Simplifications or omissions may be made in this part, as well as in the abstract and title of the present invention, to avoid obscuring the purpose of this part, the abstract, and the title, and such simplifications or omissions shall not be used to limit the scope of the present invention.

[0005] In view of the above existing problems, the present invention is proposed.

[0006] Therefore, the present invention provides an image encryption method and system based on improved DNA coding, which can solve the problems mentioned in the background art.

[0007] To solve the above technical problems, the present invention provides the following technical solutions:

[0008] In the first aspect, the present invention provides an image encryption method based on improved DNA coding, which includes inputting a plaintext image into the SHA-256 hash function to generate a hash value of the plaintext image, and generating an initial value of a chaotic system and system parameters of the chaotic system in combination with external parameters; using the system parameters of the chaotic system to perform DNA coding on the plaintext image to obtain DNA coding data of the plaintext image, and expanding it into a three-dimensional DNA cube; performing scrambling operations on the three-dimensional DNA cube in different directions, and performing local base mutation on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube after local base mutation; decoding the three-dimensional DNA cube after local base mutation back into a two-dimensional matrix, and performing diffusion processing through a chaotic matrix to generate a ciphertext image.

[0009] As a preferred embodiment of the image encryption method based on improved DNA coding according to the present invention, the generating the initial value of the chaotic system and the system parameters of the chaotic system includes:

[0010] Inputting the plaintext image P into the SHA-256 hash function to generate a 256-bit hash value, and sequentially dividing the hash value into 32 blocks, which are represented as:

[0011] ;

[0012] where H K is the 256-bit hash value, and each block is composed of 8 bits, corresponding to a decimal number between 0 and 255, where k = 1, 2,..., 32;

[0013] The calculation formula for generating the system parameters of the chaotic system is as follows:

[0014] ;

[0015] where , , , are system parameter variables, represents the exclusive OR operation; and an intermediate variable ' is introduced into the system, and the calculation formula for the intermediate variable ' is as follows:

[0016] ;

[0017] where , , , are given external parameters, and the initial value ( , )With the system parameters ( , ), the calculation formula is as follows:

[0018] ;

[0019] Prepare the generation of the chaotic sequence according to the initial value of the generated chaotic system and the system parameters of the chaotic system.

[0020] As a preferred solution of the image encryption method based on improved DNA coding according to the present invention, wherein: the DNA coding of the plaintext image includes,

[0021] Using the initial value of the generated chaotic system and the system parameters of the chaotic system, input the generated chaotic sequence into 2D-CMODT and iterate M×N + 1000 times, where M and N are the number of rows and columns of the plaintext image respectively, discard the first 1000 data, and obtain two subsequences X and Y.

[0022] As a preferred solution of the image encryption method based on improved DNA coding according to the present invention, wherein: the extension to a three-dimensional DNA cube includes,

[0023] Calculate the coding matrix S with a size of M×N using the subsequences X and Y encode , where S encode ∈[0, 32], and use the coding matrix S encode Perform dynamic coding on the plaintext image P, expand the plane data three-dimensionally once after each coding, and obtain the extended three-dimensional DNA cube after traversal. The calculation formula is as follows:

[0024] ;

[0025] Calculate the number of data loops existing in the matrix with a size of M×N, and calculate the number of data loops for three sizes of M×N, M×4, and N×4 respectively. The calculation formula is as follows:

[0026] ;

[0027] ;

[0028] Among them, is the total number of data loops existing in the M×N matrix, min is the minimum value function, , , are the number of data loops of the corresponding size matrices respectively;

[0029] Iterate the corresponding step sequences S xoy , S xoz , S yoz, used to guide the scrambling operation of the three-dimensional DNA cube in different directions, and the calculation formula is as follows:

[0030] .

[0031] As a preferred embodiment of the image encryption method based on improved DNA coding according to the present invention, wherein: the scrambling operation of the three-dimensional DNA cube in different directions includes, according to the step sequence S xoy , S xoz , S yoz , performing a cyclic shift operation on the three-dimensional DNA cube in the xOy, xOz, and yOz planes, and obtaining the scrambled three-dimensional DNA cube after traversal.

[0032] As a preferred embodiment of the image encryption method based on improved DNA coding according to the present invention, wherein: the local base mutation includes unfolding the scrambled three-dimensional DNA cube with a size of M×N×4 in the positive direction of the y-axis, the positive direction of the x-axis, and the positive direction of the z-axis in sequence to obtain four DNA single strands, and synthesizing the four DNA single strands to obtain a DNA long strand with a size of 1×4MN; randomly defining the number of mutation points L, where L < 4MN, and generating an index for marking mutations, and the calculation formula is as follows:

[0033] ;

[0034] Wherein, S mu is the index for marking mutations, with a length of 1×L, and 0 ≤ S mu ≤ 4MN.

[0035] According to the mutation rule, for any point i on the DNA strand, if P4(i) = A / T / C / G, then it is mutated to mu[P4(i)] = T / A / G / C respectively, and the calculation formula for DNA single strand mutation is as follows:

[0036] ;

[0037] Wherein, P4 is the synthesized DNA long strand, mu is the defined mutation function; A, T, C, and G respectively represent the four DNA bases of adenine, thymine, cytosine, and guanine; represents the base at the mutation index position of the DNA long strand P4;

[0038] As a preferred embodiment of the image encryption method based on improved DNA coding according to the present invention, wherein: refolding the mutated DNA single strands in the negative direction of the z-axis, the negative direction of the x-axis, and the negative direction of the y-axis in sequence to restore them into four DNA single strands;

[0039] Recombine four DNA single strands into a three-dimensional DNA cube to obtain a synthetic three-dimensional DNA cube, and the size of the synthetic three-dimensional DNA cube is M×N×4;

[0040] Generate the decoding matrix S decode ,

[0041] ;

[0042] where floor is the floor function; reshape is the matrix reshaping function, which rearranges a one-dimensional sequence into a matrix form of M×N; in S decode (a, b), a and b respectively represent the row index and column index in the matrix, used to specify the decoding rules at different positions; the decoding matrix S decode ∈[0, 32], and according to different values of S decode (a, b), determine the decoding rules at different positions. After traversal, convert the synthetic three-dimensional DNA cube into a two-dimensional matrix, and the size of the two-dimensional matrix is M×N;

[0043] Generate a chaotic matrix and apply it to the diffusion process of the two-dimensional matrix. The calculation formula is as follows:

[0044] ;

[0045] where is the chaotic matrix;

[0046] Perform secondary diffusion. The calculation formula for secondary diffusion is as follows:

[0047] ;

[0048] where C is the final ciphertext image, is the two-dimensional matrix.

[0049] In a second aspect, the present invention provides an image encryption system based on improved DNA coding, which includes: a hash chaos initialization module, a DNA coding extension module, a scrambling mutation processing module, and a decoding diffusion encryption module; the hash chaos initialization module is used to input a plaintext image into the SHA-256 hash function to generate a hash value of the plaintext image, and generate an initial value of the chaos system and system parameters of the chaos system in combination with external parameters; the DNA coding extension module is used to perform DNA coding on the plaintext image by using the system parameters of the chaos system to obtain DNA coding data of the plaintext image, and expand it into a three-dimensional DNA cube; the scrambling mutation processing module is used to perform scrambling operations on the three-dimensional DNA cube in different directions, and perform local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube after local base mutations; the decoding diffusion encryption module is used to decode the three-dimensional DNA cube after local base mutations back into a two-dimensional matrix, and perform diffusion processing through a chaos matrix to generate a ciphertext image.

[0050] In a third aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and: when the processor executes the computer program, the steps of an image encryption method based on improved DNA coding are implemented.

[0051] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and: when the computer program is executed by a processor, the steps of an image encryption method based on improved DNA coding are implemented.

[0052] Compared with the prior art, the beneficial effects of the present invention are that compared with the prior art, the constructed new mapping has complex chaotic behavior, exhibits hyperchaotic performance in most intervals of [0, 10], and has a huge key space; the DNA coding table is expanded to 32 rules, which is three times higher, the information entropy of the encrypted image is close to 8, the image encryption time is 11.9 s, and it shows good robustness against cropping and noise attacks, and can effectively resist various typical attacks. Description of the Drawings

[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0054] Figure 1 It is the overall flowchart of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0055] Figure 2 Computer device diagram of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0056] Figure 3 Stereo coding process diagram of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0057] Figure 4 4×4 cyclic shift process diagram of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0058] Figure 5 Schematic diagram of the DNA cube unfolding process of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0059] Figure 6 Decryption algorithm flowchart of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0060] Figure 7 Schematic diagram of a sample image named "031014.tiff" of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0061] Figure 8 Sample ciphertext diagram of a sample image named "031014.tiff" of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0062] Figure 9 Bifurcation diagram (a) of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0063] Figure 10 Bifurcation diagram (b) of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0064] Figure 11 Bifurcation diagram (c) of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0065] Figure 12 Bifurcation diagram (d) of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0066] Figure 13 Lyapunov exponent spectrum diagram about parameter k of an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0067] Figure 14The Lyapunov exponent spectrum diagram of parameter μ for an image encryption method based on improved DNA coding provided by an embodiment of the present invention;

[0068] Figure 15 The sample entropy diagram of an image encryption method based on improved DNA coding provided by an embodiment of the present invention. Detailed implementation manners

[0069] To make the above objects, features, and advantages of the present invention more understandable, the following will describe the detailed implementation manners of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0070] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0071] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation manner of the present invention. The appearances of "in one embodiment" in different places in this specification do not all refer to the same embodiment, nor are they separate or selectively exclusive embodiments from other embodiments.

[0072] Embodiment 1, referring to Figures 1 to 15 , which is the first embodiment of the present invention. This embodiment provides an image encryption method based on improved DNA coding, including:

[0073] Figure 1 shows the overall flowchart of an image encryption method based on improved DNA coding, including:

[0074] S1: Input the plaintext image into the SHA-256 hash function to generate the hash value of the plaintext image, and generate the initial value of the chaotic system and the system parameters of the chaotic system in combination with external parameters.

[0075] Further, generating the initial value of the chaotic system and the system parameters of the chaotic system includes,

[0076] Input the plaintext image P into the SHA-256 hash function to generate a 256-bit hash value, and divide the hash value into 32 blocks in sequence, expressed as:

[0077] ;

[0078] Among them, H K is a 256-bit hash value, and each block consists of 8 bits, corresponding to decimal numbers between 0 and 255, where k = 1, 2,..., 32;

[0079] The calculation formula for generating the system parameters of the chaotic system is as follows:

[0080] ;

[0081] Among them, 、 、 、 are system parameter variables, represents the exclusive OR operation; in order to make the change of any external parameter affect the entire system, an intermediate variable is introduced:

[0082] ;

[0083] Among them, , , , are given external parameters, and the calculation formulas for the initial values ( , ) and the system parameters ( , ) are as follows:

[0084] ;

[0085] Prepare the generation of the chaotic sequence according to the initial value of the generated chaotic system and the system parameters of the chaotic system.

[0086] S2: Using the system parameters of the generated chaotic system, perform DNA encoding on the plaintext image P to obtain the DNA-encoded data of the plaintext image P, and expand it into a three-dimensional DNA cube P2.

[0087] Furthermore, using the initial value of the generated chaotic system and the system parameters of the chaotic system, input the generated chaotic sequence into 2D-CMODT and iterate M × N + 1000 times, where M and N are the number of rows and columns of the plaintext image P respectively, and discard the first 1000 data to improve randomness, obtaining two subsequences X and Y.

[0088] Among them, 2D-CMODT includes:

[0089] Adopt the division-type construction method to generate chaotic behavior, and the calculation formula for constructing the division-type mapping is as follows:

[0090] ;

[0091] Among them, x is the independent variable input, represents the output, and the function , and μ is the system control parameter for generating chaos;

[0092] By means of the exponential function , the above formula solves the problem of limited value range of the denominator parameter μ; since the value range after squaring is converted from [-1, 1] to [0, 1], combined with , then the output of is mapped into the interval [0, 1]. For an m-dimensional discrete chaotic system, let its equation be:

[0093] ;

[0094] Among them (1 ≤ i ≤ m) is the corresponding rule of the m-dimensional discrete chaotic system, is the i-th variable of the m-dimensional system;

[0095] Combining the above two formulas (that is, the calculation formula for constructing the division-type mapping and the equation of the m-dimensional discrete chaotic system), and extending it to the m-dimensional square, the calculation formula is as follows:

[0096] ;

[0097] It should be noted that the above formula is the general equation for constructing a new chaotic mapping. Considering the physical realizability and iterative efficiency of the above formula in Verilog language, the present invention selects m = 2, uses the Chebyshev mapping as the numerator part, and constructs a division-type two-dimensional discrete chaotic system based on the Chebyshev mapping (Two-dimensional Chebyshev map of division type, 2D-CMODT):

[0098] ;

[0099] Among them, k and μ are control parameters, is the output, > 0, ≥ 0; This mapping is based on the division-type construction method of the Chebyshev mapping, and generates chaotic behavior by dividing two functions, ensuring good randomness of the chaotic sequence and a wide range of applications.

[0100] Calculate the coding matrix S with size M × N using the subsequences X and Y encode , S encode ∈ [0, 32], and use S encodeDynamically encode the plaintext image P. Each time after encoding, the planar data is extended to three dimensions once. After traversal, the extended three-dimensional DNA cube P2 is obtained. The calculation formula is as follows:

[0101] ;

[0102] Figure 3 is the encoding schematic diagram;

[0103] Calculate the number of data loops existing in a matrix of size M×N, and calculate the number of data loops under three sizes of M×N, M×4, and N×4 respectively, to prepare for subsequent scrambling operations. The calculation formula is as follows:

[0104] ,

[0105] ;

[0106] Among them, is the total number of data loops existing in the M×N matrix, min is the minimum value function, , , are the numbers of data loops of the corresponding size matrices respectively;

[0107] Iterate out the corresponding step sequences S xoy , S xoz , S yoz , respectively, which are used to guide the scrambling operations of the three-dimensional DNA cube P2 in different directions. The calculation formula is as follows:

[0108] .

[0109] S3: Perform scrambling operations on the three-dimensional DNA cube P2 in different directions, and perform local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate the DNA cube P5 after local base mutations.

[0110] Furthermore, convert the subsequences X and Y into three different binary sequences D xoy , D xoz , D yoz , whose values only contain 0 or 1. When D xoy takes 0, perform a counterclockwise shift, otherwise perform a clockwise shift, and the same applies to other situations; specifically, taking Sxoy (3)=5, D xoy (3)=0 as an example, it means to perform a counterclockwise shift with a step size of 5 on the third layer loop of the DNA cube in the xOy plane.

[0111] Furthermore, according to the generated step sequences S xoy , S xoz , Syoz Perform cyclic shift operations on the three-dimensional DNA cube P2 in the three planes of xOy, xOz, and yOz, and after traversal, obtain the scrambled three-dimensional DNA cube P3.

[0112] Furthermore, unfold the scrambled three-dimensional DNA cube P3 with dimensions M×N×4 in the positive y-axis, positive x-axis, and positive z-axis orders to obtain four DNA single strands P 3.1 、P 3.2 、P 3.3 、P 3.4 ,and synthesize these four DNA single strands into a single DNA long strand P4, with the size of the DNA long strand P4 being 1×4MN.

[0113] Randomly define the number of mutation points L (L < 4MN), and generate the index S for marking mutations through the following formula mu:

[0114] ;

[0115] where S mu has a length of 1×L, and 0 ≤ S mu ≤ 4MN;

[0116] According to the mutation rule, for any point i on the DNA strand, if P4(i) = A / T / C / G, then it is mutated to mu[P4(i)] = T / A / G / C respectively, where mu is the defined mutation function, and A, T, C, and G represent the four DNA bases of adenine, thymine, cytosine, and guanine respectively. The mutation formula for the synthesized DNA long strand P4 is:

[0117] ;

[0118] where represents the base at the mutation index position of the DNA long strand P4;

[0119] After traversal, update it to the mutated DNA single strand P5.

[0120] S4: Decode the three-dimensional DNA cube P5 with locally mutated bases back to the two-dimensional matrix P7, and perform diffusion processing through the action of the chaotic matrix to generate the ciphertext image C.

[0121] Furthermore, refold the mutated DNA single strand P5 in the negative z-axis, negative x-axis, and negative y-axis orders to restore it to four DNA single strands P 5.1 、P 5.2 、P 5.3 、P 5.4 ;

[0122] Recombine four single-stranded DNAs P 5.1 、P 5.2 、P 5.3 、P 5.4 into a three-dimensional DNA cube P6. The size of P6 is M×N×4, where M and N are the number of rows and columns of the plaintext image P, respectively;

[0123] Generate a decoding matrix S decode ,

[0124] ,

[0125] S decode ∈[0, 32]. Determine the decoding rules for different positions according to different values of S decode (a, b). After traversal, convert P6 into a two-dimensional matrix P7 with the size of M×N.

[0126] Generate a chaotic matrix and apply it to the diffusion process of P7. The calculation formula is as follows:

[0127] ,

[0128] Perform secondary diffusion. The secondary diffusion calculation formula is as follows:

[0129] ,

[0130] where C represents the final ciphertext image. During the diffusion process, the relationship between ciphertext pixels is established by performing an exclusive OR operation on the previous pixel and the chaotic matrix to change the current pixel.

[0131] Furthermore, this embodiment also provides an image decryption method based on improved DNA coding, including:

[0132] Read the ciphertext image C and the key group, and iterate the chaotic system to obtain the chaotic matrix and related sequences used during the encryption process;

[0133] Perform inverse diffusion on the ciphertext C to obtain a two-dimensional matrix P7;

[0134] Perform reverse coding on the two-dimensional matrix P7 to obtain a three-dimensional DNA cube P6;

[0135] Convert the three-dimensional DNA cube P6 into single-stranded DNA, and restore the mutated positions to obtain the scrambled three-dimensional DNA cube P3;

[0136] Perform inverse cyclic shifts in three directions on the scrambled three-dimensional DNA cube P3, and obtain the three-dimensional DNA cube P2 before scrambling after traversal;

[0137] Perform reverse decoding on the three-dimensional DNA cube P2 before scrambling to obtain the plaintext P.

[0138] Furthermore, this embodiment also provides an image encryption system based on improved DNA coding, including:

[0139] A hash chaos initialization module, a DNA coding extension module, a scrambling mutation processing module, and a decoding diffusion encryption module;

[0140] The hash chaos initialization module is used to input a plaintext image into the SHA-256 hash function to generate a hash value of the plaintext image, and combine external parameters to generate an initial value of the chaos system and system parameters of the chaos system;

[0141] The DNA coding extension module is used to perform DNA coding on the plaintext image by using the system parameters of the chaos system to obtain DNA coding data of the plaintext image, and expand it into a three-dimensional DNA cube;

[0142] The scrambling mutation processing module is used to perform scrambling operations on the three-dimensional DNA cube in different directions, and perform local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube after local base mutations;

[0143] The decoding diffusion encryption module is used to decode the three-dimensional DNA cube after local base mutations back into a two-dimensional matrix, and perform diffusion processing through a chaos matrix to generate a ciphertext image.

[0144] This embodiment also provides a computer device, which can be a terminal, and its internal structure diagram can be as shown in Figure 2 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a carrier network, NFC (near field communication), or other technologies. The computer program, when executed by the processor, implements an image encryption method based on improved DNA coding. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0145] This embodiment also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0146] Input the plaintext image into the SHA-256 hash function to generate the hash value of the plaintext image, and combine external parameters to generate the initial value of the chaotic system and the system parameters of the chaotic system;

[0147] Utilize the system parameters of the chaotic system to perform DNA encoding on the plaintext image to obtain the DNA-encoded data of the plaintext image, and expand it into a three-dimensional DNA cube;

[0148] Perform scrambling operations on the three-dimensional DNA cube in different directions, and perform local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube after local base mutations;

[0149] Decode the three-dimensional DNA cube after local base mutations back to a two-dimensional matrix, and perform diffusion processing through a chaotic matrix to generate a ciphertext image.

[0150] Example 2, refer to Figures 1 to 15 , which is the second embodiment of the present invention. This embodiment provides an image encryption method based on improved DNA encoding. In order to verify the beneficial effects of the present invention, scientific demonstrations are carried out through economic benefit calculations and simulation experiments.

[0151] First, generate a unique hash value for the sample image named "031014.tiff" through the SHA-256 hash function, and combine external parameters to generate the initial value and parameters of the chaotic system for generating the chaotic sequence required for encryption. Then, convert the pixel values of the image into a DNA-encoded sequence and expand it into a three-dimensional DNA cube. Utilize the chaotic sequence to perform scrambling on the three-dimensional DNA cube in different directions to ensure that the pixel distribution in the space of the image is more random. Subsequently, perform local base mutations on the scrambled DNA sequence to further enhance the complexity of encryption. Finally, decode the mutated DNA cube back to pixel values, and increase the correlation between pixels through diffusion operations to obtain the encrypted image named "031014encrypted.tiff".

[0152] During decryption, read the ciphertext image "031014encrypted.tiff" and the parameters during encryption, and perform inverse diffusion on the ciphertext using the same chaotic sequence to restore it to the state before diffusion. Then, reverse-convert the image data back to the DNA cube and layer by layer expand it into the original DNA sequence. Next, according to the reverse steps of the scrambling operation, perform inverse scrambling on the DNA cube and gradually restore it to the initial DNA sequence structure according to the reverse rules of mutation. Finally, decode the restored DNA data to obtain the decrypted image again, named "031014.tiff".

[0153] Four nucleic acid bases make up the DNA sequence, namely adenine (A), cytosine (C), guanine (G), and thymine (T). According to the Watson-Crick base pairing rule, A-T and C-G are complementary base pairs, corresponding to the two-bit binary numbers 00, 01, 10, and 11 respectively. Table 1 shows 8 DNA coding rules that satisfy the complementary rule. Taking pixel 220 as an example, its binary representation is 11-01-11-00. According to rule 7 in Table 1, the coding result is ACAT. Decoding using rule 4 gives 01-11-01-10, which is converted to decimal as 118. It can be seen that DNA coding and decoding operations can effectively change pixel values.

[0154] Table 1 DNA Coding Rules

[0155] ,

[0156] In the traditional DNA coding table, the coding method is to encode 2-bit data into 1 corresponding base. In this way, there are a total of 4×3×2×1 = 24 coding rules. However, due to the constraint of the Watson-Crick rule, only 8 coding rules finally meet the requirements, and the diversity of coding rules urgently needs to be enriched. To increase the coding diversity, single coding is performed with 4 bits, and the coding result is 1 pair of bases, while following the complementary pairing rule. Given the huge number of improved coding rules, for the convenience of programming implementation, the present invention only selects 32 rules, as shown in Table 2 - Table 4.

[0157] Table 2 DNA Coding Rules (Rules 1 - 12)

[0158] ,

[0159] Table 3 DNA Coding Rules (Rules 13 - 24)

[0160] ,

[0161] Table 4 DNA Coding Rules (Rules 25 - 32)

[0162] ,

[0163] In Tables 2 - 4, the complementary pairs of A - T and C - G are extended to 8 complementary ways such as AA - TT, AT - TA, AC - TG, etc., and the number of complementary ways is quadrupled. Taking Date1 = 00 - 00 - 00 - 00 as an example, Date1 has 4 different coding results in Table 1: AAAA, TTTT, CCCC, GGGG, while in Tables 2 - 4, it can be represented as 16 different coding results. Since Date1 is an extreme case, let Date2 = 11 - 10 - 01 - 00. Date2 has 8 different coding results in Table 1, and 32 in Tables 2 - 4. Therefore, for any 8 - bit binary data, the range of different coding results in the traditional DNA coding table is [4, 8], and after improvement, it is [16, 32], greatly increasing the diversity of base combination methods. In addition, to evaluate the coding efficiency, an image with a size of 256×256 is used for testing on the Matlab2017a platform, and the results are shown in Table 5.

[0164] Table 5 Comparison table of the time taken for DNA coding and decoding before and after improvement

[0165]

[0166] From the comparison results in Table 5, the time taken for coding before improvement is about 2.615 s, and the time taken for decoding is about 2.220 s. Compared with the coding time of 4.906 s and decoding time of 4.217 s after improvement, it increases by about 2 s. Under the condition that the complementary method is quadrupled, the encryption efficiency is slightly sacrificed, and it can be considered for use in occasions with high security requirements.

[0167] Example 3, referring to Figures 9 to 15 This is the third embodiment of the present invention. This embodiment provides an image encryption method based on improved DNA coding. To verify the beneficial effects of the present invention, scientific demonstrations are carried out through economic benefit calculations and simulation experiments.

[0168] Figures 9 to 12 The bifurcation diagrams (a) - (d) show the chaotic sequence as a function of the control parameter. When the system parameter changes to a certain value, the system suddenly changes from regular to irregular and enters the chaotic state. Set the initial values as x0 = 0.2, y0 = 0.3. Figures 9 to 12 The bifurcation diagrams of different parameters of 2D - CMODT are given. Fix μ = 10, it can be observed that when k ∈ [1, 10], the system evolves from periodic to chaotic; fix k = 10, when μ ∈ [0, 1], the system alternately exhibits bifurcation and periodic behavior. As μ increases, the system has stable chaotic behavior in the interval μ ∈ [1, 10], without obvious periodic windows, and has excellent chaotic characteristics.

[0169] The Lyapunov Exponent (LE) is often used to evaluate the chaotic characteristics of a dynamic system, which defines the separation rate of adjacent orbits in a non-linear dynamic system. Set the initial values as x0 = 0.2 and y0 = 0.3. Figure 13 and Figure 14 show the variation of the LE values of 2D-CMODT. When the fixed parameter μ = 10, LE1 and LE2 are less than zero within k ∈ [0, 1], and the system is in a stable state at this time. However, as k increases, LE1 and LE2 increase steadily and are both greater than zero. When the fixed parameter k = 10, the system is in a chaotic state and there is no periodic window when μ ∈ [1, 3] ∪ [3.05, 10]. Therefore, 2D-CMODT has a relatively wide chaotic range, which can provide a large key space for encryption.

[0170] Sample Entropy (SE) measures the complexity of the sequence generated by a dynamic system by measuring the probability of generating new subsequences in the sequence. The lower the value of the sample entropy, the higher the self-similarity of the sequence generated by the dynamic system, and the more regular the dynamic system is. The larger the value of the sample entropy, the more complex the sequence, and the more chaotic the dynamic system is. From Figure 15 it can be seen that the SE limit value of 2D-CMODT is 2, indicating that the generated sequence has a high degree of complexity.

[0171] Table 6 NIST Test

[0172] ,

[0173] All indicators of 2D-CMODT in the NIST test exceed 0.01, indicating that the chaotic system passes the test and can generate sufficiently random sequences.

[0174] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

[0175] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages. For example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript can be used.

[0176] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0177] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0178] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0179] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.

[0180] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims

1. An image encryption method based on improved DNA coding, characterized in that, Including: Input the plaintext image into the SHA-256 hash function to generate the hash value of the plaintext image, and combine external parameters to generate the initial value of the chaotic system and the system parameters of the chaotic system; Use the system parameters of the chaotic system to perform DNA encoding on the plaintext image to obtain the DNA encoding data of the plaintext image, and expand it into a three-dimensional DNA cube; Perform scrambling operations on the three-dimensional DNA cube in different directions, and perform local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube after local base mutations; Decode the three-dimensional DNA cube after local base mutations back to a two-dimensional matrix, and perform diffusion processing through a chaotic matrix to generate a ciphertext image; The generation of the initial value of the chaotic system and the system parameters of the chaotic system includes Input the plaintext image P into the SHA-256 hash function to generate a 256-bit hash value, and divide the hash value into 32 blocks in sequence, expressed as: ; Among them, is a 256-bit hash value, and each block is composed of 8 bits, corresponding to the decimal numbers between 0 and 255, where k = 1, 2,..., 32; The calculation formula for generating the system parameters of the chaotic system is as follows: ; Among them, , , , are system parameter variables, represents the exclusive OR operation; and an intermediate variable ' is introduced into the system, and the calculation formula of the intermediate variable is as follows: ; Among them, , , , are given external parameters, then the calculation formula for the initial value ( , ) and the system parameters ( , ) is as follows: ; Prepare chaotic sequence generation according to the generated initial value of the chaotic system and the system parameters of the chaotic system; The expansion into a three-dimensional DNA cube includes Calculate the encoding matrix of size M×N using subsequences X and Y , where ∈[0, 32], and use the encoding matrix to perform dynamic encoding on the plaintext image P. Each time after encoding, the planar data is extended to three dimensions once. After traversal, the extended three-dimensional DNA cube is obtained. The calculation formula is as follows: ; Calculate the number of data rings existing in a matrix with a size of M×N, and calculate the number of data rings under three sizes of M×N, M×4, and N×4 respectively. The calculation formula is as follows: ; ; Among them, is the total number of data loops existing in the M×N matrix, min is the minimum value function, , , are the numbers of data loops of the corresponding size matrices respectively; Iterate the corresponding step sequences S xoy 、S xoz 、S yoz respectively, which are used to guide the scrambling operations of the three-dimensional DNA cube in different directions. The calculation formula is as follows: ; The local base mutation includes Unfold the scrambled three-dimensional DNA cube with a size of M×N×4 in the order of the positive y-axis, positive x-axis, and positive z-axis to obtain four DNA single strands, and synthesize the four DNA single strands to obtain a DNA long strand. The size of the DNA long strand is 1×4MN; Randomly define the number of mutation points L, where L < 4MN, and generate an index for marking mutations. The calculation formula is as follows: ; Among them, S mu is the index for marking mutations, with a length of 1×L, and 0 ≤ S mu ≤ 4MN; According to the mutation rule, for any point i on the DNA strand, if P4(i) = A / T / C / G, then it is mutated to mu[P4(i)] = T / A / G / C respectively. The calculation formula for DNA single strand mutation is as follows: ; Among them, P4 is the synthesized long DNA chain, and mu is the defined mutation function; A, T, C, and G respectively represent the four DNA bases of adenine, thymine, cytosine, and guanine; Indicates the base of the long DNA chain P4 at the mutation index position; After traversing, update it to the mutated DNA single strand.

2. The image encryption method based on improved DNA coding according to claim 1, characterized in that: The DNA encoding of the plaintext image includes Use the generated initial value of the chaotic system and the system parameters of the chaotic system, input the generated chaotic sequence into 2D-CMODT and iterate M×N + 1000 times, where M and N are the number of rows and columns of the plaintext image respectively, and discard the first 1000 data to obtain two subsequences X and Y.

3. The image encryption method based on improved DNA coding according to claim 2, wherein: The scrambling operation on the three-dimensional DNA cube in different directions includes According to the step sequence S xoy , S xoz , S yoz , perform cyclic shift operations on the three-dimensional DNA cube in the three planes of xOy, xOz, and yOz, and after traversal, obtain the scrambled three-dimensional DNA cube.

4. The image encryption method based on improved DNA coding according to claim 3, wherein: Refold the mutated DNA single strand in the order of the negative z-axis, negative x-axis, and negative y-axis to restore it to four DNA single strands; Recombine the four DNA single strands into a three-dimensional DNA cube to obtain a synthesized three-dimensional DNA cube. The size of the synthesized three-dimensional DNA cube is M×N×4; Generate the decoding matrix S decode , ; Among them, floor is the floor function; reshape is the matrix reshaping function, which is used to rearrange a one-dimensional sequence into a matrix form of M×N; S decode (a, b) in which a and b respectively represent the row index and column index in the matrix, and are used to specify the decoding rules at different positions; the decoding matrix S decode ∈[0, 32], and according to S decode (a, b) with different values, determine the decoding rules at different positions. After traversal, the synthesized three-dimensional DNA cube is converted into a two-dimensional matrix, and the size of the two-dimensional matrix is M×N; Generate a chaotic matrix and apply it to the diffusion process of the two-dimensional matrix. The calculation formula is as follows: ; Among them, is a chaotic matrix; Perform secondary diffusion. The calculation formula for secondary diffusion is as follows: ; Among them, C is the final encrypted image, which is a two-dimensional matrix.

5. An image encryption system based on improved DNA coding, based on the image encryption method based on improved DNA coding according to any one of claims 1 to 4, characterized in that: It includes a hash chaos initialization module, a DNA encoding extension module, a scrambling mutation processing module, and a decoding diffusion encryption module; The hash chaos initialization module is used to input a plaintext image into the SHA-256 hash function to generate a hash value of the plaintext image, and generate an initial value of the chaos system and system parameters of the chaos system in combination with external parameters; The DNA encoding extension module is used to perform DNA encoding on the plaintext image by using the system parameters of the chaos system to obtain DNA encoded data of the plaintext image, and expand it into a three-dimensional DNA cube; The scrambling mutation processing module is used to perform scrambling operations on the three-dimensional DNA cube in different directions, and perform local base mutations on the DNA sequence of the scrambled three-dimensional DNA cube to generate a three-dimensional DNA cube with local base mutations; The decoding diffusion encryption module is used to decode the three-dimensional DNA cube with local base mutations back into a two-dimensional matrix, and perform diffusion processing through a chaos matrix to generate a ciphertext image.

6. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the image encryption method based on improved DNA encoding according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the image encryption method based on improved DNA encoding according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Chaos image encryption method based on dual scrambling and DNA coding

    CN108898025A

  • An image encryption method based on Duffing mapping and genetic operation

    CN109376540A