Image encryption method and system based on chaotic system and DNA coding

By using hyperchaotic system and DNA encoding methods in image encryption, pseudo-random binary sequences and bit-level chaos are generated, the complexity and security of the existing chaotic encryption scheme are solved, and efficient image encryption is achieved and protection.

CN119071404APending Publication Date: 2024-12-03SHENZHEN INSTITUTE OF INFORMATION TECHNOLOGY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411346917.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing image encryption scheme based on chaotic systems is insufficient in terms of complexity and security, and is vulnerable to attacks, and traditional encryption methods are not suitable for real-time image encryption.

Method used

Using an image encryption method based on hyperchaotic system and DNA encoding, the image is set at bit plane and bit level by normalizing the hyperchaotic sequence into four sets of two-dimensional sequences. The correlation of the image is further destroyed through DNA encoding and addition operations, and bidirectional diffusion is performed to generate the final encrypted image.

Benefits of technology

It improves the security and complexity of image encryption, enhances the protection of image privacy information, takes into account the execution efficiency of algorithms, and can effectively resist attacks and reduce image correlation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071404A_ABST
    Figure CN119071404A_ABST
Patent Text Reader

Abstract

The invention discloses a bit-level image encryption method and system based on a chaotic system and DNA coding. The encryption method comprises the following steps: normalizing a hyperchaotic sequence into four groups of two-dimensional sequences; dividing each group of two-dimensional sequences into a plurality of clusters by adopting a K-means clustering method, after clustering, respectively calculating x-direction and y-direction differences of each point of each group, and binarizing the x-direction and y-direction differences to generate a pseudo-random binary sequence for subsequent image encryption; carrying out additional scrambling based on a bit plane and a bit level on the scrambled image by using a pseudo-random binary sequence; dNA coding is applied to an encrypted image and a pseudo-random binary sequence, and a coding rule of each sequence is generated by a chaotic sequence; performing DNA addition operation on the ciphertext sequence subjected to DNA coding and the pseudo-random binary sequence, and decoding by using a DNA rule obtained by the pseudo-random binary sequence; and performing bidirectional diffusion to generate a final encrypted image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image encryption, and more specifically, to an image encryption method and system based on a chaotic system and DNA coding. Background Art

[0002] Digital images play a vital role in many aspects of work and daily life, serving as both a carrier of data and a means of sharing information. However, it is important to note that these digital images often contain sensitive and private information, such as facial features and fingerprints.

[0003] Due to the large amount of image data and strong pixel correlation, most traditional encryption methods such as DES and IDEA are not suitable for real-time image encryption. Since chaotic systems are sensitive to initial values, unpredictable and irreducible, the generated chaotic sequences are widely used in image encryption. Since Matthews first proposed an effective chaotic encryption algorithm in 1989, research on chaos-based image encryption has been proposed. In 2005, Guan Zhihong et al. proposed an image encryption method that uses Arnold cat map to change the position and Chen's chaotic system to change the grayscale value of image pixels. In 2016, Hua Zhongyun et al. proposed a two-dimensional logical adjusted sinusoidal map (2D-LASM) and designed an image encryption scheme (LAS-IES) based on it. In 2009, Liu Shubo et al. proposed a key stream generator based on coupled chaotic logic mapping, in which one chaotic system generates random numbers to update the parameters of another chaotic system. Ye Guodong proposed an image scrambling encryption algorithm based on chaotic mapping in 2010, focusing on pixel position disorder. In 2018, Wu Jiahui proposed an image encryption scheme based on two-dimensional Henriksine mapping and DNA coding method. In 2023, Yu Wanbo et al. constructed a three-dimensional triangular composite chaotic system with an iteration number t, and constructed an image encryption scheme based on the chaotic sequence generated by the system.

[0004] As early as 1989, Matthews proposed to introduce chaos theory into image encryption system and found that chaos-based image encryption scheme has high security. Since then, chaos-based image encryption has been widely used and developed in many image encryption algorithms. In 2000, Yan and Guo proposed an image encryption and decryption algorithm based on chaotic key and designed the large-scale integrated circuit structure of the algorithm. In 2006, Xiang et al. proposed an encryption algorithm that generates random binary sequences by real-valued chaotic mapping, arranges plaintext blocks by key-dependent shift method, and then encrypts plaintext blocks by classical chaotic masking technology.

[0005] In 2011, Zhang and Liu proposed an image encryption method based on oblique tent chaotic mapping and permutation diffusion structure. In 2018, Hua et al. proposed a medical image encryption algorithm based on high-speed scrambling and pixel adaptive diffusion. In 2022, Wang and Zhang proposed a new image encryption algorithm based on deep neural network.

[0006] With the continuous advancement of image encryption technology, cryptanalysis has also become more and more perfect, which undoubtedly brings greater challenges to the protection of image information. However, an article published by Feng Wei et al. in 2019 in "IEEE Access" believes that the encryption algorithm based on two-dimensional logical adjusted sine map (2D-LASM) proposed by Hua Zhongyun et al. in 2016 is not secure enough, and proposed a method to break it. Chen et al. pointed out in "Information Sciences" in 2020 that the image encryption scheme based on two-dimensional Henry sine mapping and DNA coding method proposed by Wu Jiahui in 2018 is not as secure as claimed.

[0007] Through these cryptanalysis documents, we can find that chaos-based image encryption schemes are vulnerable to attacks if the chaotic system used is not complex enough or the algorithm design is too simple. Summary of the invention

[0008] In order to overcome the shortcomings of the above chaotic encryption scheme, the present invention firstly proposes an image encryption method based on chaotic system and DNA coding.

[0009] The invention also proposes an image encryption system based on a chaotic system and DNA coding.

[0010] In order to achieve the above object, the technical solution of the present invention is:

[0011] A bit-level image encryption method based on the chaotic system and DNA coding in this paper is implemented as follows:

[0012] (i) Normalize the hyperchaotic sequence into four groups of two-dimensional sequences; use the K-means clustering method to divide each group of two-dimensional sequences into multiple clusters. After clustering, calculate the x and y direction differences of each point in each group, and binarize the x and y direction differences to generate a pseudo-random binary sequence for subsequent image encryption;

[0013] (ii) using a pseudo-random binary sequence to perform additional scrambling on the scrambled image based on the bit plane and bit level to further destroy the correlation of the image;

[0014] (iii) DNA coding is applied independently to encrypted images and pseudo-random binary sequences, and the coding rules of each sequence are generated by chaotic sequences; DNA addition operations are performed on the DNA-encoded ciphertext sequences and pseudo-random binary sequences, and then the DNA rules obtained from the pseudo-random binary sequences are used for decoding;

[0015] (iv) Perform bidirectional diffusion to generate the final encrypted image.

[0016] Preferably, (101) the process of normalizing the hyperchaotic sequence into four groups of two-dimensional sequences is:

[0017] The known hyperchaotic systems are:

[0018]

[0019] Among them, x, y, z, h are the dependent variables with respect to time t, is the derivative of the strain variable with respect to time t; when the parameters a=36,b=3,c=28,d=16,-0.7≤r≤0.7, the system (1) enters a chaotic state; given the initial value (r,x 0 ,y 0 , z 0 ,h 0 )=(0.2, 1, 0.1, 1.3, 4), and use the Runge-Kutta algorithm to solve equation (1), discarding the initial partial values ​​respectively, and obtain four chaotic sequences X′={x′ 1 , …, x′ L},Y′={y′ 1 ,…,y′ L}, Z′={z′ 1 ,…,z′ L}, H′={h′ 1 ,…,h′ L};

[0020] (102) The K-means clustering method is used to divide each group of two-dimensional sequences into multiple clusters. After clustering, the x- and y-direction differences of each point in each group are calculated respectively, and the x- and y-direction differences are binarized to generate a pseudo-random binary sequence for subsequent image encryption:

[0021] According to formula (2), the chaotic sequence is transformed into a 4-integer sequence X={x 1 , …, x L},Y={y 1 , …, y L}, Z = {z 1 , …, z L}, H = {h 1 ,…,h L};

[0022] x i =mod(round(x′ i ×10000), 256) (2)

[0023] A pseudo-random binary sequence B is generated using hyperchaotic sequence and K-means.

[0024] Preferably, the above step (102) process is:

[0025] 1) For a two-dimensional sequence [X, Y], select the maximum value X of sequence X max and minimum value X min ; Let T be a positive integer, and pass step t x =(X max -X min ) / T divides the sequence X into T equal parts; each equidistant point is expressed by formula (3):

[0026] p i =X min +i*t x , i=0,1,2…,T (3)

[0027] Similarly, divide Y into T equal parts, where t y =(Y max -Y min ) / T, each equidistant point is expressed by formula (4):

[0028] q j =Y min +j*t y ,j=0,1,2,...,T (4)

[0029] make:

[0030]

[0031] 2) Set X and Y to two dimensions to form a two-dimensional data set R. The i-th data set is expressed as follows:

[0032] R i =[x i ,y i ] (6)

[0033] 3) Initialize i and S by the following formula j :

[0034]

[0035] 4) Iterate i and let u i is the initial center of the i-th k-means cluster, and R is calculated using formula (8)i The kth cluster of k =s k U{R i Updates k ;

[0036]

[0037] 5) Calculate the average value of each dimension in each cluster using formula (9) to obtain the new center position

[0038]

[0039] Use u′ as the new cluster center and repeat steps 3) to 5) until |u′ j -u j |≤10 -4 ;

[0040] 6) After K-means clustering, calculate the distance between the elements in each cluster and the cluster center; for cluster s j , R k =[x k ,y k ], and the distance difference to the cluster center is [x k -u′ j1 ,y k -u′ j2 ]; cluster s 1 ,…,s T After all elements in are arranged in cluster order, the calculated distance difference generates a new sequence H, which can be described as

[0041]

[0042] Where i = 1, 2, ..., L, j is the cluster number to which it belongs;

[0043] 7) h is calculated by the following formula i1 ,h i2 Binarization:

[0044]

[0045] where i = 1, 2, ..., L; j = 1, 2

[0046] 8) Let b1 = {b1 1 , ..., b1 i , ..., b1 L}, where b1 i =[h′ i1 , h′ i2 ], i = 1, 2, ..., L;

[0047] 9) Similarly, for [Y, Z], [Z, H], [H, X], repeat steps 1) to 7) to generate b2, b3 and b4;

[0048] Finally, b1, b2, b3, and b4 are combined into a pseudo-random binary sequence B (B 1 , …, B 8L );

[0049]

[0050] The generated pseudo-random binary sequence B passed the NIST test.

[0051] Preferably, the pseudo-random binary sequence B is used for subsequent image encryption, and the entire image encryption process is:

[0052] 1. I represents a plaintext image of size M×N. The hash value of image I is obtained by the SHA256 algorithm. The hash value is represented as 256 bits and converted into 32 decimal values, named as follows: h = {h 1 ,h 2 ,…,h 32}; Use the h sequence to generate the initial value u 0 and v 0 ;

[0053]

[0054] 2. Set (a 1 ,a 2 ,λ 1 ,λ 2 )=(3.1,3.2,0.18,0.14), combined with the generated u 0 and v 0 , using 2DLogistic formula (14), generate chaotic sequence u,v;

[0055]

[0056] Reshape u and v into two matrices U and V of size M×N; sort U and V to obtain two scrambled matrices F and G; use P x and P y Scramble I to obtain a scrambled image I1; this process is described by I1 = F·I·G;

[0057] 3. For the pseudo-random binary sequence B generated by the method in the previous step, eight sequences of length L = M*N are taken in order and recorded as: B1(B 1 ,…,B L ),B2(BL+1 ,…,B 2L ),B3(B 2L+1 ,…,B 3L ),B4(B 3L+1 ,…,B 4L ),B5(B 4L+1 ,…,B 5L ),B6(B 5L+1 ,…,B 6L ),B7(B 6L+1 ,…,B 7L ),B8(B 7L+1 ,…,B 8L );

[0058] 4. Convert B1,…,B8 into 8 decimal matrices of size M×N, and then define them as right Sort each column of , and get 8 scrambled matrices Px 1 ,…,Px 8 ,right Sort each row of , and get 8 scrambled matrices Py 1 ,…,Py 8 ;

[0059] 5. Convert each pixel of the entire image into 8-bit binary, and group the elements of bit8, bit7, bit6, bit5, bit4, bit3, bit2 and bit1 of each pixel into bit planes, resulting in 8 bit planes, marked as P 8 ,P 7 ,P 6 ,P 5 ,P 4 ,P 3 ,P 2 ,P 1 ;Use Px i and Py i To mess up P i The bit plane, the scrambling formula is: P' i =Px i ·P i ·Py i ; Then, 8 bit planes P' 8 ,P' 7 ,P' 6 ,P' 5 ,P' 4 ,P' 3 ,P' 2 ,P' 1The sequence of bits 8, 7, 6, 5, 4, 3, 2 and 1 is converted back to a binary pixel sequence, denoted by P2; the pseudo-random binary sequence B is converted to a decimal sequence, denoted by Then Divide into 8 decimal numbers and rearrange them to form an M*N matrix; O is expressed by formula (15):

[0060]

[0061] For O i,j Sort and generate the scrambled matrix S i,j ; Then use S i,j P2 i,j The 8 bits of the matrix are scrambled to obtain the binary matrix P3; P3 is converted into decimal to obtain the encryption matrix I2 after the second scrambling;

[0062] 6. Next, take bit8 and bit7 of the encryption matrix I2 and replace the matrix The corresponding bit8 and bit7 generate matrix A1; similarly, use bit6 and bit5 of I2 to replace the matrix The corresponding bit6 and bit5 generate matrix A2; bit4 and bit3 of I2 are replaced bit4 and bit3 of I2 to generate matrix A3; finally, use bit2 and bit1 of I2 to replace bit2 and bit1 of A1 to generate matrix A4; then perform XOR operation on matrix A1, A2, A3 and A4 to generate matrix I3, as shown in the following formula:

[0063]

[0064] During decryption, A1', A2', A3', and A4' are calculated by formula (17); bit8 and bit7 of A1' correspond to bit8 and bit7 of I2 before the XOR operation; similarly, the encrypted matrix I2 is restored by bit8 and bit7 of A1', bit6 and bit5 of A2', bit4 and bit3 of A3', and bit2 and bit1 of A4';

[0065]

[0066] 8. A DNA molecule is composed of four different nucleic acid bases: adenine (A), cytosine (C), guanine (G), and thymine (T); these bases form complementary pairs, with A to T and C to G; to represent these bases using binary coding rules, A, C, G, and T are coded as 00, 01, 10, and 11, respectively; there are 8 different coding rules corresponding to biological models,

[0067] At the same time, DNA can be added and subtracted.

[0068] Then, using the two-dimensional logical sequences u and v generated in step 2, and the sequence generated in step 4 Three DNA coding rule matrices are calculated by formula (18) for subsequent DNA encoding and decoding;

[0069]

[0070] For the ciphertext matrix I3 and sequence DNA encoding is performed on the matrix S I3 and S B6 ; In order to ensure the randomness of the encoding process, the DNA encoding rule matrix R1 is used to determine the DNA encoding rule of each element in I3, and the DNA encoding rule matrix R2 is used to determine The DNA encoding rules for each element in; then the matrix S I3 and S R6 Perform DNA addition operation and use DNA decoding rule R3 to decode the resulting sequence; finally, generate encryption matrix C;

[0071] 8. Use formula (19) and formula (20) to perform forward diffusion and backward diffusion on the pixel values ​​of the encrypted matrix C; use the scrambled matrices F and G generated by 2D logistic as diffusion matrices;

[0072] The forward diffusion formula is:

[0073]

[0074] The back diffusion formula is:

[0075]

[0076] The matrices obtained after bidirectional diffusion are denoted as D and E respectively; E is the final encrypted image.

[0077] The present invention also proposes a system for applying the encryption method, comprising the following modules:

[0078] Pseudo-random binary sequence generation module: normalize the hyperchaotic sequence into four groups of two-dimensional sequences; use the K-means clustering method to divide each group of two-dimensional sequences into multiple clusters. After clustering, calculate the x and y direction differences of each point in each group, and binarize the x and y direction differences to generate a pseudo-random binary sequence for subsequent image encryption;

[0079] Image scrambling module: Use pseudo-random binary sequence to perform additional scrambling on the scrambled image based on bit plane and bit level;

[0080] DAN encoding module: DNA encoding is applied to encrypted images and pseudo-random binary sequences. The encoding rules of each sequence are generated by chaotic sequences. DNA addition operations are performed on DNA-encoded ciphertext sequences and pseudo-random binary sequences, and then the DNA rules obtained from pseudo-random binary sequences are used for decoding.

[0081] Image encryption module: performs bidirectional diffusion to generate the final encrypted image.

[0082] Compared with the prior art, the present invention has the following beneficial effects:

[0083] The present invention proposes an image encryption method and system based on hyperchaotic system and DNA coding. It aims to further strengthen the protection of user image privacy information while taking into account the execution efficiency of the algorithm. The main advantages of the present invention are as follows:

[0084] 1) The present invention adopts a four-dimensional chaotic system, and the generated chaotic sequence is more complex than the general chaotic sequence. The hyperchaotic sequence is clustered by two-dimensional k-means to generate a pseudo-random binary sequence with good performance for subsequent image encryption, which provides effective protection for the security of image encryption.

[0085] 2) The scrambled image is additionally scrambled based on the bit plane and bit level using a pseudo-random binary sequence, and the pixels of the image are changed again through DNA coding and addition operations, which further destroys the correlation of the image and makes the encrypted image more secure. BRIEF DESCRIPTION OF THE DRAWINGS

[0086] Figure 1 It is a flowchart of the present invention.

[0087] Figure 2 It is a flow chart of the entire encryption process of the present invention.

[0088] Figure 3 The flowchart of the scrambling process based on bit plane and bit position.

[0089] Figure 4 Schematic diagram of encryption and decryption test results of grayscale images.

[0090] Figure 5 Schematic diagram of encrypted color image and decrypted image.

[0091] Figure 6 Histograms of plaintext and encrypted images of Lena and the photographer.

[0092] Figure 7 Histogram of the plaintext image and encrypted image of the colored pepper image.

[0093] Figure 8 Schematic diagram of the correlation distribution of adjacent pixels in the Lena image.

[0094] Fig. 9 Schematic diagram of an image being decrypted by a slight change in the key. DETAILED DESCRIPTION

[0095] The drawings are only used for illustrative purposes and should not be construed as limiting the present invention. In order to better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged, or reduced, and do not represent the size of the actual product.

[0096] For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the drawings. The technical solution of the present invention is further described below in conjunction with the drawings and embodiments.

[0097] In view of the shortcomings of the chaos-based encryption scheme, the present invention proposes a bit-level image encryption method based on the chaotic system and DNA coding in this paper, and the implementation process is as follows:

[0098] (i) The hyperchaotic sequence is normalized into four groups of two-dimensional sequences; then, each group of two-dimensional sequences is divided into multiple clusters using the K-means clustering method; after clustering, the x and y direction differences of each point in each group are calculated respectively, and the x and y direction differences are binarized to generate a pseudo-random binary sequence for subsequent image encryption.

[0099] (ii) Using a pseudo-random binary sequence to perform additional scrambling on the scrambled image based on the bit plane and bit level to further destroy the correlation of the image.

[0100] (III) DNA coding is applied independently to encrypted images and pseudo-random binary sequences, and the coding rules of each sequence are generated by chaotic sequences. DNA addition operations are performed on the DNA-encoded ciphertext sequences and pseudo-random binary sequences, and then the DNA rules obtained from the pseudo-random binary sequences are used for decoding.

[0101] (iv) Perform bidirectional diffusion to generate the final encrypted image.

[0102] The present invention is to provide a safe and efficient solution for the storage and transmission of digital images, and to provide an important application basis for the field of digital image information security technology. The technical solution of the present invention is as follows:

[0103] (101) Normalize the hyperchaotic sequence into four groups of two-dimensional sequences:

[0104] The known hyperchaotic systems are:

[0105]

[0106] Among them, x, y, z, h are the dependent variables with respect to time t, is the derivative of the strain variable with respect to time t. When the parameters a=36, b=3, c=28, d=16, -0.7≤r≤0.7, the system (1) enters a chaotic state. Given the initial values ​​(r, x 0 ,y 0 ,z 0 ,h 0 )=(0.2,1,0.1,1.3,4), and use the Runge-Kutta algorithm to solve equation (1), discarding the initial part of the value, and obtain four chaotic sequences X'={x′ 1 ,…,x′ L},Y′={y′ 1 ,…,y′ L}, Z′={z′ 1 ,…,z′ L},H′={h′ 1 ,…,h′ L}.

[0107] (102) Each group of two-dimensional sequences is divided into multiple clusters using the K-means clustering method. After clustering, the x and y direction differences of each point in each group are calculated respectively, and the x and y direction differences are binarized to generate a pseudo-random binary sequence for subsequent image encryption:

[0108] According to formula (2), the chaotic sequence is transformed into a 4-integer sequence X={x 1 ,…,x L},Y={y 1 ,…,y L}, Z={z 1 ,…,z L},H={h 1 ,…,h L}.

[0109] x i =mod(round(x' i ×10000),256) (2)

[0110] A pseudo-random binary sequence B is generated using hyperchaotic sequence and K-means.

[0111] The implementation of the above steps (101) and (102) is as follows: Figure 1 As shown, that is:

[0112] 1) For a two-dimensional sequence [X, Y], select the maximum value X of sequence X max and minimum value X min . Let T be a positive integer, and by step t x =(X max -X min ) / T divides the sequence X into T equal parts. Each equidistant point is expressed by formula (3):

[0113] p i =X min +i*t x ,i=0,1,2,…,T (3)

[0114] Similarly, divide Y into T equal parts, where t y =(Y max -Y min ) / T, each equidistant point is expressed by formula (4):

[0115] q j =Y min +j*t y ,j=0,1,2,…,T (4)

[0116] make:

[0117]

[0118] 2) Set X and Y to two dimensions to form a two-dimensional data set R. The i-th data set is expressed as follows:

[0119] R i =[x i ,y i ] (6)

[0120] 3) Initialize i and S by the following formula j :

[0121]

[0122] 4) Iterate i and let u i is the initial center of the i-th k-means cluster, and R is calculated using formula (8) i The kth cluster of k =s k U{R iUpdates k .

[0123]

[0124] 5) Calculate the average value of each dimension in each cluster using formula (9) to obtain the new center position

[0125]

[0126] Use u' as the new cluster center and repeat steps 3) to 5) until |u' j -u j |≤10 -4 .

[0127] 6) After K-means clustering, calculate the distance between the elements in each cluster and the cluster center. j , R k =[x k ,y k ], and the distance difference to the cluster center is [x k -u' j1 ,y k -u' j2 ]. 1 ,…,s T After all elements in are arranged in cluster order, the calculated distance difference generates a new sequence H, which can be described as

[0128]

[0129] Among them, i = 1, 2, ..., L, j is the cluster number to which it belongs.

[0130] 7) h is calculated by the following formula i1 ,h i2 Binarization:

[0131]

[0132] where i = 1, 2, ..., L; j = 1, 2

[0133] 8) Let b1 = {b1 1 ,…,b1 i ,…,b1 L}, where b1 i =[h' i1 ,h' i2 ],i=1,2,…,L.

[0134] 9) Similarly, for [Y,Z], [Z,H], [H,X], repeat steps 1) to 7) to generate b2, b3 and b4.

[0135] Finally, b1, b2, b3, and b4 are combined into a pseudo-random binary sequence B (B 1 ,...,B 8L ).

[0136]

[0137] The generated pseudo-random binary sequence B passed the NIST test.

[0138] The pseudo-random binary sequence B is used for subsequent image encryption. The flowchart of the entire image encryption is as follows Figure 2 As shown:

[0139] 1. I represents a plaintext image of size M×N. In order to improve the sensitivity of the encryption algorithm to ordinary images, the hash value of image I is first obtained by the SHA256 algorithm. The hash value is then represented as 256 bits and converted to 32 decimal values, named as follows: h = {h 1 ,h 2 ,…,h 32}. Use the h sequence to generate the initial value u 0 and v 0 .

[0140]

[0141] 2. Set (a 1 ,a 2 ,θ 1 ,λ 2 )=(3.1,3.2,0.18,0.14), combined with the generated u 0 and v 0 , using 2DLogistic formula (14), generate chaotic sequence u,v.

[0142]

[0143] Reshape u and v into two matrices U and V of size M×N. Sort U and V to get two scrambled matrices F and G. Use P x and P y Scramble I to get the scrambled image I1. This process can be described by I1=F·I·G.

[0144] 3. For the pseudo-random binary sequence B generated by the method in the previous step, eight sequences of length L = M*N are taken in order and recorded as: B1(B 1 ,…,B L ),B2(B L+1 ,…,B 2L ),B3(B 2L+1,…,B 3L ),B4(B 3L+1 ,…,B 4L ),B5(B 4L+1 ,…,B 5L ),B6(B 5L+1 ,…,B 6L ),B7(B 6L+1 ,…,B 7L ),B8(B 7L+1 ,…,B 8L ).

[0145] 4. Convert B1,…,B8 into 8 decimal matrices of size M×N, and then define them as right Sort each column of , and get 8 scrambled matrices Px 1 ,…,Px 8 ,right Sort each row of , and get 8 scrambled matrices Py 1 ,…,Py 8 .

[0146] 5. Convert each pixel of the entire image into 8-bit binary, and group the elements of bit8, bit7, bit6, bit5, bit4, bit3, bit2 and bit1 of each pixel into bit planes, resulting in 8 bit planes, marked as P 8 ,P 7 ,P 6 ,P 5 ,P 4 ,P 3 ,P 2 ,P 1 We use Px i and Py i To mess up P i The bit plane, the scrambling formula is: P' i =Px i ·P i ·Py i Then, the 8 bit planes P' 8 ,p' 7 ,p' 6 ,p' 5 ,P' 4 ,p' 3 ,P' 2 ,p' 1 The pseudo-random binary sequence B is converted back to a binary pixel sequence in the order of bit8, bit7, bit6, bit5, bit4, bit3, bit2 and bit1, denoted by P2. The pseudo-random binary sequence B is converted to a decimal sequence, denoted by Then Divide into 8 decimal numbers and rearrange them to form an M*N matrix. O can be expressed by formula (15):

[0147]

[0148] For O i,j Sort and generate the scrambled matrix S i,j Then use S i,j P2 i,j The 8 bits of the scrambled matrix are scrambled to obtain the binary matrix P3. P3 is converted into decimal to obtain the encryption matrix I2 after the second scrambling. The whole scrambling process is as follows: Figure 3 shown.

[0149] 6. Next, take bit8 and bit7 of the encryption matrix I2 and replace the matrix The corresponding bit8 and bit7 generate matrix A1. Similarly, use bit6 and bit5 of I2 to replace the matrix The corresponding bit6 and bit5 generate matrix A2. Bit4 and bit3 of I2 are replaced Finally, use bit2 and bit1 of I2 to replace Then, matrix A1, A2, A3 and A4 are XORed together to generate matrix I3, as shown in the following formula:

[0150]

[0151] During decryption, A1', A2', A3', and A4' can be calculated by formula (17). Bit8 and bit7 of A1' correspond to bit8 and bit7 of I2 before the XOR operation. Similarly, the encrypted matrix I2 can be restored by bit8 and bit7 of A1', bit6 and bit5 of A2', bit4 and bit3 of A3', and bit2 and bit1 of A4'.

[0152]

[0153] 7. A DNA molecule is composed of four different nucleic acid bases: adenine (A), cytosine (C), guanine (G) and thymine (T). These bases form complementary pairs, with A to T and C to G. In order to represent these bases using binary coding rules, A, C, G and T are encoded as 00, 01, 10 and 11 respectively. There are 8 different coding rules corresponding to biological models, as shown in Table 1.

[0154] Table 1 DNA coding rules

[0155]

[0156] The binary code 00011011 corresponds to pixel 27. According to the DNA coding rules, 27 is converted into a DNA sequence, which can be expressed as ACGT. At the same time, DNA can perform addition and subtraction operations, as shown in Tables 2 and 3.

[0157] Table 2 DNA addition operation

[0158]

[0159] Table 3 DNA subtraction operation

[0160]

[0161] Then, using the two-dimensional logical sequences u and v generated in step 2, and the sequence generated in step 4 Three DNA coding rule matrices are calculated by formula (18) for subsequent DNA encoding and decoding.

[0162]

[0163] For the ciphertext matrix I3 and sequence DNA encoding is performed on the matrix S I3 and S B6 In order to ensure the randomness of the encoding process, the DNA encoding rule matrix R1 is used to determine the DNA encoding rule of each element in I3, and the DNA encoding rule matrix R2 is used to determine The DNA encoding rules for each element in . Then the matrix S I3 and S B6 Perform DNA addition operation and decode the result sequence using DNA decoding rule R3. Finally, generate encryption matrix C.

[0164] 8. In order to further improve security, use formula (19) and formula (20) to perform forward diffusion and backward diffusion on the pixel values ​​of the encrypted matrix C. The scrambled matrices F and G generated by 2D logistic are used as diffusion matrices.

[0165] The forward diffusion formula is:

[0166]

[0167] The back diffusion formula is:

[0168]

[0169] The matrices obtained after bidirectional diffusion are denoted as D and E. E is the final encrypted image.

[0170] Experimental example:

[0171] Set the control parameters and initial values ​​of 2D Logistic (a 1 ,a 2 ,λ 1 ,λ 2 )=(3.1,3.2,0.18,0.14), set 4 as the control parameters and initial values ​​of the hyperchaotic system (r,x 0 ,y 0 ,z 0 ,h 0 )=(0.2,1,0.1,1.3,4), set the control parameters of forward diffusion and backward diffusion (k 1 ,k 2 ,k 3 ,k 4 )=(2,6,3,7). Encrypt and decrypt the grayscale images of Lena, the photographer, all 0s and all 1s. The encrypted and decrypted images are as follows: Figure 4 shown.

[0172] The test results of the color image pepper are as follows Figure 5 As shown. Figure 4 and Figure 5 It can be seen that the encryption algorithm is applicable to both grayscale images and color images.

[0173] 1. Statistical attack analysis experiment

[0174] In order to evaluate the performance of the proposed encryption scheme, some typical statistical analysis methods such as histogram analysis, correlation analysis and information entropy analysis are used in the experiment.

[0175] 1.1. Histogram analysis

[0176] The histogram of an image can reflect the statistical characteristics of the image pixel values. Generally speaking, the histogram pixels of a meaningful image have a steep distribution. Therefore, in order to hide this information, the histogram of the cipher image should be uniform. The histograms of the grayscale images of Lena and the photographer and the encrypted image are shown in Figure 6 The histogram of the colored pepper image is shown in Figure 7 As shown in Figure 2. It is obvious from these histograms that the histogram of the encrypted image is uniformly distributed, which is completely different from the plaintext image.

[0177] 1.2. Correlation analysis

[0178] In a meaningful ordinary image, there is a high correlation between adjacent pixels, which makes statistical analysis attacks possible. Therefore, an ideal encryption algorithm should be able to effectively reduce the correlation between pixels. The following randomly selects 6000 pairs of adjacent pixels from the plaintext image and the encrypted image, and then calculates the correlation coefficient between adjacent pixels in the sequence to perform correlation analysis. For the plaintext image and the encrypted image, Table 4 shows the correlation coefficients in three directions (horizontal, vertical and diagonal directions). Figure 8 It is the correlation distribution diagram of two adjacent pixels in three directions. As can be seen from Table 4, the correlation coefficients of the plaintext image in each direction are close to 1, while the correlation coefficients of the encrypted image in each direction are close to 0. Combined with the correlation distribution diagram, it shows that the encrypted image effectively reduces the pixel correlation.

[0179] Table 4 Correlation coefficients between two adjacent pixels

[0180]

[0181] 1.3. Information Entropy

[0182] Information entropy is one of the important indicators for evaluating encryption security. In an image, information entropy is used to measure the distribution of grayscale values ​​in the image. The higher the information entropy, the more uniform (random) the grayscale distribution is, and the stronger the image's ability to resist statistical attacks is. The ideal information entropy value for a 256-level grayscale image is 8. When the information entropy of a password image is close to 8, it means that the encryption system has sufficient security and can effectively resist attacks. The information entropy formula is as follows:

[0183]

[0184] Among them, p(x i ) is x i Probability of occurrence.

[0185] Table 5 shows the information entropy of the encrypted images of Lena and pepper images. The calculated information entropy is very close to the random ciphertext, which effectively improves the security of the encrypted image.

[0186] Table 5 Encrypted image information entropy

[0187]

[0188] 2. Key analysis experiment

[0189] The key space is the number of all available keys in the encryption algorithm. The larger the key space of the encryption algorithm, the more resistant it is to brute force attacks. In the encryption algorithm given in this embodiment, the key includes the control parameters and initial value (a of 2D Logistic 1 ,a 2 ,λ 1,λ 2 ,u 0 ,v 0 ), the control parameters and initial values ​​of the 4D hyperchaotic system (r, x 0 ,y 0 ,z 0 ,h 0 ), and the control parameter of the diffusion sequence (k 1 ,k 2 ,k 3 ,k 4 ).

[0190] The key space is closely related to the number of keys and the sensitivity of the keys. In order to evaluate the sensitivity of the proposed encryption scheme to the keys, one of the correct keys can be slightly changed while the other keys remain unchanged. 0 =u 0 +10 -15 ,x 0 =1+10 -15 ,r=0.2+10 -15 The test results are as follows Fig. 9 As shown. Fig. 9 The results show that even if the key is slightly perturbed by 10 -15 It is also impossible to correctly decrypt the ciphertext image. This shows that the proposed algorithm is highly sensitive to the key. The test also shows that the sensitivity accuracy is at least 10 -15 . Combined with the key parameters, the key space is approximately (10 15 ) 11 ×(2 8 ) 4 ≈10 174 , the key space is very large and can effectively deal with exhaustive brute force attacks.

[0191] 3. Differential analysis experiment

[0192] Differential attack is an important analytical method to test the sensitivity of an algorithm to plaintext. If the ciphertext image obtained by a slight change in the plaintext image is very different from the ciphertext image obtained by the original plaintext, the algorithm is sensitive to the plaintext. The algorithm can resist differential attacks and has high security. Sensitivity can be evaluated by two parameters: NPCR and UACI. NPCR and UACI represent the number of changed pixels between two encrypted images and the average change intensity between two encrypted images, respectively. The ideal values ​​of NPCR and UACI are 99.61% and 33.46%, respectively. For a grayscale image with 256 grayscales, NPCR and UACI are defined as follows:

[0193]

[0194] Where M, N are the height and width of the image, C is the encrypted image, and C' is the encrypted image corresponding to the image that differs from the plaintext image by only 1 pixel. Table 6 shows the NPCR and UCAI of the proposed encryption algorithm. It can be seen that the NPCR and UACI of the encrypted image are very close to the ideal values ​​and can resist differential attacks and chosen plaintext attacks.

[0195] Table 6 NPCR and UCAI of the proposed encryption algorithm

[0196]

[0197]

[0198] The present invention proposes an image encryption method based on hyperchaotic system and DNA coding. It aims to further strengthen the protection of user image privacy information and take into account the execution efficiency of the algorithm. The main advantages of the present invention are as follows:

[0199] 1) The present invention adopts a four-dimensional chaotic system, and the generated chaotic sequence is more complex than the general chaotic sequence. The hyperchaotic sequence is clustered by two-dimensional k-means to generate a pseudo-random binary sequence with good performance for subsequent image encryption, which provides effective protection for the security of image encryption.

[0200] 2) The scrambled image is additionally scrambled based on the bit plane and bit level using a pseudo-random binary sequence, and the pixels of the image are changed again through DNA coding and addition operations, which further destroys the correlation of the image and makes the encrypted image more secure.

[0201] The experimental test results show that the algorithm proposed in this invention is very sensitive to the key and the key space reaches (10 15 ) 11 ×(2 8 ) 4 ≈10 174 , which makes brute force attack impossible. The differential analysis experiment shows that our proposed algorithm can effectively resist chosen plaintext attack.

[0202] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A bit-level image encryption method based on the chaotic system and DNA coding in this paper, characterized in that: The implementation process is: (i) Normalize the hyperchaotic sequence into four groups of two-dimensional sequences; use the K-means clustering method to divide each group of two-dimensional sequences into multiple clusters. After clustering, calculate the x and y direction differences of each point in each group, and binarize the x and y direction differences to generate a pseudo-random binary sequence for subsequent image encryption; (ii) performing additional scrambling of the scrambled image based on bit plane and bit level using a pseudo-random binary sequence; (iii) Applying DNA coding to encrypted images and pseudo-random binary sequences, the coding rules of each sequence are generated by chaotic sequences; performing DNA addition operations on the DNA-encoded ciphertext sequences and pseudo-random binary sequences, and then decoding them using the DNA rules obtained from the pseudo-random binary sequences; (iv) Perform bidirectional diffusion to generate the final encrypted image.

2. The method according to claim 1, characterized in that: In the step (a): (101) The process of normalizing the hyperchaotic sequence into four groups of two-dimensional sequences is as follows: The known hyperchaotic systems are: Among them, x, y, z, h are the dependent variables with respect to time t, is the derivative of the dependent variable with respect to time t; when the parameters a=36, b=3, c=28, d=16, -0.7≤r≤0.7, the system (1) enters a chaotic state; given the initial values ​​(r, x0, y0, z0, h0)=(0.2, 1, 0.1, 1.3, 4), the Runge-Kutta algorithm is used to solve equation (1), discarding the initial partial values ​​respectively, and four chaotic sequences X'={x′1,…,x′ L },Y={y′1,…,y′ L }, Z = {z1,…,z′ L },H={h1,…,h′ L }; (102) The K-means clustering method is used to divide each group of two-dimensional sequences into multiple clusters. After clustering, the x- and y-direction differences of each point in each group are calculated respectively, and the x- and y-direction differences are binarized to generate a pseudo-random binary sequence for subsequent image encryption: According to formula (2), the chaotic sequence is transformed into a 4-integer sequence X = {x1,…,x L },Y={y1,…,y L },Z={z1,…,z L },H={h1,…,h L }; x i =mod(round(x' i ×10000),256) (2) A pseudo-random binary sequence B is generated using hyperchaotic sequence and K-means.

3. The method according to claim 2, characterized in that The above step (102) process is as follows: 1) For a two-dimensional sequence [X, Y], select the maximum value X of sequence X max and minimum value X min ; Let T be a positive integer, and pass step t x =(X max -X min ) / T divides the sequence X into T equal parts; each equidistant point is expressed by formula (3): p i =X min +i*t x ,i=0,1,2…,T (3) Similarly, divide Y into T equal parts, where t y =(Y max -Y min ) / T, each equidistant point is expressed by formula (4): q j =Y min +j*t y ,j=0,1,2,…,T (4) make: 2) Set X and Y to two dimensions to form a two-dimensional data set R. The i-th data set is expressed as follows: R i =[x i ,y i ] (6) 3) Initialize i and S by the following formula j : 4) Iterate i and let u i is the initial center of the i-th k-means cluster, and R is calculated using formula (8) i The kth cluster of k =s k U{R i Updates k ; 5) Calculate the average value of each dimension in each cluster using formula (9) to obtain the new center position Use u' as the new cluster center and repeat steps 3) to 5) until |u' j -u j |≤10 -4 ; 6) After K-means clustering, calculate the distance between the elements in each cluster and the cluster center; for cluster s j , R k =[x k ,y k ], and the distance difference to the cluster center is [x k -u' j1 ,y k -u' j2 ]; clusters s1,…,s T After all elements in are arranged in cluster order, the calculated distance difference generates a new sequence H, which can be described as Where i = 1, 2, ..., L, j is the cluster number to which it belongs; 7) h is calculated by the following formula i1 ,h i2 Binarization: where i = 1, 2, ..., L; j = 1, 2 8) Let b1={b11,…,b1 i ,…,b1 L }, where b1 i =[h' i1 ,h' i2 ],i=1,2,…,L; 9) Similarly, for [Y,Z], [Z,H], [H,X], repeat steps 1) to 7) to generate b2, b3 and b4; Finally, b1, b2, b3, and b4 are combined into a pseudo-random binary sequence B(B1,...,B 8L ); The generated pseudo-random binary sequence B passed the NIST test.

4. The method according to claim 3, characterized in that The pseudo-random binary sequence B is used for subsequent image encryption. The entire image encryption process is:

1. I represents a plaintext image of size M×N. The hash value of image I is obtained by the SHA256 algorithm. The hash value is represented as 256 bits and converted into 32 decimal values, named as follows: h = {h1, h2, …, h 32 }; Use the h sequence to generate initial values ​​u0 and v0; 2. Set (a1, a2, λ1, λ2) = (3.1, 3.2, 0.18, 0.14), combine the generated u0 and v0, and use the 2DLogistic formula (14) to generate the chaotic sequence u, v; Reshape u and v into two matrices U and V of size M×N; sort U and V to obtain two scrambled matrices F and G; use P x and P y Scramble I to obtain a scrambled image I1; this process is described by I1 = F·I·G; 3. For the pseudo-random binary sequence B generated by the method in the previous step, eight sequences of length L = M*N are taken in order and recorded as: B1(B1,…,B L ),B2(B L+1 ,…,B 2L ),B3(B 2L+1 ,…,B 3L ),B4(B 3L+1 ,…,B 4L ),B5(B 4L+1 ,…,B 5L ),B6(B 5L+1 ,…,B 6L ),B7(B 6L+1 ,…,B 7L ),B8(B 7L+1 ,…,B 8L ); 4. Convert B1,…,B8 into 8 decimal matrices of size M×N, and then define them as right Sort each column of to get 8 scrambled matrices Px1,…,Px8. Sort each row of to obtain 8 scrambled matrices Py1,…,Py8; 5. Convert each pixel of the entire image into 8-bit binary, and group the elements of bit8, bit7, bit6, bit5, bit4, bit3, bit2 and bit1 of each pixel into bit planes, resulting in 8 bit planes, marked as P 8 ,P 7 ,P 6 ,P 5 ,P 4 ,P 3 ,P 2 ,P 1 ;Use Px i and Py i To mess up P i The bit plane, the scrambling formula is: P' i =Px i ·P i ·Py i ; Then, 8 bit planes P' 8 ,P' 7 ,P' 6 ,P' 5 ,P' 4 ,P' 3 ,P' 2 ,P' 1 The sequence of bits 8, 7, 6, 5, 4, 3, 2 and 1 is converted back to a binary pixel sequence, denoted by P2; the pseudo-random binary sequence B is converted to a decimal sequence, denoted by Then Divide into 8 decimal numbers and rearrange them to form an M*N matrix; O is expressed by formula (15): For O i,j Sort and generate the scrambled matrix S i,j ; Then use S i,j P2 i,j The 8 bits of the matrix are scrambled to obtain the binary matrix P3; P3 is converted into decimal to obtain the encryption matrix I2 after the second scrambling; 6. Next, take bit8 and bit7 of the encryption matrix I2 and replace the matrix The corresponding bit8 and bit7 generate matrix A1; similarly, use bit6 and bit5 of I2 to replace the matrix The corresponding bit6 and bit5 generate matrix A2; bit4 and bit3 of I2 are replaced bit4 and bit3 of I2 to generate matrix A3; finally, use bit2 and bit1 of I2 to replace bit2 and bit1 of A1 to generate matrix A4; then perform XOR operation on matrix A1, A2, A3 and A4 to generate matrix I3, as shown in the following formula: During decryption, A1', A2', A3', and A4' are calculated by formula (17); bit8 and bit7 of A1' correspond to bit8 and bit7 of I2 before the XOR operation; similarly, the encrypted matrix I2 is restored by bit8 and bit7 of A1', bit6 and bit5 of A2', bit4 and bit3 of A3', and bit2 and bit1 of A4'; 7. A DNA molecule is composed of four different nucleic acid bases: adenine (A), cytosine (C), guanine (G), and thymine (T); these bases form complementary pairs, with A to T and C to G; to represent these bases using binary coding rules, A, C, G, and T are coded as 00, 01, 10, and 11, respectively; there are 8 different coding rules corresponding to biological models, At the same time, DNA can be added and subtracted. Then, using the two-dimensional logical sequences u and v generated in step 2, and the sequence generated in step 4 Three DNA coding rule matrices are calculated by formula (18) for subsequent DNA encoding and decoding; For the ciphertext matrix I3 and sequence DNA encoding is performed on the matrix S I3 and S B6 ; In order to ensure the randomness of the encoding process, the DNA encoding rule matrix R1 is used to determine the DNA encoding rule of each element in I3, and the DNA encoding rule matrix R2 is used to determine The DNA encoding rules for each element in; then the matrix S I3 and S B6 Perform DNA addition operation and use DNA decoding rule R3 to decode the resulting sequence; finally, generate encryption matrix C; 8. Use formula (19) and formula (20) to perform forward diffusion and backward diffusion on the pixel values ​​of the encrypted matrix C; use the scrambled matrices F and G generated by 2Dlogistic as diffusion matrices; The forward diffusion formula is: The back diffusion formula is: The matrices obtained after bidirectional diffusion are denoted as D and E respectively; E is the final encrypted image.

5. A system using any one of the encryption methods of claims 1 to 4, characterized in that: Includes the following modules: Pseudo-random binary sequence generation module: normalize the hyperchaotic sequence into four groups of two-dimensional sequences; use the K-means clustering method to divide each group of two-dimensional sequences into multiple clusters. After clustering, calculate the x and y direction differences of each point in each group, and binarize the x and y direction differences to generate a pseudo-random binary sequence for subsequent image encryption; Image scrambling module: Use pseudo-random binary sequence to perform additional scrambling on the scrambled image based on bit plane and bit level; DAN encoding module: DNA encoding is applied to encrypted images and pseudo-random binary sequences. The encoding rules of each sequence are generated by chaotic sequences. DNA addition operations are performed on DNA-encoded ciphertext sequences and pseudo-random binary sequences, and then the DNA rules obtained from pseudo-random binary sequences are used for decoding. Image encryption module: performs bidirectional diffusion to generate the final encrypted image.

Citation Information

Cited By

  • Compression and encryption method for double random phase-DNA iterative diffusion coding

    CN119865304A