Color image encryption method based on bidirectional spiral cross transform
By introducing bidirectional helical cross-transformation and three-dimensional extreme multi-steady state chaotic system into the color image encryption method, combining dynamic quadruple DNA coding and table lookup methods, the problems of low encryption efficiency and weak security in the existing technology are solved, and efficient and secure color image encryption is achieved.
Patent Information
- Application Number
- CN202211365468.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-03
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-11-03
AI Technical Summary
The existing color image encryption methods have problems such as low encryption efficiency or weak security, and it is difficult to improve encryption efficiency while ensuring image security.
A color image encryption method based on bidirectional spiral cross-transformation is adopted. By extracting R, G, and B components and scrambling them, combining three-dimensional extreme multi-steady state chaotic system and dynamic quadruple DNA encoding, the DNA calculation results are quickly obtained using the table lookup method to generate a ciphertext image.
This method can not only effectively ensure the security of the image, but also significantly improve the encryption efficiency and realize efficient and secure transmission of color images during transmission and storage.
Smart Images

Figure CN115714639B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an information encryption technology, in particular to a color image encryption method. Background Art
[0002] As one of the important forms of multimedia data, digital images are widely used in people's daily lives. The advent of the 5G era has further promoted the application of images in finance, military, medical care, transportation and other fields. With the development of cloud computing technology, a lot of image information is calculated and stored through cloud platforms. However, transmitting multimedia data through public channels or storing it on public cloud servers poses threats such as illegal theft, interception or unauthorized access. Therefore, it is crucial to ensure the security of images during storage and transmission.
[0003] Images are intuitive, vivid, vivid, informative, highly correlated with adjacent pixels, and highly redundant. To ensure the security of images during transmission and storage, researchers have proposed a variety of image encryption methods. However, current image encryption methods often have problems such as low encryption efficiency or weak security.
[0004] In order to ensure the security of images and improve the encryption efficiency, a color image encryption method based on bidirectional spiral cross transform is proposed. In addition, a three-dimensional extreme multistable chaotic system with a simple mathematical structure is proposed; at the same time, a bidirectional spiral cross transform is proposed to scramble the pixels in the image; finally, a table lookup method is proposed to quickly obtain the result of DNA operation. This image encryption method can not only ensure the security of images, but also improve the encryption efficiency of images. Summary of the invention
[0005] The purpose of the present invention is to solve the problems of low encryption efficiency or weak security in the existing color image encryption methods, and propose a color image encryption method based on bidirectional spiral cross transformation.
[0006] Technical solution of the present invention: To achieve the above-mentioned purpose of the invention, the technical solution adopted is a color image encryption method based on bidirectional spiral cross transformation, and the encryption steps are described in detail as follows:
[0007] Step 1: R 、 G 、 B component extraction and pixel-level scrambling: The color plaintext image is recorded as P , whose size is m × n ×3; Extract color plaintext image P R 、 G 、 B components, each of which is m × n; respectively for R 、 G 、 The B component is scrambled using a bidirectional spiral cross transform, and the scrambled images are recorded as P red , P green and P blue ;
[0008] Step 2: Generate a chaotic sequence: According to the external key x 1, x 2, x 3, x 4, x 5, x 6, e and the hash value of the color plaintext image K = ( k 1, k 2, …, k 32 ), two sets of initial conditions can be calculated ( a 1, b 1, c 1, x 10 , y 10 , z 10 ),( a 2, b 2, c 2, x 20 , y 20 , z 20 ), the calculation method is as follows:
[0009] a 1 = x 1+ mod ( k 1+ k 2, e ) / 10 5 , (1)
[0010] b 1 = x 2+ mod ( k 3+ k 4, a 1) / 10 5 , (2)
[0011] c 1 = x 3+ mod (k 5+ k 6, a 1+ b 1) / 10 5 , (3)
[0012] a 2 = x 1+ mod ( k 25 + k 26 , e ) / 10 5 , (4)
[0013] b 2 = x 2+ mod ( k 27 + k 28 , a 2) / 10 5 , (5)
[0014] c 2 = x 3+ mod ( k 29 + k 30 , a 2+ b 2) / 10 5 , (6)
[0015] x 10 = x 4+ ( k 1⊕ k 6⊕ k 11 ⊕ k 16 ⊕ k 21 ⊕ k 27 ) / 256 / 10 5 , (7)
[0016] y 10 = x 5+ ( k 2⊕ k 7⊕ k 12 ⊕ k 17 ⊕ k 22 ⊕ k28 ) / 256 / 10 5 , (8)
[0017] z 10 = x 6+ ( k 3⊕ k 8⊕ k 13 ⊕ k 18 ⊕ k 23 ⊕ k 29 ) / 256 / 10 5 , (9)
[0018] x 20 = x 4+ ( k 4⊕ k 9⊕ k 14 ⊕ k 19 ⊕ k 24 ⊕ k 30 ) / 256 / 10 5 , (10)
[0019] y 20 = x 5+ ( k 5⊕ k 10 ⊕ k 15 ⊕ k 20 ⊕ k 25 ⊕ k 31 ) / 256 / 10 5 , (11)
[0020] z 20 = x 6+ ( k 6⊕ k 11 ⊕ k 16 ⊕ k 21 ⊕ k 26 ⊕ k 32 ) / 256 / 10 5 , (12)
[0021] Among them, ⊕ is the exclusive OR operator, mod (·) is the modulo operator; the above two sets of initial conditions and the three-dimensional extreme multistable chaotic system can generate six chaotic sequences: X 1, Y 1, Z 1, X 2, Y 2, Z 2. The length of each chaotic sequence is 12 mn ;
[0022] Step 3: Dynamic quaternary DNA coding: Based on chaotic sequence X 1 and equation (13) can calculate the encoding rule vector R enc ,
[0023] R enc = floor (8× X 1( i )) + 1, i = 1, 2, …, 12 mn , (13)
[0024] in, floor (·) is the floor function; P red , P green , P blue Convert them into vectors respectively and merge them one by one to get a vector of size 3 mn Vector P 1; Next, vector P Each decimal pixel value in 1 is converted into the corresponding quaternary form to obtain a vector consisting of quaternary numbers. P 2, whose size is 12 mn ; Use 0 to represent base A, 1 to represent base G, 2 to represent base C, and 3 to represent base T. Then, according to the binary DNA encoding rules, the quaternary DNA encoding rules can be directly obtained as shown in Table 1; According to the encoding rule vector R enc and the quaternary DNA encoding rule, converting the quaternary vector P 2 is encoded into a quaternary DNA sequence P 3, whose size is 12 mn ;
[0025] Table 1 Quaternary DNA encoding rules
[0026]
[0027] Step 4: DNA-level scrambling: chaotic sequence Y 1 to sort in ascending order,
[0028] [ Y sorted , Index ] = sort ( Y 1), (14)
[0029] in, sort (·) is the ascending sorting function, Index is the index sequence, Y sorted for Y 1 Sorted sequence; Quaternary DNA sequence according to the index sequence P 3. Perform scrambling. The scrambling process is as follows:
[0030] P 4 ( i )= P 3( Index ( i )), i = 1, 2, …, 12 mn , (15)
[0031] in, P 4 is the scrambled DNA sequence;
[0032] Step 5: Generate chaotic DNA sequence: Using equation (16), the chaotic sequence can be directly converted to X 2 Converted into chaotic DNA sequence without going through quaternary DNA encoding,
[0033] C DNA = mod (floor( X 2×10 15 ),4); (16)
[0034] Step 6: Dynamic quaternary DNA operation: Based on chaotic sequence Z 1 and equation (17) can calculate the operation rule vector R oper ,
[0035] R oper = floor (4× Z 1( i )) + 1, i = 1, 2, …, 12 mn ; (17)
[0036] according to R oper Perform dynamic DNA operations as follows:
[0037] , (18)
[0038] in, f add (·), f sub (·), f xor (·), f xnor (·) respectively represent the quaternary DNA addition, subtraction, XOR and XOR operation functions; according to the quaternary DNA encoding rule 1, the quaternary DNA addition, subtraction, XOR and XOR operation rules are shown in Table 2-3; in addition, the results of quaternary DNA operations can be quickly obtained by table lookup;
[0039] Table 2 Rules for addition and subtraction of quaternary DNA
[0040]
[0041] Table 3 Rules for XOR and XOR operations in quaternary DNA
[0042]
[0043] Step 7: Dynamic Quaternary DNA Decoding: From Chaotic Sequences Y 2 and equation (19) can calculate the decoding rule vector R dec ,
[0044] R dec = floor (8× X 4( i )) + 1, i = 1, 2, …, 12 mn ; (19)
[0045] According to the decoding rule vector R dec and the quaternary DNA coding rules, P 5 is dynamically decoded into a quaternary vector P 6, whose size is 12 mn ;
[0046] Step 8: Generate ciphertext image: transform the vector P Each group of four quaternary numbers in 6 is converted into the corresponding decimal form, and a vector consisting of decimal numbers can be obtained.P 7, whose size is 3 mn ;Will P 7 is transformed into three m × n Then merge these three images to get an image of size m × n ×3 ciphertext image P 8.
[0047] Furthermore, in step 1, the steps of bidirectional spiral cross transformation are: first, the first scanning process is to start from a size of m × n The matrix P Starting from the first element of the first row, scan the matrix in a clockwise spiral P The left half of the scanned elements are arranged in order into a grid of size ( m × n ) / 2 vector V 1; Secondly, the second scanning process is from the matrix P The first line of m / 2+1 elements, scan the matrix in a counterclockwise spiral P The right half of the scanned elements are arranged in order into a grid of size ( m × n ) / 2 vector V 2; Again, the vector V Every element and vector in 2 V Each element in 1 is arranged in odd and even order to form a new vector V ; Finally, the vector V Transformed to size m × n The matrix P ', P ' is the scrambled matrix.
[0048] Furthermore, in step 5, the mathematical model of the three-dimensional extreme multi-stable chaotic system is:
[0049] , (20)
[0050] in, a , b , c To control the parameters, x , y , z is a state variable.
[0051] Furthermore, in step 6, the table lookup method designed is specifically: the operation rules of quaternary DNA addition, subtraction, XOR and XOR are stored in the corresponding table in advance. ADD_table , SUB_table , XOR_table , XNOR_table Then the table lookup method can be defined as:
[0052] f add ( x , y ) = ADD_table [ x +1, y +1], (21)
[0053] f sub ( x , y ) = SUB_table [ x +1, y +1], (22)
[0054] f xor ( x , y ) = XOR_table [ x +1, y +1], (23)
[0055] f xnor ( x , y ) = XNOR_table [ x +1, y +1], (24)
[0056] in, x and y Each represents one of the four bases.
[0057] In the decryption process, the encrypted image is decrypted using the same chaotic sequence to restore the plaintext image; the decryption process is the inverse process of encryption.
[0058] Beneficial effects: In view of the problems of low encryption efficiency or weak security in current color image encryption methods, the present invention proposes a color image encryption method based on bidirectional spiral crossover transformation. The main contributions are as follows: (1) A three-dimensional extreme multistable chaotic system with a simple mathematical structure is proposed; (2) A scrambling method of bidirectional spiral crossover transformation is proposed; (3) A table lookup method is proposed to quickly obtain the results of DNA operations; (4) Experimental results and method analysis show that the method has good encryption effect, strong security and high efficiency, and can achieve network transmission and storage security of color image content. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 :Flowchart of color image encryption algorithm based on bidirectional spiral cross transform;
[0060] Figure 2 : The principle diagram of using bidirectional spiral cross transformation to scramble a matrix of size 6×6;
[0061] Figure 3 : original image;
[0062] Figure 4 : Encrypted image. DETAILED DESCRIPTION
[0063] The implementation process of the present invention is further described in detail below with reference to specific drawings and examples.
[0064] Figure 1 It is a flowchart of the color image encryption algorithm based on bidirectional spiral cross transform.
[0065] The simulation software used is Matlab R2022a; Figure 3 The color plaintext image with a size of 256×256×3 is used as the experimental object, denoted as P The encryption steps of the present invention are further described below in conjunction with specific embodiments.
[0066] Step 1: R 、 G 、 B component extraction and pixel-level scrambling: Extraction P R 、 G 、 B has three components, each of which is 256×256 in size. Each component is scrambled using a bidirectional spiral cross transform, and the three scrambled components are recorded as: P red , P green and P blue .
[0067] Step 2: Generate a chaotic sequence: Let the external key x 1=1, x 2=12, x 3=0.34, x 4=1, x 5=1, x 6=1, e= 5; Using the SHA-256 hash algorithm, you can get a color plaintext image P The hexadecimal hash value is K = b5c177b356c1a50c3af04d7c2d5850456d4b370fc011f85b5f07539e33653fb6. According to equations (1)-(12), two sets of initial conditions can be obtained, and then from equation (20), 6 chaotic sequences with a length of 786432 can be obtained. X 1, Y 1, Z 1, X 2, Y 2, Z 2.
[0068] Step 3: Dynamic DNA encoding: X 1 And equation (13) can be used to find the encoding rule vector R enc .Will P red , P green , P blue Transform them into vectors separately, and then merge them into a new vector P 1, whose size is 196608. P 1 is converted into the corresponding quaternary sequence P 2, its length is 786432. P 2 Perform dynamic DNA encoding to obtain the encoded DNA sequence P 3, whose length is 786432.
[0069] Step 4: DNA-level scrambling: Y 1 Sort in ascending order to get the index sequence Index Then, using equation (15) P 3. Scramble to get the scrambled DNA sequence P 4.
[0070] Step 5: Generate chaotic DNA sequence: X 2 And equation (16) can directly get the chaotic DNA sequence C DNA.
[0071] Step 6: Dynamic DNA Operation: Z 1 and equation (17), the operation rule vector can be obtained R oper Then, according to equation (18), P 4 Perform dynamic DNA calculations to obtain the DNA sequence after diffusion P 5.
[0072] Step 7: Dynamic DNA decoding: Y 2 and equation (19), the decoding rule vector can be obtained R dec Then, P 5 Dynamic decoding into quaternary sequence P 6.
[0073] Step 8: Generate ciphertext image: P 6 Convert the sequence to decimal form P 7. P 7 is transformed into three images of size 256×256, and then the three images are merged to obtain an encrypted image of size 256×256×3 P 8, such as Figure 4 shown.
[0074] During the decryption process, the same chaotic sequence is used to encrypt the image. P 8 to perform decryption operation to restore the original image, such as Figure 3 shown.
Claims
1. A color image encryption method based on bidirectional spiral cross transform, characterized in that: The steps include: Step 1: Extraction of R, G, B components and pixel-level scrambling: The color plaintext image is denoted as P, and its size is m×n×3; Extract the R, G, and B components from the color plaintext image P, where the size of each component is m×n; use bidirectional spiral cross transform to scramble the R, G, and B components respectively, and the scrambled images are recorded as P red , P green and P blue ; Step 2: Generate chaotic sequence: According to the external key ξ1,ξ2,ξ3,ξ4,ξ5,ξ6,e and the hash value K = (k1,k2,…,k 32 ) can calculate two sets of initial conditions (a1, b1, c1, x 10 ,y 10 ,z 10 ), (a2,b2,c2,x 20 ,y 20 ,z 20 ), the calculation method is as follows: a1 =ξ1 + mod(k1+k2, e) / 10 5 , (1) b1 =ξ2 + mod(k3+k4, a1) / 10 5 , (2) c1 =ξ3 + mod(k5+k6, a1 + b1 ) / 10 5 , (3) a2 =ξ1 + mod(k 25 +k 26 , e) / 10 5 , (4) <h2 style=";text-align:left;direction:ltr">b2 = ξ2 + mod(k<h2 style=";text-align:left;direction:ltr"> 27 <h2 style=";text-align:left;direction:ltr"> +k<h2 style=";text-align:left;direction:ltr"> 28 <h2 style=";text-align:left;direction:ltr"> , a2 ) / 10<h2 style=";text-align:left;direction:ltr"> 5 <h2 style=";text-align:left;direction:ltr"> (5) <h2 style=";text-align:left;direction:ltr">c2 = ξ3 + mod(k<h2 style=";text-align:left;direction:ltr"> 29 <h2 style=";text-align:left;direction:ltr"> +k<h2 style=";text-align:left;direction:ltr"> 30 <h2 style=";text-align:left;direction:ltr"> a2+b2) / 10<h2 style=";text-align:left;direction:ltr"> 5 <h2 style=";text-align:left;direction:ltr"> (6) in, is the XOR operator, mod(·) is the modulo function; the above two sets of initial conditions and the three-dimensional extreme multistable chaotic system can generate six chaotic sequences X1, Y1, Z1, X2, Y2, Z2, and the length of each chaotic sequence is 12mn; the mathematical model of the chaotic system is: Among them, a, b, c are control parameters, x, y, z are state variables; Step 3: Dynamic quaternary DNA coding: According to the chaotic sequence X1 and equation (14), the coding rule vector R can be calculated enc , R enc = floor(8×X1(i)) + 1, i = 1, 2, …, 12mn, (14) where floor(·) is the floor function; red ,P green ,P blue Convert them into vectors respectively and merge them in sequence to obtain a vector P1 of size 3mn; then, convert each decimal pixel value in vector P1 into the corresponding quaternary form to obtain a vector P2 composed of quaternary numbers, whose size is 12mn; use 0 to represent base A, 1 to represent base G, 2 to represent base C, and 3 to represent base T, and then according to the binary DNA coding rule, the quaternary DNA coding rule can be directly obtained as shown in Table 1; according to the coding rule vector R enc and quaternary DNA encoding rules, encode the quaternary vector P2 into a quaternary DNA sequence P3, whose size is 12mn; Table 1 Quaternary DNA encoding rules Step 4: DNA-level scrambling: Sort the chaotic sequence Y1 in ascending order. [Y sorted , Index] = sort (Y1), (15) where sort(·) is an ascending sorting function, Index is the index sequence, and Y sorted is the sorted sequence of Y1; the quaternary DNA sequence P3 is scrambled according to the index sequence, and the scrambling process is as follows: P4(i) = P3(Index(i)), i = 1, 2, …, 12mn, (16) where P4 is the scrambled DNA sequence; Step 5: Generate chaotic DNA sequence: Using equation (17), the chaotic sequence X2 can be directly converted into a chaotic DNA sequence without going through quaternary DNA encoding. C DNA = mod(floor(X2×10 15 ), 4);(17) Step 6: Dynamic quaternary DNA operation: According to the chaotic sequence Z1 and equation (18), the operation rule vector R can be calculated oper , R oper = floor(4×Z1(i)) + 1, i = 1, 2, …, 12mn, (18) According to R oper Perform dynamic DNA operations as follows: Among them, f add (·),f sub (·),f xor (·),f xnor (·) represent the quaternary DNA addition, subtraction, XOR and XNOR operation functions respectively; according to the quaternary DNA encoding rules as shown in Table 1, the quaternary DNA addition, subtraction, XOR and XNOR operation rules are shown in Table 2-3; in addition, the results of quaternary DNA operations can be quickly obtained by the table lookup method; the designed table lookup method, specifically The operation rules of quaternary DNA addition, subtraction, XOR and XNOR are stored in the corresponding tables ADD_table, SUB_table, XOR_table and XNOR_table in advance, and then the table lookup method can be defined as: f add (x,y) = ADD_table[x+1, y+1], (20) f sub (x,y) = SUB_table[x+1, y+1], (21) f xor (x,y) = XOR_table[x+1, y+1], (22) f xnor (x,y) = XNOR_table[x+1, y+1], (23) Among them, x and y represent one of the four bases; Table 2 Rules for addition and subtraction operations in quaternary DNA Table 3 Quaternary DNA XOR and XOR operation rules Step 7: Dynamic quaternary DNA decoding: The decoding rule vector R can be calculated from the chaotic sequence Y2 and equation (24): dec , R dec = floor(8×X4(i)) + 1, i = 1, 2, …, 12mn; (24) According to the decoding rule vector R dec and quaternary DNA encoding rules, P5 is dynamically decoded into a quaternary vector P6, whose size is 12mn; Step 8: Generate a ciphertext image: Convert each of the four quaternary numbers in the vector P6 into their corresponding decimal forms as a group, and you will get a vector P7 composed of decimal numbers with a size of 3mn; transform P7 into three images of size m×n, and then merge these three images to get a ciphertext image P8 of size m×n×3.
2. The method according to claim 1, characterized in that: In step 1, the steps of bidirectional spiral cross transformation are as follows: first, the first scanning process starts from the first element of the first row of the matrix P of size m×n, and scans the left half of the matrix in a clockwise spiral manner, and the scanned elements are arranged in sequence into a vector V1 of size (m×n) / 2; secondly, the second scanning process starts from the m / 2+1th element of the first row of the matrix P, and scans the right half of the matrix in a counterclockwise spiral manner, and the scanned elements are arranged in sequence into a vector V2 of size (m×n) / 2; thirdly, vector V2 Each element in and each element in vector V1 are cross-arranged in odd-even order to form a new vector V; finally, Transform the vector V into a matrix P' of size m×n, where P' is the scrambled matrix.