Image encryption method
By generating keys using a five-dimensional hidden dual memristor hyperchaotic system and hash functions, and combining global scrambling, block cat mapping scrambling, DNA diffusion, block affine transformation, and finite field diffusion methods, the problems of insufficient key space and weak anti-attack capability in existing medical image encryption methods are solved, achieving high-security image encryption.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2026-03-31
AI Technical Summary
Existing medical image encryption methods have limited key space, insufficient resistance to brute-force attacks, weak resistance to statistical and differential attacks, and are unable to effectively resist noise interference and cropping attacks.
A five-dimensional hidden dual memristor hyperchaotic system is used in conjunction with a hash function to generate a key. The image is encrypted using global scrambling, block cat mapping scrambling, DNA diffusion, block affine transformation, and finite field diffusion methods. Block cellular automata design is used to improve anti-cropping ability.
It improves the key space and resistance to differential attacks for image encryption, enhances the system's resistance to noise interference, and ensures that image data can still be effectively recovered even when partially lost or contaminated by noise.
Smart Images

Figure CN121000830B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and more specifically to an image encryption method. Background Technology
[0002] With the development of telemedicine and intelligent medical systems, the secure transmission and storage of medical images has become crucial. Currently, medical image encryption mainly employs traditional encryption methods such as AES and DES, but these methods have the following problems:
[0003] 1. Limited key space, insufficient resistance to brute-force attacks;
[0004] 2. It does not significantly alter the statistical properties of images, making it vulnerable to statistical attacks;
[0005] 3. Relatively weak resistance to differential attacks;
[0006] 4. It cannot effectively resist noise interference and truncation attacks.
[0007] Currently, while low-dimensional chaotic systems have applications in image encryption, their dynamic behavior is relatively simple and their key space is limited. Meanwhile, existing cellular automata encryption techniques suffer from insufficient resistance to pruning, and their application in medical image encryption is not yet mature. Summary of the Invention
[0008] This invention provides an image encryption method to solve at least one of the above-mentioned technical problems.
[0009] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: An image encryption method, comprising:
[0010] S1, based on the hash method and superimposed with a preset real number key parameter, the three color channels of the plaintext image are encrypted to obtain three sets of encryption keys, namely the first set of encryption keys, the second set of encryption keys and the third set of encryption keys.
[0011] S2, divide the original plaintext image into three pixel matrices P with an image size of M×N. 11 P 12 P 13 Let the pixel matrix P 11 P 12 P 13 The block size is t×t. If M / t or N / t is not an integer, the original plaintext image is padded with zeros, and the pixel matrix after zero padding is P. 11 P 12 P 13 The image size is M1×N1;
[0012] S3, using the first set of encryption keys, the pre-constructed five-dimensional dual-memristor chaotic system generates a sequence X of length M1×N1. 11 X 12 X 13 X 14 X 15 and for sequence X 11 X 12 X 13 X 14 The sequence Y is obtained through processing. 11 Y 12 Y 13 And respectively for sequence Y 11 Y 12 Y 13 Perform ascending order processing to obtain the index sequences sy1, sy2, and sy3, and then perform sorting the pixel matrix P based on the index sequences sy1, sy2, and sy3. 11 P 12 P 13 Perform a global scrambling operation to obtain the corresponding pixel matrix P. 21 P 22 P 23 ;
[0013] S4, respectively, the pixel matrix P 21 P 22 P 23 Divide the data into (M1×N1) / (t×t) sub-blocks, and perform a cat mapping scrambling operation on each sub-block to obtain the corresponding pixel matrix P. 31 P 32 P 33 ;
[0014] S5, using the second set of encryption keys, the five-dimensional dual-memristor chaotic system generates a sequence X of length (M1×N1) / (t×t). 21 X 22 X 23 X 24 X 25 Using sequence X 21 X 22 X 24 X 14 For the pixel matrix P respectively 31 P 32 P 33 Performing a segmented DNA operation yields three corresponding DNA segment operation results;
[0015] S6, based on sequence X 11 X 12 X 13 X 14 X15 The results of the three segmented DNA operations were processed using a segmented cellular automaton to obtain the corresponding pixel matrix P. 41 P 42 P 43 ;
[0016] S7, respectively for pixel matrix P 41 P 42 P 43 Performing a block-based affine transformation scrambling operation yields the corresponding pixel matrix P. 51 P 52 P 53 ;
[0017] S8, using the third set of encryption keys, the five-dimensional dual-memristor chaotic system generates a sequence X of length 2×M1×N1. 31 X 32 X 33 X 34 X 35 Using sequence X 33 For pixel matrix P 51 P 52 P 53 After performing forward and reverse finite-domain diffusion, the layers are merged to obtain the encrypted image.
[0018] The beneficial effects of this invention are as follows: The image encryption method of this invention employs a five-dimensional hidden dual-memristor hyperchaotic system. This system has two positive Lyapunov exponents, and its system parameters and initial values are highly sensitive. Dynamic analysis shows that the system maintains a chaotic state under a wide range of initial value changes, making it suitable for image encryption. This invention uses a hash function to generate the initial value of the chaotic system and can also add preset values to the initial value generated by the hash function. This design can improve the system's resistance to differential attacks while increasing the system's key space. This invention employs a block-based cellular automaton design, which can improve the system's resistance to cropping. When a single pixel is lost, traditional cellular automata can cause error propagation, thus affecting the recovery of the entire image data. However, the block-based cellular automaton design of this invention divides the image into several independent sub-blocks, each running independent cellular automaton rules, thus limiting the impact to the damaged block. This invention also uses global scrambling, block-based cat mapping scrambling, DNA diffusion, block-based affine transformation, and finite field diffusion methods to change the pixel position and pixel value of the image, further improving the security of the image data. Attached Figure Description
[0019] Figure 1 This is a flowchart of an image encryption method according to the present invention;
[0020] Figure 2This is a schematic diagram of an image encryption method according to the present invention;
[0021] Figure 3 Phase diagrams of a five-dimensional dual memristor chaotic system in different planes;
[0022] Figure 4 The bifurcation diagram and Lyapunov exponent spectrum for the dynamic analysis of a five-dimensional dual memristor chaotic system with changes in initial conditions;
[0023] Figure 5 A schematic diagram of sensitivity analysis for a five-dimensional dual-memristor chaotic system;
[0024] Figure 6 This is an example diagram illustrating the process of splitting DNA.
[0025] Figure 7 Here is an example diagram of converting sub-block pixel values into 8-bit binary form and rearranging them into a matrix;
[0026] Figure 8 To be Fill to pad i Example diagram in the image;
[0027] Figure 9 An example diagram of a segmented cellular automaton spreading from the top left to the bottom right;
[0028] Figure 10 An example diagram of a segmented cellular automaton spreading from the bottom right to the top left;
[0029] Figure 11 Example image of image encryption / decryption test results;
[0030] Figure 12 Here is an example image histogram;
[0031] Figure 13 Example graph for correlation analysis;
[0032] Figure 14 Example diagram of key sensitivity;
[0033] Figure 15 Example diagram showing anti-cutting and noise resistance performance. Detailed Implementation
[0034] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0035] like Figure 1 and Figure 2 As shown, an image encryption method includes:
[0036] S1, based on the hash method and superimposed with a preset real number key parameter, the three color channels of the plaintext image are encrypted to obtain three sets of encryption keys, namely the first set of encryption keys, the second set of encryption keys and the third set of encryption keys.
[0037] S2, divide the original plaintext image into three pixel matrices P with an image size of M×N. 11 P 12 P 13 Let the pixel matrix P 11 P 12 P 13 The block size is t×t. If M / t or N / t is not an integer, the original plaintext image is padded with zeros, and the pixel matrix after zero padding is P. 11 P 12 P 13 The image size is M1×N1;
[0038] S3, using the first set of encryption keys, the pre-constructed five-dimensional dual-memristor chaotic system generates a sequence X of length M1×N1. 11 X 12 X 13 X 14 X 15 and for sequence X 11 X 12 X 13 X 14 The sequence Y is obtained through processing. 11 Y 12 Y 13 And respectively for sequence Y 11 Y 12 Y 13 Perform ascending order processing to obtain the index sequences sy1, sy2, and sy3, and then perform sorting the pixel matrix P based on the index sequences sy1, sy2, and sy3. 11 P 12 P 13 Perform a global scrambling operation to obtain the corresponding pixel matrix P. 21 P 22 P 23 ;
[0039] S4, respectively, the pixel matrix P 21 P 22 P 23 Divide the data into (M1×N1) / (t×t) sub-blocks, and perform a cat mapping scrambling operation on each sub-block to obtain the corresponding pixel matrix P. 31 P 32 P 33 ;
[0040] S5, using the second set of encryption keys, the five-dimensional dual-memristor chaotic system generates a sequence X of length (M1×N1) / (t×t). 21 X 22 X 23 X 24 X 25 Using sequence X 21 X 22 X 24 X 14 For the pixel matrix P respectively 31 P 32 P 33 Performing a segmented DNA operation yields three corresponding DNA segment operation results;
[0041] S6, based on sequence X 11 X 12 X 13 X 14 X 15 The results of the three segmented DNA operations were processed using a segmented cellular automaton to obtain the corresponding pixel matrix P. 41 P 42 P 43 ;
[0042] S7, respectively for pixel matrix P 41 P 42 P 43 Performing a block-based affine transformation scrambling operation yields the corresponding pixel matrix P. 51 P 52 P 53 ;
[0043] S8, using the third set of encryption keys, the five-dimensional dual-memristor chaotic system generates a sequence X of length 2×M1×N1. 31 X 32 X 33 X 34 X 35 Using sequence X 33 For pixel matrix P 51 P 52 P 53 After performing forward and reverse finite-domain diffusion, the layers are merged to obtain the encrypted image.
[0044] In an image encryption method of the present invention:
[0045] 1. This invention employs a five-dimensional hidden dual memristor hyperchaotic system, which has two positive Lyapunov exponents and is highly sensitive to both system parameters and initial values. Dynamic analysis shows that the system maintains a chaotic state under a wide range of initial value changes, making it suitable for image encryption.
[0046] 2. This invention uses a hash function to generate initial values for a chaotic system, and can also add preset values to the initial values generated by the hash function; this design can improve the system's resistance to differential attacks while increasing the system's key space.
[0047] 3. The present invention adopts a block cellular automaton design, which can improve the system's resistance to cropping. When a single pixel is lost, traditional cellular automata will cause error propagation, thereby affecting the recovery of the entire image data. However, the block cellular automaton design of the present invention divides the image into several independent sub-blocks, and each block runs independent cellular automaton rules, thus limiting the impact to the damaged block.
[0048] 4. This invention also employs global scrambling, block cat mapping scrambling, DNA diffusion, block affine transformation, and finite field diffusion methods to change the pixel position and pixel value of the image, further improving the security of image data.
[0049] The five-dimensional dual memristor chaotic system of this invention will be described below.
[0050] Reference 1 proposes a magnetically controlled memristor, which is represented as follows:
[0051] ; (1)
[0052] In the formula, It is a function of memory derivative. , and These represent the current flowing through the memristor, the voltage applied across the memristor, and the internal magnetic flux of the memristor, respectively.
[0053] Reference 2 proposes a classic Chen chaotic system. Based on this, a magnetically controlled memristor as shown in equation (1) is introduced to obtain a new five-dimensional dual-memristor chaotic system:
[0054] ; (2)
[0055] Where x, y, z, w, and u represent state variables, and a, b, c, k1, and k2 represent system parameters.
[0056] Let the system parameters be respectively , , , , The initial values of the state variables are set to (0.1, 0.1, 0.1, 0.1, 0.1). Equation (2) is shown in the phase diagram of different planes as follows: Figure 3As shown, (a) is the xy plane, (b) is the xz plane, (c) is the yxu plane, and (d) is the yzw plane. The corresponding Lyapunov exponents are (1.8517, 0.0274, 0, –0.0128, –21.8945), with two positive Lyapunov exponents, indicating that the system is a hyperchaotic system. The calculations yield... Fractional dimension is This further verifies the chaotic characteristics of the system. Setting the right side of equation (2) to zero, we can obtain the equilibrium point of the system as follows: ,in Let be any real number. Since this system has infinitely many equilibrium points, it belongs to the category of hidden chaotic systems.
[0057] Fixed parameters , , , , The initial values of the state variables are (0.1, 0.1, 0.1, ...). , 0.1). Select To control variables, bifurcation diagram and The index spectrum is as follows: Figure 4 As shown in (a) and (b) in the figure. Figure 4 (b) It is evident that the first and second articles The exponent spectrum remains constant and greater than 0, indicating that the system exhibits a constant Lyapunov exponent phenomenon and displays continuous hyperchaotic characteristics. Figure 4 The bifurcation diagram shown in (a) and The exponential spectrum phenomenon is consistent.
[0058] Chaotic systems exhibit high initial value sensitivity, which can improve the key sensitivity and key space of encryption methods when applied to image encryption. To investigate the sensitivity of this system to parameters and initial values, three sets of parameters and initial values are set as follows:
[0059] ;
[0060] ;
[0061] ;
[0062] Choose the values from the 501st to the 550th iteration for each group of variables, and their differences are as follows: Figure 5 As shown, (a) to (c) illustrate the system's sensitivity to initial values, while (d) to (e) demonstrate the system's sensitivity to parameters. It can be observed that after 500 iterations, the system generates different trajectories, indicating its extremely sensitive performance. This provides a guarantee for the key space and key sensitivity of the encryption method.
[0063] The following is a detailed description of each step of the image encryption method of the present invention.
[0064] In some embodiments, S1 specifically refers to:
[0065] S11, the three color channels of the plaintext image are converted into 256-bit binary sequences respectively using the SHA-256 hash method;
[0066] S12, divide the three binary sequences into five groups, convert them into floating-point values, and then superimpose them with a corresponding set of preset real-number key parameters to obtain three encryption keys, which are represented as follows:
[0067] ; (3)
[0068] In the formula, i = 1, 2, 3, {kx i ky i 、kz i ,kw i , ku i} represents the i-th encryption key, K i This represents the 256-bit binary sequence converted from the i-th color channel of the plaintext image using the SHA-256 hash method. `change` represents the function that converts the binary sequence into a floating-point number. {Kx i Ky i Kz i 、Kw i Ku i} represents the i-th group of preset real key parameters.
[0069] Specifically, in S1, the plaintext image is first converted into a 64-bit hexadecimal character sequence using the SHA-256 hash method. Then, each hexadecimal character is converted into a 4-bit binary representation, resulting in a 256-bit binary sequence. Based on this sequence, the binary sequence is divided into several groups according to the grouping rules defined in equation (3), and each group is converted into a corresponding floating-point value. To further enhance the randomness of the key, a set of preset real-valued key parameters are superimposed on the generated floating-point value. Finally, the value obtained after the above processing will be used as the initial condition of the chaotic system, i.e., as the encryption key of the method of this invention. In addition, since the control parameters of the five-dimensional dual-memristor chaotic system are highly sensitive, preset values are used for the parameters of the five-dimensional dual-memristor chaotic system to improve the key space and enhance system security.
[0070] In some embodiments, in step S2, the formula for padding the original plaintext image with zeros is:
[0071] P1i (M1, N1) = 0; (4)
[0072] In the formula, i=1, 2, 3, M1=M+t-mod(M, t), N1=N+t-mod(N, t).
[0073] Specifically, in this invention, operations such as block scrambling require dividing the image into several regular sub-blocks. Considering that the size of the input image may vary in practical applications, to ensure the feasibility of the block operation, zero-padding is required when the length or width of the image matrix cannot meet the divisibility requirement of the block size. This preprocessing step aims to ensure the smooth execution of the subsequent encryption process.
[0074] In some embodiments, in S3, for sequence X 11 X 12 X 13 X 14 The formula for processing is:
[0075] ; (5)
[0076] In the formula, abs represents the absolute value operation function, floor represents the floor function, and mod represents the modulo operation function; i = 1, 2, 3, 4, j = 1, 2, ..., M1×N1, X 1i (j) represents sequence X 1i The j-th sequence value in;
[0077] For pixel matrix P 11 P 12 P 13 The formula for performing a global scramble operation is:
[0078] ; (6)
[0079] In the formula, i = 1, 2, 3, j = 1, 2, ..., M1×N1, P 2i (j) represents the pixel matrix P 2i The j-th pixel value, sy i (j) represents the index sequence sy i The j-th index sequence value in the sequence.
[0080] In some embodiments, in S4, the formula for performing cat mapping scrambling on the sub-block is:
[0081] ; (7)
[0082] In the formula, (x 11 y 11(x) represents the position of the pixel in the sub-block before the cat map was scrambled. 12 y 12 ) represents the position of the pixel in the sub-block after the cat mapping is scrambled; d, e, and count are the cat mapping scrambling coefficients, and d=2, e=3, and count=6; mod represents the modulo operation function.
[0083] In some embodiments, S5 specifically refers to:
[0084] S51, using the second set of encryption keys, the five-dimensional dual-memristor chaotic system generates a sequence X of length (M1×N1) / (t×t). 21 X 22 X 23 X 24 X 25 And select sequence X 21 X 22 X 24 After processing, sequence Y is obtained. 21 Y 22 Y 24 Among them, for X 21 X 22 X 24 The formula for processing is:
[0085] ; (8)
[0086] In the formula, i = 1, 2, 4, j = 1, 2, ..., (M1 × N1) / (t × t), Y 2i (j) represents sequence Y 2i The j-th sequence value, X 2i (j) represents sequence X 2i The j-th sequence value; mod represents the modulo operation function, round represents the rounding function; Y 21 Corresponding to 8 encoding methods, Y 22 Corresponding to the 4 operation methods, Y 24 It corresponds to 8 decoding methods.
[0087] S52, for sequence X 14 After processing, sequence Y is obtained. 14 And matrix T; where, for sequence X 14 The formula for processing is:
[0088] ; (9)
[0089] In the formula, abs represents the absolute value operation function, mod represents the modulo operation function, and reshape represents the function that rearranges the sequence into a matrix;
[0090] S53, respectively, the pixel matrix P 31 P 32 P 33 Divide into (M1×N1) / (t×t) sub-blocks of size t×t, and according to sequence Y 21 The value is used to select the appropriate DNA encoding method to encode each sub-block, and the sequence Y is used to encode the sub-block. 21 (1) Encode matrix T using the corresponding encoding method;
[0091] S54, according to sequence Y 22 Select the appropriate operation method for the value of the pixel matrix P respectively. 31 P 32 P 33 The first sub-block of each pixel is subjected to DNA operation with the matrix T, resulting in three corresponding operation results. Then, the pixel matrix P is... 31 P 32 P 33 Each encoded sub-block is subjected to DNA operation with the corresponding previous operation result, resulting in three final operation results.
[0092] S55, according to sequence Y 22 The value is selected to choose the corresponding decoding method, and the three final operation results are decoded respectively to obtain the three block DNA operation results.
[0093] Specifically, taking sequence P 31 Taking the first two sub-blocks as an example, Figure 6 It demonstrates the process of DNA encoding, computation, and decoding during the segmented DNA operation.
[0094] In some embodiments, S6 specifically refers to:
[0095] S61, for sequence X 11 X 12 X 13 X 14 X 15 After processing, sequence Y is obtained. 15 Y 16 Y 17 ;wherein, for sequence X 11 X 12 X 13 X 14 X 15 The formula for processing is:
[0096] ; (10)
[0097] In the formula, floor represents the floor function, and mod represents the modulo function;
[0098] S62, respectively from sequence Y 15 Y 16 Y 17 Select (2t+4) and (4t+2) sequence values from the given data, and arrange the selected sequence values into a matrix pad of size (2t+4)×(4t+2). i The selected sequence values are arranged into a matrix pad of size (2t+4)×(4t+2). i The formula is:
[0099] ; (11)
[0100] In the formula, i = 5, 6, 7; reshape represents a function that rearranges the sequence into a matrix;
[0101] S63 converts the pixel values of each decoded sub-block in the results of the three block DNA operations into 8-bit binary form and rearranges them into a matrix of size 2t×4t. i The decoded pixel values of each sub-block in 8-bit binary form are rearranged into a matrix of size 2t × 4t. i The formula is:
[0102] ;(12)
[0103] In the formula, i = 1, 2, 3, j = 1, 2, ..., (M1 × N1) / (t × t). This represents the binary sequence obtained by converting the j-th decoded sub-block in the i-th block DNA operation result. Represents a matrix block i The j-th element in;
[0104] Specifically, the decoded pixel values of each sub-block in 8-bit binary form are rearranged into a matrix of size 2t × 4t. i Examples such as Figure 7 As shown;
[0105] S64, Fill to pad i In China; among them, will Fill to pad i The formula in the text is:
[0106] ; (13)
[0107] Specifically, will Fill to pad i Examples in Figure 8 As shown;
[0108] S65, for filling to In For each pixel value, the sum of its six neighboring pixels (from top left to bottom right) is calculated, and the remainder is taken. Then, according to cell evolution rules, the current cell value is XORed with the remainder to obtain the initially updated cell value, thus completing the process. The initial update of all pixel values;
[0109] Specifically, for cells During the forward update phase, its neighborhood structure consists of the following 6 cells: ;
[0110] The evolutionary rules are: .
[0111] An example of a segmented cellular automaton spreading from the top left to the bottom right is shown below. Figure 9 As shown.
[0112] S66, for filling to In For each initial pixel value update, following the order from bottom right to top left, the cell value is updated by calculating the sum of the values of its six neighboring pixels, taking the remainder, and then, according to cell evolution rules, XORing the cell's current value with the remainder to obtain the updated cell value, thus completing the process. The entire pixel is updated again, thus obtaining the filling update matrix;
[0113] Specifically, an example of the segmented cellular automata spreading from the bottom right to the top left is as follows: Figure 10 As shown;
[0114] S67, extract the central region (3:2t+2, 2:4t+1) from the filling update matrix as a new sub-block;
[0115] S68 rearranges the new sub-blocks into 8 columns (each group of 8 bits represents a pixel) and converts each 8-bit binary value back to a decimal pixel value to form a one-dimensional pixel vector.
[0116] S69, reorganize the one-dimensional pixel vector into t×t decimal sub-blocks, and combine all the decimal sub-blocks to obtain the corresponding pixel matrix P. 41 P 42 P 43 .
[0117] In some embodiments, S7 specifically involves: processing the pixel matrix P respectively. 41 P 42 P 43The image is divided into blocks, and multiple affine transformations are performed on each sub-block to obtain the corresponding pixel matrix P. 51 P 52 P 53 The formula for performing multiple rounds of affine transformation on each sub-block is as follows:
[0118] ;(14)
[0119] ; (15)
[0120] In the formula, i = 1, 2, 3, This indicates the position of the pixel before the affine transformation operation. The pixel matrix P represents the position of the pixel after the affine transformation operation, and r represents the number of rounds of the affine transformation operation. When r is the number of the last round of the affine transformation operation, the pixel matrix P... 4i (r) For pixel matrix P 5i In this embodiment, the number of rounds of the affine transformation operation is set to 5, that is, 5 rounds of affine transformation operation are performed on each sub-block, P 4i (5) =P 5i .
[0121] In some embodiments, S8 specifically refers to:
[0122] S81, using the third set of encryption keys, the five-dimensional dual-memristor chaotic system generates a sequence X of length 2×M1×N1. 31 X 32 X 33 X 34 X 35 And select sequence X 33 The processing yields sequences S1 and S2; among them, for column X... 33 The formula for processing is:
[0123] ; (16)
[0124] In the formula, mod represents the modulo operation function;
[0125] S82, construct the multiplication table TB; where the multiplication table TB is represented as:
[0126] ; (17)
[0127] S83, based on sequences S1, S2 and multiplication table TB, calculate the pixel matrix P. 51 P 52 P 53 After performing forward and reverse finite-field diffusion, the layers are merged to obtain the encrypted image; where, for the pixel matrix P51 P 52 P 53 The formulas for forward and reverse finite field diffusion are:
[0128] ; (18)
[0129] ; (19)
[0130] In the formula, i = 1, 2, 3, j = 1, 2, ..., M1 × N1, This represents the j-th sequence value in sequence S1. Represents sequence P 5i The j-th sequence value in the sequence, Indicates diffusion sequence The j-th sequence value in the sequence, Indicates diffusion sequence The j-th sequence value in the sequence.
[0131] Finally, a performance analysis of the image encryption method of the present invention is performed.
[0132] Encryption and decryption:
[0133] The experiment used 512×512 medical images and Lena images for encryption and decryption tests, and the results are as follows: Figure 11 As shown, (a)~(d) are plaintext images, (e)~(h) are ciphertext images, and (i)~(l) are decrypted images. From... Figure 11 It can be observed that the encrypted image contains random noise and the original information cannot be identified, indicating that the method of the present invention can effectively prevent information leakage; while the decrypted image is completely consistent with the plaintext image, verifying the accuracy and effectiveness of the method of the present invention.
[0134] Histograms and chi-squares:
[0135] Histograms reflect the frequency distribution of pixel values. Figure 12 Given Figure 11 The histograms of the plaintext and ciphertext images are shown, where (a)~(d) are the plaintext image histograms, and (e)~(h) are the ciphertext image histograms. From Figure 12 As can be seen, the pixels in the ciphertext image are evenly distributed, making it difficult for attackers to obtain statistical information about the plaintext image.
[0136] The Chi-Square Test is a statistical method that can also be used to evaluate the uniformity of a histogram of a ciphertext image. It determines whether the ciphertext image approximates a random distribution by comparing the difference between the actual pixel value frequencies and the theoretical uniform distribution. The formula is as follows:
[0137] ; (20)
[0138] In the formula, O f This represents the frequency of the observed grayscale value f. E represents... f This represents the theoretically expected frequency.
[0139] When the confidence level is set to 0.05, the chi-square critical value for judging the uniformity of the histogram is 293.24784. The lower the value, the smaller the deviation between the actual distribution and the ideal uniform distribution, and the stronger the uniformity. Table 1 shows the results of the chi-square test for different ciphertext images. As can be seen from Table 1, the ciphertext images of all test images meet the chi-square test requirements, indicating that the grayscale distribution is close to a random uniform distribution, which can effectively hide the statistical features of the plaintext.
[0140] Table 1: Chi-square test table
[0141]
[0142] Information entropy:
[0143] Information entropy is an important indicator for evaluating the randomness of encrypted images. The closer its value is to 8, the higher the degree of disorder in the pixel distribution and the stronger its resistance to statistical attacks. The formula for calculating information entropy is as follows:
[0144] ; (twenty one)
[0145] In the formula, , express The probability of occurrence.
[0146] Table 2 provides the information entropy of the encrypted images for different test images. As can be seen from Table 2, the information entropy of all encrypted images is close to 8. Therefore, the method of this invention has good resistance to statistical attacks.
[0147] Table 2: Information Entropy
[0148]
[0149] Correlation analysis:
[0150] Plaintext images exhibit strong correlations between pixels; therefore, image encryption should aim to reduce this correlation. Correlation is typically represented by a correlation coefficient.
[0151] ; (twenty two)
[0152] In the formula, This represents the total number of adjacent pixel pairs. and The values of adjacent pixels, ; This represents the correlation coefficient between adjacent pixels; This represents the covariance between adjacent pixels; and These represent the standard deviations of adjacent pixels.
[0153] To verify the performance of the encryption method of the present invention, 10,000 pairs of adjacent pixels were randomly selected from the plaintext image and the ciphertext image, respectively, and their correlation coefficients were calculated using equation (22). The experimental results are shown in Table 3. As can be seen from Table 3, the correlation coefficients of the ciphertext image in the horizontal, vertical and diagonal directions are close to 0, which indicates that there is almost no correlation between adjacent pixels of the ciphertext image. Figure 13 The correlation diagrams of Lena test images before and after encryption are shown, where (a) to (c) are the correlation diagrams of plaintext images; and (d) to (f) are the correlation diagrams of ciphertext images.
[0154] Table 3: Correlation Coefficients
[0155]
[0156] Key space:
[0157] In this invention, the key to the five-dimensional dual-memristor chaotic system consists of five preset system parameters, a 256-bit hash value, and five preset real-number key parameters. If the precision of each parameter is 10... -15 Then the system's key space is Because it is much larger than Therefore, the method of the present invention can effectively resist brute-force attacks.
[0158] Key sensitivity:
[0159] Key sensitivity is divided into encryption key sensitivity and decryption key sensitivity. Encryption key sensitivity refers to the degree of difference in ciphertext produced by different encryption keys; decryption key sensitivity refers to the ability to recover plaintext when an incorrect decryption key is used. To test the encryption sensitivity of the encryption method of this invention, [the following is conducted]... Perform perturbation (10 -15 The NPCR and UACI of the ciphertext images before and after perturbation were 99.612% and 33.475%, respectively. It is evident that perturbation of the key significantly alters the ciphertext image. To verify the decryption sensitivity of the encryption method of this invention, the correct key was used... Decryption of perturbation keys +10 -15 The images are as follows Figure 14 As shown in (a) and (b), it can be seen that the perturbation key cannot be used for decryption, and the method of the present invention has good decryption sensitivity.
[0160] Resistance to differential attacks:
[0161] The ability to withstand differential attacks is a key indicator for evaluating the security of encryption methods, primarily reflected in the method's sensitivity to minute changes in plaintext. Higher sensitivity generally indicates higher security. This capability is typically quantified using two metrics: NPCR and UACI.
[0162] ; (twenty three)
[0163] In the formula, U and V are the image sizes; O1 and O2 are the encrypted images, respectively.
[0164] Table 4 provides the NPCR and UACI of the encrypted images for different test images. As can be observed from Table 4, the NPCR and UACI of the different encrypted images are close to ideal values. Therefore, the encryption method of this invention has good resistance to differential attacks.
[0165] Table 4: NPCR and UACI
[0166]
[0167] Anti-cutting and anti-noise analysis:
[0168] Data loss and noise interference are often unavoidable during the transmission and storage of medical image data. Therefore, encryption methods need to be robust against data loss and noise interference to ensure that even if some data in the encrypted image is damaged or contaminated by noise, the decrypted image still retains the key diagnostic information of the original medical image. To evaluate the anti-cropping attack and noise resistance performance of the encryption method of this invention, cropping tests of different specifications and tests with added Gaussian noise were conducted on the encrypted image. The experimental results are as follows: Figure 15 As shown, (a) is ciphertext with 0.01% noise added, (b) is ciphertext with 0.1% noise added, (c) is ciphertext cropped by 1 / 32, (d) is ciphertext cropped by 1 / 2, (e) is plaintext with 0.01% noise added, (f) is plaintext with 0.1% noise added, (g) is plaintext cropped by 1 / 32, and (h) is plaintext cropped by 1 / 2. Figure 15 It can be observed that even if some data in the ciphertext image is damaged or contaminated by noise, the decrypted image can still clearly present the key information of the plaintext image. Therefore, the encryption method proposed in this invention has good security.
[0169] Data Comparison:
[0170] To verify the security of the encryption method of this invention, a comprehensive comparison was conducted with existing mainstream encryption methods. For literature data, average values were directly used. The comparison results are shown in Tables 5 and 6. The results show that the encryption method of this invention achieves optimal performance in all security metrics, especially in resisting statistical and differential attacks, thus ensuring system security. The performance score of the encryption method proposed in this invention is comparable to that of the most advanced existing encryption methods. This confirms the ability of the encryption method of this invention to resist statistical and differential attacks.
[0171] Table 5: Comparison of Chi-square test, correlation coefficient, and information entropy
[0172]
[0173] Table 6: Comparison of resistance to differential attacks
[0174]
[0175] Document 1: Wu Y, Zhang L, Berretti S, et al. Medical image encryption bycontent-aware DNA computing for secure healthcare[J]. IEEE Transactions on Industrial Informatics, 2022, 19(2): 2089-2098.
[0176] Document 2: Wei D, Jiang M, Deng Y. A secure image encryption algorithm based on hyper-chaotic and bit-level permutation[J]. Expert Systems withApplications, 2023, 213: 119074.
[0177] Document 3: Rahul B, Kuppusamy K, Senthilrajan A. Dynamic DNA cryptography-based image encryption scheme using multiple chaotic maps and SHA-256 hashfunction[J]. Optik, 2023, 289: 171253.
[0178] Reference 4: Yousif S F, Abboud A J, Alhumaima R S. A new image encryption based on bit replacing, chaos and DNA coding techniques[J]. Multimedia Tools and Applications, 2022, 81(19): 27453-27493.
[0179] Reference 5: Zhou W, Wang X, Wang M, et al. A new combination chaotic system and its application in a new bit-level image encryption scheme[J]. Optics and Lasers in Engineering, 2022, 149: 106782.
[0180] Reference 6: Wu H, Ye G, Yap W-S, et al. Reversible blind image hiding algorithm based on compressive sensing and fusion mechanism[J]. Optics and Laser Technology, 2023, 167: 109755.
[0181] Reference 7: Niu Y, Zhou Z, Zhang X. An image encryption approach based on chaotic maps and genetic operations[J]. Multimedia Tools and Applications, 2020, 79(35): 25613-25633.
[0182] [[ID=I2]]Reference 8: Gao M, Li J, Di X, et al. A blind signature scheme for IoV based on 2D-SCML image encryption and lattice cipher[J]. Expert Systems with Applications, 2024, 246: 123215.
[0183] Document 9: Lai Q, Hua H. Secure medical image encryption scheme for Healthcare IoT using novel hyperchaotic map and DNA cubes[J]. Expert Systems with Applications, 2025, 264: 125854.
[0184] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An image encryption method characterized by, Comprise: S1, based on the hash method and superimposed on the preset real key parameters of the three color channels of the plaintext image encryption calculation, corresponding to obtain three groups of encryption keys, and respectively the first group of encryption keys, the second group of encryption keys and the third group of encryption keys; S2, dividing the original plaintext image into three pixel matrices P 11 , 12 , 13 , assuming that the block size of the pixel matrix P 11 , 12 , 13 is t x t, if M / t or N / t is not an integer, performing zero padding on the original plaintext image, and assuming that the image size of the zero-padded pixel matrix P 11 , 12 , 13 is M1 x N1; S3, the pre-constructed five-dimensional double-memorized block chaotic system generates a sequence X with a length of M1xN1 by the first group of encryption keys 11 , X 12 , X 13 , X 14 , X 15 , and processes the sequence X 11 , X 12 , X 13 , X 14 to obtain a sequence Y 11 , Y 12 , Y 13 , respectively processes the sequence Y 11 , Y 12 , Y 13 in ascending order, and correspondingly obtains index sequences sy1, sy2 and sy3, and performs a global scrambling operation on the pixel matrix P 11 , P 12 , P 13 according to the index sequences sy1, sy2 and sy3, and correspondingly obtains the pixel matrix P 21 , P 22 , P 23 ; S4, respectively, divide the pixel matrix P 21 , 22 , 23 P into (M1xN1) / (txt) sub-blocks, and perform the cat mapping scrambling operation on each sub-block, to obtain the pixel matrix P 31 , 32 , 33 P correspondingly; S5, generating a sequence X with length of (M1×N1) / (t×t) by the fifth-dimensional double-memorized-block chaotic system through the second group of encryption keys 21 , X 22 , X 23 , X 24 , X 25 , using the sequence X 21 , X 22 , X 24 , X 14 respectively to perform the block DNA operation on the pixel matrix P 31 , P 32 , P 33 , and correspondingly obtaining three block DNA operation results S6, according to sequence X 11 , X 12 , X 13 , X 14 , X 15 Respectively, the three block DNA operation results are operated by block cellular automata, and the pixel matrix P 41 , P 42 , P 43 ; S7, respectively, the pixel matrix P 41 , P 42 , P 43 block affine transformation scrambling operation, corresponding to get the pixel matrix P 51 , P 52 , P 53 ; S8, generating a sequence X with a length of 2*M1*N1 by the third group of encryption keys 31 , X 32 , X 33 , X 34 , X 35 , using the sequence X 33 to perform forward and reverse finite field diffusion on the pixel matrix P 51 , P 52 , P 53 , and merging the layers to obtain a ciphertext image; In the S3, the sequence X 11 , X 12 , X 13 , X 14 is processed by the formula: ; In the formula, abs represents an absolute value operation function, floor represents a down rounding operation function, and mod represents a remainder operation function; j = 1, 2,..., M1xN1, X 11 (j) represents the jth sequence value in the sequence X 11 (j) represents the jth sequence value in the sequence X 12 (j) represents the jth sequence value in the sequence X 12 (j) represents the jth sequence value in the sequence X 13 (j) represents the jth sequence value in the sequence X 13 (j) represents the jth sequence value in the sequence X 14 (j) represents the jth sequence value in the sequence X 14 (j) represents the jth sequence value in the sequence X 2. The image encryption method according to claim 1, characterized in that, The S1 is specifically: S11, the three color channels of the plaintext image are converted into 256-bit binary sequences by SHA-256 hash method respectively; S12, three binary sequences are divided into five groups respectively, then converted into floating point values and superimposed on the corresponding preset real key parameters to obtain three groups of encryption keys, and the three groups of encryption keys are represented as: ; where i = 1, 2, 3, {kx i , ky i , kz i , kw i , ku i} represents the i-th group of encryption keys, K i represents a 256-bit binary sequence converted from the i-th color channel of the three color channels of the plaintext image processed by the SHA-256 hashing method, change represents an operation function for converting the binary sequence into a floating-point number, and {Kx i , Ky i , Kz i , Kw i , Ku i} represents the i-th group of preset real number key parameters.
3. The image encryption method of claim 1, wherein, In the S2, the formula for zero padding the original plaintext image is: P 1i (M1, N1) = 0; In the formula, i=1, 2, 3, M1=M+t-mod(M,t), N1=N+t-mod(N,t).
4. The image encryption method of claim 1, wherein, The pixel matrix P 11 , P 12 , P 13 The formula for performing a global scrambling operation is: ; where i = 1, 2, 3, j = 1, 2,..., M1xN1, P 2i (j) denotes the jth pixel value in the pixel matrix P 2i (j) denotes the jth pixel value in the pixel matrix P i (j) denotes the jth index sequence value in the index sequence sy i (j) denotes the jth index sequence value in the index sequence sy 5. The image encryption method of claim 1, wherein, In the S4, the formula for the cat mapping scrambling operation of the sub-block is: ; wherein (x 11 , y 11 ) represents the position of the pixel in the sub-block before the cat map scrambling, (x 12 , y 12 ) represents the position of the pixel in the sub-block after the cat map scrambling; d, e, count are cat map scrambling coefficients, and d = 2, e = 3, count = 6; mod represents the remainder operation function.
6. The image encryption method of claim 1, wherein, The S5 is specifically: S51, generating a sequence X with length of (M1×N1) / (t×t) by the fifth-dimensional double-memorized-block chaotic system through the second group of encryption keys 21 , X 22 , X 23 , X 24 , X 25 , and selecting the sequence X 21 , X 22 , X 24 to process, and obtaining a sequence Y 21 , Y 22 , Y 24 ; wherein the formula for processing X 21 , X 22 , X 24 is ; where j = 1, 2,..., (M1xN1) / (t x t), Y 21 (j) denotes the jth sequence value in the sequence Y 21 (j) denotes the jth sequence value in the sequence Y 22 (j) denotes the jth sequence value in the sequence Y 22 (j) denotes the jth sequence value in the sequence Y 24 (j) denotes the jth sequence value in the sequence Y 24 (j) denotes the jth sequence value in the sequence Y 21 (j) denotes the jth sequence value in the sequence Y 21 (j) denotes the jth sequence value in the sequence Y 22 (j) denotes the jth sequence value in the sequence Y 22 (j) denotes the jth sequence value in the sequence Y 24 (j) denotes the jth sequence value in the sequence Y 24 (j) denotes the jth sequence value in the sequence Y; mod denotes the modulo function, and round denotes the rounding function. S52, process the sequence X 14 to obtain sequence Y 14 and matrix T; wherein the sequence X 14 is processed according to the formula: ; In the formula, abs represents the absolute value operation function, mod represents the remainder operation function, and reshape represents the function of rearranging the sequence into a matrix; S53, respectively divide the pixel matrix P 31 , P 32 , P 33 into (M1 x N1) / (t x t) sub-blocks of size t x t, and encode each sub-block according to a corresponding DNA encoding mode selected according to the value of the sequence Y 21 , and encode the matrix T by the sequence Y 21 (1) the corresponding encoding mode. S54, selecting the corresponding operation mode according to the value of sequence Y 22 , respectively, and performing DNA operation on each first sub-block of the pixel matrix P 31 , P 32 , P 33 and the matrix T to obtain three operation results, and then performing DNA operation on each encoded sub-block of the pixel matrix P 31 , P 32 , P 33 and the corresponding operation result of the previous time to obtain three final operation results. S55, according to the sequence Y 22 of values to select the corresponding decoding mode, and decode the three final operation results respectively to obtain the three block DNA operation results.
7. The image encryption method according to claim 6, characterized in that, The S6 is specifically: S61, processing sequence X 11 , X 12 , X 13 , X 14 , X 15 to obtain sequence Y 15 , Y 16 , Y 17 ; wherein the formula for processing sequence X 11 , X 12 , X 13 , X 14 , X 15 is: ; In the formula, floor represents the floor operation function, and mod represents the remainder operation function; S62, (2t+4)(4t+2) sequence values are selected from sequences Y 15 , Y 16 , Y 17 , and the selected sequence values are arranged into a matrix pad i of size (2t+4)×(4t+2); wherein the formula for arranging the selected sequence values into the matrix pad i of size (2t+4)×(4t+2) is: ; In the formula, i=5, 6, 7; reshape represents the function of rearranging the sequence into a matrix; S63, convert each decoded sub-block pixel value in the three sub-block DNA operation results into 8-bit binary form respectively and rearrange as a 2t x 4t matrix block i ; wherein each decoded sub-block pixel value in 8-bit binary form is rearranged as a 2t x 4t matrix block i The formula is: ; where i = 1, 2, 3, j = 1, 2,..., (M1 x N1) / (t x t), represents a binary sequence obtained by converting the jth decoded sub-block in the ith partial-block DNA operation result, represents the jth element in the matrix block i . S64, fill to pad i ; wherein the formula for filling to pad i is: ; S65, for filling to In For each pixel value, the sum of its six neighboring pixels (from top left to bottom right) is calculated, and the remainder is taken. Then, according to cell evolution rules, the current cell value is XORed with the remainder to obtain the initially updated cell value, thus completing the process. The initial update of all pixel values; S66, for filling to In For each initial pixel value update, following the order from bottom right to top left, the cell value is updated by calculating the sum of the values of its six neighboring pixels, taking the remainder, and then, according to cell evolution rules, XORing the cell's current value with the remainder to obtain the updated cell value, thus completing the process. The entire pixel is updated again, thus obtaining the filling update matrix; S67, extracting the center region (3:2t+2, 2:4t+1) from the padding update matrix as a new sub-block; S68, rearranging the new sub-block into 8 columns, and converting each 8-bit binary back to decimal pixel value to form a one-dimensional pixel vector; S69, reorganize the one-dimensional pixel vector into t x t decimal sub-blocks, combine all the decimal sub-blocks, and correspondingly obtain a pixel matrix P 41 , P 42 , P 43 .
8. The image encryption method of claim 1, wherein, The S7 is specifically: respectively block pixel matrix P 41 , P 42 , P 43 , and perform multi-round affine transformation operation on each sub-block to correspondingly obtain pixel matrix P 51 , P 52 , P 53 ; wherein the formula for performing multi-round affine transformation operation on each sub-block is: ; ; where i = 1, 2, 3, represents the position of a pixel before the affine transformation operation, represents the position of a pixel after the affine transformation operation, and r represents the round number of the affine transformation operation; when r is the last round number of the affine transformation operation, the pixel matrix P 4i (r) is the pixel matrix P 5i .
9. The image encryption method of claim 1, wherein, The S8 is specifically: S81, generating a sequence X of length 2xM1xN1 by the fifth-dimensional double-memorized-block chaotic system with the third group of encryption keys 31 , X 32 , X 33 , X 34 , X 35 , and selecting a sequence X 33 to obtain sequences S1 and S2 by processing; wherein the formula for processing the sequence X 33 is: ; In the formula, mod represents the remainder operation function; S82, construct multiplication table TB; wherein, multiplication table TB is represented as: ; S83, merging the layers after forward and reverse finite field diffusion according to the sequences S1, S2 and the multiplication table TB to obtain a ciphertext image; wherein the formula for performing forward and reverse finite field diffusion on the pixel matrix P 51 , 52 , 53 performing forward and reverse finite field diffusion on the pixel matrix P 51 , 52 , 53 The formula for performing forward and reverse finite field diffusion on the pixel matrix P ; ; where i = 1, 2, 3, j = 1, 2,..., M1xN1, denotes the jth sequence value in the sequence S1, denotes the jth sequence value in the sequence P 5i denotes the jth sequence value in the sequence P denotes the jth sequence value in the diffusion sequence denotes the jth sequence value in the diffusion sequence denotes the jth sequence value in the diffusion sequence denotes the jth sequence value in the diffusion sequence 10. The image encryption method of claim 1, wherein, The five-dimensional double memory resistance chaotic system is represented as: ; Wherein, x, y, z, w, u all represent state variables, a, b, c, k1, k2 all represent system parameters.
Citation Information
Patent Citations
Color image compression encryption method based on two-dimensional compressed sensing and memristor chaotic system
CN111614455A
KR20250069356A