Image Encryption Methods in Smart Grids Based on Image Pyramids and Galois Domains

By combining image pyramid and Galois field encryption methods, using a chaotic system to generate pseudo-random sequences for pixel-level and bit-level scrambling, and performing diffusion operations in the Galois field, the security risks of image information from power transmission line inspection drones are solved, achieving efficient and secure encryption.

CN116996627BActive Publication Date: 2026-11-17ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310962514.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2026-11-17
Estimated Expiration
2043-08-02

AI Technical Summary

Technical Problem

Image information collected by drones used for power transmission line inspections poses a security risk of unauthorized access, and existing encryption methods are inefficient and vulnerable to attacks.

Method used

Combining image pyramid and Galois field encryption methods, a pseudo-random sequence is generated through a chaotic system, and pixel-level and bit-level scrambling is performed. Furthermore, the diffusion operation of the Galois field is utilized to enhance encryption complexity and resistance to attacks.

Benefits of technology

It improves the security and anti-attack capabilities of image encryption, effectively resists typical attacks, and has strong robustness and noise resistance, making it suitable for the transmission and storage of information in smart grids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116996627B_ABST
    Figure CN116996627B_ABST
Patent Text Reader

Abstract

This invention proposes an image encryption method for smart grids based on image pyramids and Galois fields. The steps are as follows: image preprocessing; obtaining a chaotic sequence by combining the SHA-256 algorithm and an external key, and performing numerical processing to obtain a pseudo-random sequence; using the chaotic sequence for global index scrambling, and using the pseudo-random sequence for pixel-level scrambling based on the image pyramid structure; grouping the image matrix into sub-blocks, with each sub-block selecting DNA encoding and decoding rules according to the pseudo-random sequence; performing forward diffusion of multiplication operations in the Galois field using the pseudo-random sequence; performing reverse diffusion of addition operations in the Galois field using the pseudo-random sequence, and rearranging to obtain the encrypted image. This invention is of great significance for protecting the security of aerial images captured by UAVs for power transmission line inspection, preventing malicious attacks on the power system, protecting the trade secrets of power companies, and ensuring national energy security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of image encryption in smart grids, and more particularly to an image encryption method for smart grids based on image pyramids and Galois domains. Background Technology

[0002] Transmission lines are a critically vulnerable component of smart grids, accounting for approximately 95% of all power equipment failures. With the ever-increasing demand for electricity in modern society, the reliability and stability of transmission lines have become paramount, making the intelligentization of transmission lines a technological bottleneck in smart grid development. Traditional transmission line inspection methods face limitations and challenges, such as insufficient manpower, long inspection times, and high safety risks. Against this backdrop, drones for overhead transmission line inspection have emerged. The introduction of drones offers an efficient, safe, and economical solution. Drone inspections can cover large areas of lines in a short time, avoiding the manpower and time costs of traditional methods. Drone operation is relatively simple, allowing for remote control and monitoring by personnel, reducing the risk of personnel exposure to hazardous environments. Equipped with advanced sensors and cameras, drones can capture high-definition images and videos, providing accurate line data. This data can be used to detect line faults, wear, and potential problems early, helping power companies to take timely repair and maintenance measures, improving line reliability and stability, and ultimately enhancing grid operational efficiency.

[0003] Aerial images taken by drones used for power transmission line inspections contain critical information about existing transmission lines and equipment, such as line structure, connection methods, and power transmission capacity. Unauthorized access could be used to launch malicious attacks or engage in illegal activities against the power system. Furthermore, these aerial images may also reveal power companies' trade secrets and competitive advantages, such as the application of new technologies and equipment upgrade plans. The leakage of this information could lead to unfair competitive advantages for other companies and even threaten national energy security. Therefore, the security protection of aerial images taken by drones used for power transmission line inspections is crucial. Implementing appropriate encryption measures can ensure the security of images during transmission and storage, preventing unauthorized personnel from accessing sensitive information.

[0004] Digital images differ from text information; there is a high degree of redundancy and correlation among image pixels, making traditional encryption methods such as DES and AES difficult to apply to images. Considering the special characteristics of digital image information, scholars have proposed many image encryption schemes, such as chaos theory, DNA computing, bit-plane encryption, semi-tensor product, fractal theory, compressed sensing, and cellular automata.

[0005] Chaos theory is one of the most widely used and effective methods in image encryption. Chaotic systems, with their extreme sensitivity to initial conditions and parameters and long-term unpredictability of trajectories, align well with cryptographic theory. However, using chaotic systems alone in image encryption has some drawbacks. While highly sensitive and unpredictable, chaotic systems still have weaknesses, such as key management and the stability of encryption algorithms. To overcome these limitations and further improve encryption security and reliability, researchers have begun exploring combining chaotic systems with other encryption techniques. Galois fields, as mathematical fields, possess complex computational properties and superior resistance to attacks. By integrating chaotic systems with Galois fields, the shortcomings of using chaotic systems alone can be compensated for, providing stronger encryption protection.

[0006] Patent application number 202111028287.5 discloses a method for encrypting transmission line image data, comprising the following steps: preprocessing and pixel scrambling of the original image to obtain a first encrypted image; generating a hash value key for encrypting the image using the original image; obtaining four chaotic sequences based on the key; obtaining an encrypted digital matrix based on the key; performing DNA encoding on the encryption matrix and the first encrypted image to obtain a first encrypted matrix and a second encrypted image; performing DNA encryption operation on the first encrypted matrix and the second encrypted image and performing DNA decoding on the operation result to obtain a third encrypted image. This invention, by combining a hyperchaotic system with DNA encoding, encrypts transmission line images, which not only improves the efficiency of image encryption but also enhances its security. However, the scrambling process of this patent only uses diagonal pixel extraction, which cannot effectively eliminate the correlation between pixels and is vulnerable to statistical analysis attacks. The diffusion process uses block DNA encoding and decoding to change the pixel values ​​of the image, but the operations between sub-blocks and pixels are not related. When the pixel value of a pixel is changed, the change cannot be transmitted to the whole image, and it cannot effectively resist differential attacks. Summary of the Invention

[0007] To address the technical problems of unauthorized access, poor security, and low image encryption efficiency in images collected by UAVs for power transmission line inspection in smart grids, this invention proposes an image encryption method for smart grids based on image pyramids and Galois fields. By combining chaotic systems with Galois fields and introducing mathematical operations of Galois fields, the complexity and resistance to attacks of the encryption are enhanced.

[0008] To achieve the above objectives, the technical solution of the present invention is implemented as follows: an image encryption method for smart grids based on image pyramids and Galois domains, comprising the following steps:

[0009] Step 1: Image preprocessing: Obtain a plaintext image matrix of size M×N, calculate the maximum value in {M, N}, denote the smallest power of 2 (n) greater than or equal to the maximum value as H, construct an H×H zero matrix, replace the top-left M×N pixels of the zero matrix with the plaintext image matrix to obtain the image matrix P;

[0010] Step 2: Generate pseudo-random sequences: Use the plaintext image matrix combined with the SHA-256 algorithm and external key E to obtain the initial values ​​of the three-dimensional chaotic system. Substitute the initial values ​​into the three-dimensional chaotic system for iteration to obtain three chaotic sequences CSA, CSB, and CSC. Perform numerical processing on the chaotic sequences CSA, CSB, and CSC to obtain pseudo-random sequences CSA′, CSB′, and CSC′ for pixel-level scrambling, pseudo-random sequences CSA″ and CSB″ for DNA encoding and DNA decoding, and pseudo-random sequences CSC″ and CSB″′ for Galois field forward multiplication diffusion and reverse addition diffusion.

[0011] Step 3, pixel-level scrambling: Use the chaotic sequence CSA to perform global index scrambling on the image matrix P to obtain the image sequence S1, and rearrange the image sequence S1 into the image matrix M1; then use the pseudo-random sequences CSA′, CSB′, and CSC′ to perform pixel-level scrambling on the image matrix M1 based on the image pyramid structure to obtain the image matrix M2.

[0012] Step 4, DNA bit-level scrambling: Divide the image matrix M2 into (H×H) / 2 sub-blocks based on the H×H image matrix M2; each sub-block selects DNA encoding and DNA decoding rules according to the pseudo-random sequences CSA″ and CSB″ respectively to perform DNA encoding and DNA decoding, thus obtaining the image matrix M3;

[0013] Step 5, Galois Domain Diffusion: First, the scrambled image matrix M3 is diffused forward by performing Galois domain multiplication using the pseudo-random sequence CSC″ to obtain a one-dimensional sequence S2; then, the one-dimensional sequence S2 is diffused backward by performing Galois domain addition using the pseudo-random sequence CSB″ to obtain a one-dimensional image sequence S3.

[0014] Step 6: Rearrange the one-dimensional sequence S3 into an H-order square matrix to obtain the ciphertext image C, thus completing the entire encryption process.

[0015] Preferably, the method for obtaining the initial value of the three-dimensional chaotic system is as follows: the plaintext image matrix is ​​processed by the SHA-256 algorithm to obtain the key K, and the key K is sequentially subjected to addition, multiplication and scrambling operations in the Galois field and external key {e1, e2, e3} to obtain the initial value of the three-dimensional chaotic system. The initial value is then substituted into the three-dimensional chaotic system for iteration to obtain three chaotic sequences CSA, CSB and CSC.

[0016] Preferably, the method for generating the pseudo-random sequences CSA′, CSB′, and CSC′ is as follows:

[0017]

[0018] The method for generating the pseudo-random sequences CSA″ and CSB″ is as follows:

[0019]

[0020] The method for generating the pseudo-random sequences CSC″ and CSB″′ is as follows:

[0021]

[0022] Here, floor() is the floor function; mod() represents the modulo operation; CSA(1:n), CSB(1:n), and CSC(1:n) represent the first n elements of the chaotic sequences CSA, CSB, and CSC, respectively.

[0023] Preferably, the method for scrambling the global index is as follows: first, rearrange the image matrix P column-wise to obtain a one-dimensional image sequence S. 11 Then, the chaotic sequence CSA is sorted in ascending or descending order to obtain the index sequence Index of the chaotic sequence CSA. Based on the index sequence Index, the one-dimensional image sequence S is... 11 The image sequence S1 is obtained by index scrambling.

[0024] Preferably, the pixel-level scrambling method based on the image pyramid structure is as follows: the image matrix M1 is sampled down layer by layer, and the DNA coding rule or triploid mutation rule of the DNA position coordinate base of each layer is determined by the pseudo-random sequence CSC′, and the position of the plaintext image pixel in all n layers of the image is recorded; then the DNA coding rule of each layer is determined by the pseudo-random sequence CSA′, and the DNA operation mode is determined by the pseudo-random sequence CSB′ to realize the scrambling of the plaintext image pixel position in each layer of the image; finally, the image is sampled up according to the scrambled position until the resolution of the image layer is the same as the resolution of the image matrix M1.

[0025] Preferably, the pixel-level scrambling step based on the image pyramid structure is as follows:

[0026] Step 1: Determine the position basis of each layer: The position basis of each image layer is a second-order square matrix A. i This indicates that the DNA coding rules or triploid mutation rules of each layer of the substrate are determined by the pseudo-random sequence CSC′;

[0027] Step 2: Determine the DNA key D for each image layer iEncoding rules: The DNA key is used to scramble the coordinates of plaintext image pixels in each image layer; the elements in the pseudo-random sequence CSA′ are converted into eight-bit binary numbers. Where j = 1, 2, ..., 8 are binary bit indices, and i = 1, 2, ..., n are image layer indices; The number of "1"s determines the value of the i-th layer of DNA key, denoted as V. i ; The three-digit binary number, when converted to decimal, determines the encoding rule R for the i-th layer. i Determine the highest bit Whether the value is "1" determines whether a triploid mutation has occurred in the DNA key of the i-th layer; the value V... i and encoding rule R i Determine DNA key D i ;

[0028] Step 3: Plaintext image layer cyclic shift: Let N be the displacement number of the plaintext image layer corresponding to the i-th image layer. i First, the plaintext image layer is shifted right for even-numbered rows and left for odd-numbered rows. The resulting image matrix after the row shifts is denoted as BR. i Then, for the image matrix BR i The even-numbered columns are shifted upwards and the odd-numbered columns are shifted downwards. The resulting image matrix after the column shifts is denoted as B. i ;

[0029] Step 4: Downsampling to determine the position coordinates of plaintext image pixels in each image layer: The plaintext image position coordinates of the i-th layer are determined by the image matrix B. i Image matrix B is obtained by downsampling. i Sampling down layer by layer until the i-th layer, based on the position of the i-th layer as the base A i Determine the position coordinates of each pixel in the plaintext image at layer i; repeat this process until the plaintext position coordinate matrix corresponding to all n layers of the image is determined, denoted as C. i , i = 1, 2, ..., n;

[0030] Step 5: Scramble the position coordinates: Determine the DNA key D for each layer using the value of the pseudo-random sequence CSB′. i With position coordinates C i The operation method, the DNA encoding method in the DNA operation process is determined by the encoding rule R. i The scrambled position coordinate matrix of the plaintext image in each layer of the image is denoted as E. i ;

[0031] Step 6: Upsampling: Starting from the image layer (n+1 layers) with a resolution of only one pixel in the image pyramid structure, upsampling is performed using the scrambled position coordinate matrix E of the i-th layer.i and location base A i Together, determine the position of each pixel in the plaintext image when it is upsampled from layer i+1 to layer i; repeat this process until the resolution of the image layer is the same as the resolution of the plaintext image layer, and obtain the pixel-level scrambled graph matrix M2.

[0032] Preferably, after downsampling from layer k to layer k+1, the plaintext image pixels stored in each 2×2 pixel block in layer k are stored in one pixel in layer k+1, that is, the plaintext image pixels stored in the 2×2 pixel block in layer k have the same position coordinates in layer k+1; after upsampling from layer k to layer k-1, each pixel in layer k is expanded into a 2×2 pixel block in layer k-1, and the plaintext image pixels stored in the pixel in layer k are correspondingly allocated to the four pixels expanded from that pixel.

[0033] Preferably, the method for implementing the DNA bit-level scrambling is as follows: taking two adjacent pixels in the image matrix M2 as a sub-block, decomposing the image matrix into eight bit planes, and combining the bit planes of two pixels in each sub-block to obtain eight sets of binary sequences. DNA sequences are obtained by encoding DNA using a pseudo-random sequence CSA″ and decoding DNA using a pseudo-random sequence CSB″. Eight new binary sequences are obtained by decomposing the newly obtained binary sequences and recombining them into two-pixel bit planes to obtain sub-block scrambled pixels, thus obtaining the DNA bit-level scrambled image matrix M3.

[0034] Preferably, the Galois domain GF(2) 8 The forward diffusion method for multiplication operations within the image is as follows: traverse the pseudo-random sequence CSC″ and replace pixels with a value of "0" with the value obtained by modulo operation of the pixel position index m to obtain the replaced pseudo-random sequence CSC″′; traverse the pseudo-random sequence CSC″′ again and replace the values ​​of elements with a value of "0" with the value of the external key e4; rearrange the image matrix M3 to obtain the one-dimensional image sequence S′2; use the replaced pseudo-random sequence CSC″′ to perform multiplication operations within the Galois field on the pixels in the image sequence S′2 with a value that is not "0" to obtain the image sequence S2.

[0035] The Galois domain GF(2) 8 The reverse diffusion of the addition operation is: performing an addition operation within the Galois field on the pseudo-random sequence CSB″′ and the corresponding elements in the image sequence S2.

[0036] Preferably, the image sequence S2 is

[0037]

[0038] The one-dimensional sequence S3 is

[0039]

[0040] in, For Galois domain GF(2) 8 Multiplication operations within () are performed, where m = 1, 2, ..., H×H is the sequence position index;

[0041] The addition operation in the Galois field is an XOR operation;

[0042] Galois Domain GF(2) 8 The multiplication operation of ) is implemented using the table lookup method as follows:

[0043]

[0044] Where a and b are both Galois domains GF(2). 8 The elements within ) are gfilog and gflog, which are the positive and negative multiplication tables generated by the primitive polynomial, respectively, and mod() represents the modulo operation;

[0045] The scrambling process of the external keys {e1, e2, e3} involves adding the external keys e1, e2, and e3 to the calculated initial parameters of the three-dimensional chaotic system to obtain the initial values ​​of the three-dimensional chaotic system.

[0046] Compared with existing technologies, the beneficial effects of this invention are: pixel-level scrambling is achieved based on image pyramid structure combined with chaos theory, and the Galois domain GF(2) is used. 8 The multiplication operation within the domain achieves efficient and secure diffusion, and the drawback of pixels with a value of "0" not being able to participate in the operation is compensated for by using block DNA random cross-coding and inverse Galois domain addition. Experimental results verify the feasibility and effectiveness of the invention. Security analysis results show that the invention can resist typical attacks and has strong robustness, better resistance to noise and data loss, and can be applied to the transmission and storage of smart grid information. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a schematic diagram of the process of the present invention.

[0049] Figure 2 This is a schematic diagram of the image pyramid structure.

[0050] Figure 3 for Figure 2 A schematic diagram of the transformation relationship between adjacent image layers.

[0051] Figure 4 This is a schematic diagram of the key structure of the present invention.

[0052] Figure 5 This is a schematic diagram of the scrambling of a fourth-order square matrix based on an image pyramid structure according to the present invention.

[0053] Figure 6 This is a schematic diagram of DNA hierarchical scrambling in this invention.

[0054] Figure 7 The images obtained by simulation in this invention are the encryption and decryption results, where (a) is a transmission line image, (b) is the ciphertext image of (a), (c) is the decrypted image of (a), (d) is a tower image, (e) is the ciphertext image of (d), (f) is the decrypted image of (d), (g) is a Lena image, (h) is the ciphertext image of (g), (i) is the decrypted image of (g), (j) is a Boat image, (k) is the ciphertext image of (j), (l) is the decrypted image of (j), (m) is a Cameraman image, (n) is the ciphertext image of (m), (o) is the decrypted image of (m), (p) is a FullBlack image, (q) is the ciphertext image of (p), and (r) is the decrypted image of (p).

[0055] Figure 8 This is a schematic diagram of the key sensitivity test results of the present invention, where (a) is the correct key and (b) is e1+10. -14 (c) is e² + 10 -14 (d) is e3+10 -14 .

[0056] Figure 9Histograms of the plaintext and ciphertext images of this invention are shown below, where (a) is a transmission line image, (b) is the histogram of (a), (c) is the ciphertext image of (a), (d) is the histogram of (c), (e) is a tower image, (f) is the histogram of (e), (g) is the ciphertext image of (e), (h) is the histogram of (g), (i) is a Lena image, (j) is the histogram of (i), (k) is the ciphertext image of (i), and (l) is the histogram of (k). (m) is the histogram of (m), (n) is the histogram of (m), (o) is the ciphertext image of (m), (p) is the histogram of (o), (q) is the Cameraman image, (r) is the histogram of (q), (s) is the ciphertext image of (q), (t) is the histogram of (s), (u) is the Cameraman image, (v) is the histogram of (u), (w) is the ciphertext image of (u), and (x) is the histogram of (w).

[0057] Figure 10 This is a schematic diagram of the adjacent pixel correlation between Lena and Boat in this invention, wherein (a) is the horizontal correlation of Lena, (b) is the vertical correlation of Lena, (c) is the diagonal correlation of Lena, (d) is the horizontal correlation of the Lena ciphertext image, (e) is the vertical correlation of the Lena ciphertext image, (f) is the diagonal correlation of the Lena ciphertext image, (g) is the horizontal correlation of Boat, (h) is the vertical correlation of Boat, (i) is the diagonal correlation of Boat, (j) is the horizontal correlation of the Boat ciphertext image, (k) is the vertical correlation of the Boat ciphertext image, and (l) is the diagonal correlation of the Boat ciphertext image.

[0058] Figure 11 This is a schematic diagram of the plaintext and ciphertext images of Lena and the modified Lena of the present invention, wherein (a) is the Lena image, (b) is the ciphertext image of (a), (c) is the modified Lena image, and (d) is the ciphertext image of (a).

[0059] Figure 12 This is a schematic diagram of the noise attack and decryption results of the present invention, wherein (a) is 0.01 salt-and-pepper noise, (b) is 0.05 salt-and-pepper noise, (c) is 0.10 salt-and-pepper noise, (d) is the decrypted image of (a), (e) is the decrypted image of (b), and (f) is the decrypted image of (c).

[0060] Figure 13This is a schematic diagram of the cropping attack and decryption results of the present invention, wherein (a) is a 1 / 16 crop, (b) is a 1 / 8 crop, (c) is a 1 / 4 crop, (d) is a 1 / 2 crop, (e) is the decrypted image of (a), (f) is the decrypted image of (b), (g) is the decrypted image of (c), and (h) is the decrypted image of (d). Detailed Implementation

[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] like Figure 1 As shown, an image encryption method for smart grids based on image pyramids and Galois domains is mainly divided into five parts: image preprocessing, pseudo-random sequence generation, pixel-level scrambling, bit-level scrambling based on DNA encoding, and Galois domain-based diffusion. The image preprocessing stage processes images of different sizes into square matrices that meet the encryption method requirements. The pseudo-random sequence generation stage uses the SHA-256 algorithm to process the plaintext image to obtain a key K. The key K is then processed using Galois domain multiplication, XOR operations, and external key scrambling to obtain the initial parameters of the three-dimensional chaotic system. The chaotic sequence is obtained by solving for the initial parameters, and then appropriately processed to obtain a pseudo-random sequence for plaintext image encryption. The pixel-level scrambling stage first uses a pseudo-random sequence for global index scrambling, and then uses a new scrambling method based on the image pyramid structure to complete pixel-level scrambling. The bit-level scrambling stage based on DNA encoding performs DNA cross-coding and decoding on the binary data between different bit planes of adjacent pixels to achieve image encryption. The Galois domain diffusion stage uses the Galois domain GF(2) to perform random encoding and decoding on the binary data between different bit planes of adjacent pixels. 8 The diffusion of an image is achieved using forward multiplication and reverse addition operations. The steps of this invention are as follows:

[0063] Step 1: Image preprocessing: Obtain the plaintext image matrix of size M×N, calculate the maximum value in {M, N}, denote the smallest power of 2 (n) greater than or equal to the maximum value as H, construct the zero matrix H×H, replace the top left M×N pixels of the zero matrix with the plaintext image matrix to obtain the image matrix P.

[0064] Because this invention uses an image pyramid structure for scrambling, preprocessing of plaintext images of different sizes is required. This is achieved by filling the edges of the plaintext image with pixels having a value of "0", thus processing the plaintext image to have a side length of 2. n Let H be a square matrix, and denote the side length of the square matrix as H = 2.n The formula for calculating the exponent n is:

[0065] n = ceil(log2(max(M, N)) (1)

[0066] Where M and N are the number of rows and columns of the plaintext image before preprocessing, respectively, ceil() is the rounding up function, max() is the maximum value selection function, and log2() is the logarithm to the base 2.

[0067] Step 2: Generate pseudo-random sequences: Using a plaintext image matrix combined with the SHA-256 algorithm and an external key E, chaotic sequences CSA, CSB, and CSC are obtained. Specifically, the plaintext image matrix is ​​processed using the SHA-256 algorithm to obtain key K. Galois multiplication, XOR operation, and scrambling of key K with external key E are performed to obtain the initial value of the three-dimensional chaotic system. The initial value is then substituted into the three-dimensional chaotic system for iteration to obtain three chaotic sequences. The chaotic sequences CSA, CSB, and CSC are numerically processed to obtain pseudo-random sequences CSA′, CSB′, and CSC′ for pixel-level scrambling, pseudo-random sequences CSA″ and CSB″ for DNA encoding and DNA decoding, and pseudo-random sequences CSC″ and CSB″′ for forward multiplication diffusion and reverse addition diffusion in the Galois domain.

[0068] This invention uses the three-dimensional chaotic system proposed by Sambas to generate the chaotic sequence required for encryption. The mathematical expression of the three-dimensional chaotic system is:

[0069]

[0070] Where x, y, and z are state parameters. denoted as the derivatives of the state parameters x, y, and z, respectively, and μ and σ are the control parameters. The three-dimensional chaotic system is in a chaotic state when μ = 2.6 and σ = 1.5.

[0071] A Galois field, also known as a finite field, contains only a finite number of elements. Galois fields satisfy the closure property of operations, meaning that after adding or multiplying elements a and b in a Galois field, the result c is still an element within that Galois field. The Galois field GF(p) is defined by adding a modulo operation to the operational rules of the real number field, making the elements of GF(p) {0, 1, 2, ..., p-1}, and guaranteeing the closure property of operations within GF(p), as shown in equations (3) and (4).

[0072] mod(a+b,p)=c (3)

[0073] mod(a×b,p)=c (4)

[0074] Here, "+" and "×" represent addition and multiplication operations in the real number field, respectively. mod() represents the modulo operation.

[0075] To ensure that all elements except 0 in the Galois field GF(p) have multiplicative inverses, thus satisfying the basic requirement for constructing a Galois field, p must be a prime number. However, the number of gray levels in an image is not always exactly a prime number. For an 8-bit grayscale image, the pixel values ​​are {0, 1, 2, ..., 255}. The gray level 256 is not a prime number, thus it is impossible to construct a Galois field GF(p) with elements {0, 1, 2, ..., 255}. The largest prime number less than 256 is 251. If data greater than or equal to 251 is truncated to 250, some data will be lost, making image inverse reconstruction impossible. To solve this problem without loss of generality, the Galois field GF(2πf / 2πf) is used. 8 This method processes 8-bit grayscale images with elements {0, 1, 2, ..., 255}, solving the problem of data loss during Galois field-based GF(251) operations. To meet the basic requirements for constructing a Galois field, the Galois field GF(251) is used. 8 Addition on a number uses the XOR operation, and multiplication uses polynomial operations, as follows:

[0076]

[0077]

[0078] Where f(w) is the primitive polynomial and w is the independent variable of the primitive polynomial. This represents polynomial multiplication. This represents the XOR operation.

[0079] Choose the primitive polynomial as f(w) = w 8 +w 4 +w 3 +w 2 +1, in order to accelerate the process in the Galois domain GF(2) 8 The speed of multiplication and division in GF(2) was determined by generating a positive multiplication table (Table 1) and a negative multiplication table (Table 2) based on the primitive polynomial f(w), denoted as gflog and gfilog respectively. The Galois domain GF(2) can be quickly calculated using the lookup table method according to equations (7) and (8). 8 Multiplication and division operations within 10 ...

[0080]

[0081] a÷b=gfilog(mod((gflog(a)-gflog(b)+255),255)) (8)

[0082] For example, we now use a lookup table method to find the Galois field GF(2) of the above primitive polynomial f(x). 8 ) calculation within The calculation process is as follows:

[0083]

[0084] Table 1. Galois domain GF(2) of f(w) 8 The positive multiplication table gflog

[0085]

[0086] Table 2. Inverse table of GF(28) multiplication of f(w) gfilog

[0087]

[0088] DNA is composed of four deoxyribonucleotides carrying different bases: adenine (A), thymine (T), cytosine (C), and guanine (G). The base pairs AT and CG are complementary. Similarly, 00-11 and 01-10 in binary data are complementary, thus the two binary numbers 00, 11, 01, and 10 can be encoded as four different deoxyribonucleotides. Table 3 shows eight DNA encoding rules that satisfy the complementary pairing rule.

[0089] With the development of DNA computing, DNA-based biological and algebraic operations have been proposed and widely applied to DNA-based image encryption. Different DNA encoding rules correspond to different operation rules. Table 3 selects encoding rule 1, and Table 4 shows the operation rules for DNA addition, subtraction, XOR, and XNOR.

[0090] Yu proposed the concept of DNA triploid mutation, pointing out that while chromosome mutations occur in organisms in nature, only triploid mutations satisfy the complementary pairing rules of nucleotide bases, and applied this to image encryption methods. Based on the encoding rules in Table 3, Table 5 shows the corresponding operational rules for triploid mutations.

[0091] Table 3. DNA Encoding Rules

[0092]

[0093] Table 4. DNA base manipulation

[0094]

[0095]

[0096] Table 5. Triploid Mutation Rules

[0097]

[0098] The key of this invention consists of two parts: a key K generated by combining the SHA-256 algorithm with a plaintext image, and an external key E agreed upon in advance by both the encryption and decryption parties. The external key {e1, e2, e3} ranges from (0, 0.0039), and the external key e4 ranges from {1, 2, ..., 255}. The key structure is as follows: Figure 4 As shown, the key K = {k1,k2,…,k} 32 The external key E is set before the external key E, and the external key e4 is set after the external key E.

[0099] To associate the generated pseudo-random sequence with the plaintext image, thereby effectively resisting chosen-plaintext attacks, the SHA-256 algorithm is introduced into the cryptographic system. To further enhance the security of the pseudo-random sequence, Galois field multiplication, XOR operations, and an external key are incorporated into the design of the initial values ​​for the three-dimensional chaotic system.

[0100] The specific process for generating pseudo-random sequences is as follows:

[0101] Step 1: Generate a 64-bit hexadecimal number by combining the plaintext image with the SHA-256 algorithm.

[0102] Step 2: Convert the 64-bit hexadecimal number into 32 decimal numbers, grouping them into pairs of two, and replace any 0s with 128. This is denoted as the key K = { \ ,k1,…,k 32}

[0103] Step 3: Obtain the initial parameter x by performing an XOR operation on the key K. 011 y 011 z 011 w 011 The specific calculation method is as follows:

[0104]

[0105] Step 4: Using the key K and initial parameter x 011 y 011 z 011 w 011 The initial numbers α, β, γ, and δ are obtained by multiplication operations on the Galois field and addition operations on the real number field, respectively. The initial numbers α and β are derived from the Galois field GF(2). 8 The initial numbers γ and δ are obtained by multiplication over the real number field, as shown in equation (10). The initial numbers γ and δ are obtained by addition over the real number field, as shown in equation (11).

[0106]

[0107] Where “×” represents the Galois domain GF(2). 8 Multiplication is performed on the real number field, and division is performed on the real number field.

[0108]

[0109] Step 5: Obtain the unperturbed initial values ​​of the three-dimensional chaotic system through operations between the initial numbers α, β, γ, and δ:

[0110]

[0111] Step 6: Obtain the initial values ​​of the three-dimensional chaotic system. Introduce an external key E = {e1, e2, e3} to perturb the initial values ​​x0, y0, and z0 of the three-dimensional chaotic system. The perturbed initial values ​​of the three-dimensional chaotic system are denoted as x′0, y′0, and z′0, as shown in equation (13).

[0112]

[0113] Step 7: Generate chaotic sequences. Substitute the obtained scrambled initial values ​​x′0, y′0, and z′0 of the three-dimensional chaotic system into the three-dimensional chaotic system, and solve equation (1) using the fourth-order Runge-Kutta method to obtain 1000+H×H iteration results. To avoid transient interference, discard the results of the first 1000 iterations. Finally, obtain three chaotic sequences CSA, CSB, and CSC with a length of H×H.

[0114] Step 8: Obtain pseudo-random sequences. The first n terms of the chaotic sequences CSA, CSB, and CSC are calculated using equation (14) to obtain pseudo-random sequences CSA′, CSB′, and CSC′ applicable to pixel-level scrambling. The chaotic sequences CSA and CSB are calculated using equation (15) to obtain pseudo-random sequences CSA″ and CSB″ applicable to DNA encoding and DNA decoding, respectively. The chaotic sequences CSC and CSB are calculated using equation (16) to obtain pseudo-random sequences CSC″ and CSB″′ applicable to forward multiplicative diffusion and reverse additive diffusion in the Galois domain, respectively. This process brings the range of values ​​of the chaotic sequences within the range required for encryption without losing the pseudo-randomness of the chaotic sequences.

[0115]

[0116] The exponent n can be calculated from equation (1), and floor() is the floor function.

[0117]

[0118]

[0119] Step 3, pixel-level scrambling: First, use the chaotic sequence CSA to perform global index scrambling on the image matrix P to obtain the image sequence S1, and then rearrange the image sequence S1 into the image matrix M1; then use the pseudo-random sequences CSA′, CSB′, and CSC′ to perform pixel-level scrambling on the image matrix M1 based on the image pyramid structure to obtain the image matrix M2.

[0120] The pixel-level scrambling in this invention is divided into two stages: global index scrambling and a new scrambling method based on the image pyramid structure.

[0121] The global index scrambling first rearranges the plaintext image matrix P column-wise to obtain a one-dimensional image sequence S1. Then, as shown in equation (17), the ascending index sequence Index of the chaotic sequence CSA is obtained, and the one-dimensional image sequence S1 is indexed and scrambled according to the index sequence. After index scrambling, the image sequence is rearranged into an H-order square matrix M1.

[0122] Index = sort(CSA) (17)

[0123] The sort() function returns a sequence of indices in ascending order.

[0124] If only global index scrambling is used in pixel-level scrambling, the encryption algorithm will have low security and be easily analyzed and cracked by attackers. If an attacker obtains the three-dimensional chaotic system used by the encryption algorithm and its initial values, they can recover the chaotic sequence and crack the encryption algorithm. Inspired by the image pyramid structure, this invention proposes a new pixel-level scrambling method that can effectively enhance the security of the encryption method.

[0125] Image pyramids are an important structure for multi-scale image representation. By downsampling and upsampling the image, image layers of different resolutions are obtained, with higher-resolution layers located at the bottom and lower-resolution layers at the top. When the sampling factor is 2, the resolution of the upper-layer image is one-quarter of that of its adjacent lower-layer image, thus forming an image pyramid, as shown below. Figure 2 As shown.

[0126] In an image pyramid structure, downsampling reduces the image resolution to one-quarter of the previous layer. This means that with each downsampling layer, each 2x2 pixel block in the previous layer is processed into a single pixel. Upsampling, on the other hand, processes each pixel in the previous layer into a 2x2 pixel block. For example... Figure 3 The relationship between adjacent layers of images in the image pyramid structure is given, and pixels of the same color indicate a transformation relationship between adjacent layers.

[0127] Inspired by the downsampling and upsampling processes of image pyramids, the scrambling method proposed in this invention first downsamples the plaintext image layer by layer and records the position of the plaintext image pixels in all n layers of the image, where n is calculated by equation (1). Then, pseudo-random sequences, DNA encoding, and DNA operations are used to scramble the positions of the plaintext image pixels in each layer. Finally, upsampling is performed according to the scrambled positions until the resolution of the image layer is the same as the resolution of the plaintext image, completing the entire pixel-level scrambling process.

[0128] To achieve better scrambling results, the pixel positions of plaintext images in different image layers are obtained by downsampling different image matrices derived from the plaintext images after cyclic shifting. This reduces the correlation between adjacent pixels, and the positional basis in each image layer changes randomly, enhancing the security of the encryption method. The specific scrambling method is as follows:

[0129] Step 1: Determine the positional basis of each layer. The positional basis of each image layer is represented by four different DNA bases. Let the numerical basis of the plaintext image layer be a second-order square matrix A, as shown in Equation (18). The positional basis of each image layer is represented by a second-order square matrix A. i The diagram shows that A1 represents the location base of the plaintext image layer. The DNA coding rule or triploid mutation rule of each location base is determined by the pseudo-random sequence CSC′, and the specific expression is shown in equation (19).

[0130]

[0131]

[0132] Where i = 1, 2, ..., n are the indices of the image layers; encoder(d, e) is the DNA encoding function, d is the encoded value, and e is the DNA encoding rule selected in Table 3; mutation(f, g) is the triploid mutation function, f is the DNA before mutation, and g is the triploid mutation rule selected in Table 5.

[0133] Step 2: Determine the DNA key and encoding rules for each layer. The DNA key is used to scramble the position coordinates of plaintext image pixels in each image layer, denoted as D. i Convert the elements of the pseudo-random sequence CSA′ into an eight-bit binary number, denoted as . Where j = 1, 2, ..., 8 are binary bit indices, and i = 1, 2, ..., n are image layer indices. The number of "1"s determines the value of the i-th layer of DNA key, denoted as V. i ; The three-bit binary number, converted to decimal, determines the encoding rule for the i-th layer, denoted as R. iDetermine the highest bit Whether the value is "1" determines whether a triploid mutation occurs in the DNA key of the i-th layer. The DNA key calculation formula is shown in equation (20).

[0134]

[0135] Where i = 1, 2, ..., n are the image layer indices.

[0136] Step 3: Circular shifting of the plaintext image layer. Let N be the displacement amount of the plaintext image layer corresponding to the i-th image layer. i The value is determined by equation (21). First, the plaintext image layer is shifted to the right for even rows and to the left for odd rows according to equation (22). The image matrix after the row shift is denoted as BR. i Then, according to equation (23), the even-numbered columns are shifted upwards and the odd-numbered columns are shifted downwards. The resulting image matrix after the column shifts is denoted as B. i .

[0137]

[0138]

[0139]

[0140] Where i = 1, 2, ..., n are the image layer indices, h = 1, 2, ..., H are the row and column indices of the image matrix, M1 is the image matrix obtained after global index scrambling, and circshift() is the circular shift function.

[0141] Step 4: Downsampling to determine the position coordinates of plaintext image pixels in each image layer. After downsampling from layer k to layer (k+1), the plaintext image pixels stored in each 2×2 pixel block in layer k will be stored in one pixel in layer (k+1). That is, the plaintext image pixels stored in the 2×2 pixel blocks in layer k will have the same position coordinates in layer (k+1). The plaintext image position coordinates of the image in layer i are determined by the image matrix B. i Obtained by downsampling, i = 1, 2, ..., n. The image matrix B... i Sampling down layer by layer until the i-th layer, based on the position of the i-th layer as the base A i Determine the position coordinates of each pixel in the plaintext image at layer i. Repeat this process until the plaintext position coordinate matrix corresponding to all n layers of the image is determined, denoted as C. i , i = 1, 2, ..., n.

[0142] Step 5: Scramble the position coordinates. Determine the DNA key D for each layer using the value of the pseudo-random sequence CSB′. i With position coordinates C iThe operation method is defined as follows: "1" represents DNA addition, "2" represents DNA subtraction, "3" represents DNA XOR, and "4" represents DNA XOR. The encoding method in the DNA operation process is determined by the encoding rule R obtained in step 2. i Confirmed. The scrambled position coordinate matrix of the plaintext image in each layer of the image is denoted as E. i , i = 1, 2, ..., n.

[0143] Step 6: Upsampling. After upsampling from layer k to layer (k-1), each pixel in layer k is expanded into a 2×2 pixel block in layer (k-1), and the plaintext image pixels stored in the pixel of layer k are correspondingly allocated to the four pixels expanded from that pixel. The upsampling process starts from the image layer (n+1) with a resolution of only one pixel in the image pyramid structure. The position coordinate matrix E after scrambling in layer i is... i and location base A i Together, we determine the position of each pixel in the plaintext image when it is upsampled from layer i+1 to layer i. This process is repeated until the resolution of the image layer is the same as the resolution of the plaintext image layer, resulting in a pixel-level scrambling matrix M2, thus completing the entire scrambling process.

[0144] For ease of understanding, such as Figure 5 The following is an example of the scrambling process for a fourth-order square matrix. From equation (1), we know that the fourth-order square matrix n = 2, therefore, a total of 2 image layers are needed. The DNA keys obtained from the pseudo-random sequence are D1 = T and D2 = G. The DNA encoding rules are R1 = 7 and R2 = 5. The first layer of the DNA operation rules is XOR, and the second layer is subtraction. The position bases are respectively... Figure 5 As shown in the middle positions of bases A1 and A2, Figure 5 Different colors are used to represent different DNA bases.

[0145] like Figure 5As shown, the displacement is calculated according to equation (21), and row and column displacements are performed on the plaintext image M1 to obtain image matrices B1 and B2 respectively. Based on image matrices B1 and B2, the plaintext image position coordinate matrices C1 and C2 of the first and second layers can be obtained from the corresponding position bases A1 and A2 respectively. Taking the acquisition of the position coordinates of the second layer plaintext image as an example, the image matrix B2 is located in the first layer of the image pyramid. To obtain the plaintext image position coordinates of the second layer, the image matrix B2 needs to be downsampled to the second layer. After one downsampling, the pixels 16, 2, 5, and 11 in the first layer are located in one pixel in the second layer. Similarly, the other twelve pixels in the first layer are located in groups of four in the other three pixels of the second layer. The coordinate bases corresponding to the position base A2 determine the position coordinates of the plaintext pixels in the second layer, that is, the upper left corner is C, the upper right corner is G, the lower left corner is T, and the lower right corner is A. Based on the DNA encoding and operation rules of layers 1 and 2, the position coordinate matrices C1 and C2 are subjected to DNA operations with their corresponding DNA keys to obtain the scrambled position coordinate matrices E1 and E2, thus completing the scrambling of the position coordinate matrices for each layer. The upsampling process begins at layer 3, which contains only one pixel and includes all plaintext pixels. During the upsampling process to obtain layer 2, the plaintext image pixels in layer 3 are divided into four groups according to the position coordinates of position coordinate matrix E2. Then, the layer 2 matrix is ​​determined according to the orientation corresponding to the position coordinates in position base A2. For matrix The four pixels in the matrix are grouped and positioned according to the position coordinate matrix E1 and the position basis A1 in the above manner to obtain the final scrambling matrix M2.

[0146] Step 4, DNA bit-level scrambling: Divide the image matrix M2 into groups, with two adjacent pixels forming a group, and divide the H×H image matrix M2 into (H×H) / 2 sub-blocks; for each sub-block, select the DNA encoding rule and DNA decoding rule according to the pseudo-random sequences CSA″ and CSB″ respectively to perform DNA bit-level scrambling, and complete the DNA bit-level scrambling of all sub-blocks to obtain the image matrix M3.

[0147] Bit-level scrambling can not only scramble the position of pixels on the bit plane, but also change the value of pixels, thus compensating for the inability to diffuse pixels with a value of "0" when using Galois field multiplication for diffusion. To achieve better scrambling results, a cross-bit plane DNA encoding combination method is used. After pixel-level scrambling, pseudo-random sequences CSA″ and CSB″ are used to select the encoding and decoding methods for DNA encoding and decoding, thereby changing the image pixel value.

[0148] The image matrix M2 is divided into (H×H) / 2 sub-blocks by treating two adjacent pixels as a single sub-block. The image matrix is ​​further decomposed into eight bit planes. The bit planes of two pixels within each sub-block are cross-combined to obtain eight binary sequences, denoted as... The specific combination method is shown in equation (24). Then, according to the different encoding and decoding methods selected by the pseudo-random sequence, the eight sets of binary sequences of each sub-block are DNA encoded and decoded to obtain the image matrix M3 after DNA bit-level scrambling.

[0149]

[0150] Among them, B l (1,j) and B l (2, j) represent the values ​​of the upper and lower pixel points in the l-th sub-block, respectively. The sub-block index is j, and the bit-plane index is j = 1, 2, ..., 8.

[0151] like Figure 6 Without loss of generality, the proposed DNA bit-level scrambling method is illustrated using one sub-block as an example. {99, 18} is a sub-block, and these two pixel values ​​are decomposed to obtain eight bit planes. According to equation (24), different bit planes of these two pixels are cross-combined to obtain eight sets of binary sequences. The encoding rule selected by the pseudo-random sequence CSA″ is rule 1, encoding to obtain the DNA sequence {AAGTGACG}. The decoding rule selected by the pseudo-random sequence CSB″ is rule 4, decoding to obtain eight new binary sequences, denoted as {Y′1, Y′2, ..., Y′8}. The newly obtained binary sequences are decomposed to reassemble the bit planes of the two pixels. The decomposition process is the reverse of the combination process. The specific decomposition method for this sub-block is shown in equation (25). Finally, the binary numbers are converted to decimal numbers to obtain the scrambled pixel values ​​{72, 57} of this sub-block.

[0152]

[0153] Where B′(1,j) and B′(2,j) are the values ​​of the eight bit planes after decoding the upper and lower two pixels, respectively, and j = 1, 2, ..., 8 are the bit plane indices.

[0154] Step 5, Galois domain diffusion: In the Galois domain GF(2 8 The method of forward and reverse diffusion in ) is as follows. First, the scrambled image matrix M3 is subjected to Galois domain GF(2) using a pseudo-random sequence CSC″. 8 The forward diffusion of multiplication within the first digit is used to obtain a one-dimensional sequence S2; then, the one-dimensional sequence S2 is subjected to Galois field GF(2) using a pseudo-random sequence CSB″. 8The reverse diffusion of the addition operation yields a one-dimensional image sequence S3.

[0155] The diffusion of image pixels is divided into two stages, namely, using the Galois domain GF(2) 8 The forward diffusion stage of multiplication operations within GF(2) and the use of GF(2) 8 The reverse diffusion stage of addition operations. A special processing method alters the portion of the pseudo-random sequence CSC″ in the forward diffusion where the values ​​are "0". This is achieved through the Galois domain GF(2) in the reverse diffusion. 8 The addition operation within the image allows pixels with a value of "0" that are ignored during the forward diffusion process to be diffused, thus enhancing the diffusion effect of the image.

[0156] Forward diffusion: Input the scrambled image matrix M3 and the pseudo-random sequence CSC″ to obtain the forward-diffused one-dimensional sequence S2.

[0157] Step 1: Traverse the pseudo-random sequence CSC″, find the pixel with a value of "0" in the sequence, and replace the pixel value of the pixel with the value obtained by modulo operation of the pixel's position index m. The replaced pseudo-random sequence CSC″′ is obtained by equation (26).

[0158]

[0159] Where m = 1, 2, ..., H×H are the sequence position indices.

[0160] Step 2: When the position index m is a multiple of 256, the replaced value is still 0. Therefore, it is necessary to traverse the pseudo-random sequence CSC″′ again, find the pixel with a value of "0" in the sequence, and replace the pixel value of the pixel with the value of the external key e4. This makes all elements in the pseudo-random sequence CSC″′ applicable to Galois field multiplication while increasing the key space and security of the encryption method.

[0161] Step 3: Rearrange the image matrix M3 to obtain the one-dimensional image sequence S′2. Use the pseudo-random sequence CSC″′ to diffuse the pixels in the image sequence S′2 whose pixel value is not “0” using equation (27) to obtain the image sequence S2.

[0162]

[0163] in, For Galois domain GF(2) 8 Multiplication operations within () where m = 1, 2, ..., H×H is the sequence position index.

[0164] Backdiffusion: Input the forward-diffused image sequence S2 and the pseudo-random sequence CSB″′ to obtain the one-dimensional sequence S3 after backdiffusion.

[0165] The image sequence S2 is diffused by equation (28) to obtain the one-dimensional sequence S3.

[0166]

[0167] Where m = 1, 2, ..., H×H are the sequence position indices.

[0168] Step 6: Rearrange the one-dimensional sequence S3 into an H-order square matrix, i.e., an H×H ciphertext image C, to complete the entire encryption process.

[0169] The encryption method proposed in this invention was simulated using Matlab 2016a, and the results were compared and analyzed. Six 256×256 grayscale images, namely "Transmission Line", "Iron Tower", "Lena", "Boat", "Cameraman", and "FullBlack", were selected for the experiment. The external keys {e1, e2, e3, e4} were set to {0.00001, 0.001, 0.00001, 85}, respectively.

[0170] Plaintext images contain a wealth of useful information, which can be directly observed and understood. Encryption algorithms can render ciphertext images meaningless, thus preventing the direct acquisition of the intended information. Furthermore, encryption algorithms are highly reversible; with the correct key, the meaningless ciphertext image can be restored to its plaintext form. For example... Figure 7 The invention demonstrates the excellent encryption and decryption effects of its encryption method on images of different grayscale levels.

[0171] Alvarez proposed that, in order to effectively resist brute-force attacks, the key space should be greater than 2. 100 The key structure of the encryption method proposed in this invention is as follows: Figure 4 As shown, the key K is generated by SHA-256 and has a total of 256 bits of binary space. The external keys {e1, e2, e3} are stored as floating-point numbers in Matlab, retaining 10 decimal places to ensure precision, resulting in a total of 138 bits of binary space. Within the range of values ​​for the external key {e4}, there are (2... 8 -1) possible values. Therefore, the key space of the encryption method of this invention is (2) 402 -1), which can effectively resist violent attacks.

[0172] The key should not only have a sufficiently large key space, but also be sufficiently sensitive. After encrypting a plaintext image using the key, even a very small perturbation to the key should prevent the perturbed key from correctly decrypting the image. Apply a 10^10 key to each of the external keys e1, e2, and e3. -14 Disturbances, such as Figure 8 The images show the decryption results of the Lena ciphertext image using the correct key and the perturbed incorrect key, respectively. It can be seen that the encryption structure used in this invention has good key sensitivity; even with a small error compared to the correct key, the ciphertext image cannot be successfully decrypted with an incorrect key.

[0173] Statistical analysis is a common image attack method. Attackers obtain useful information by statistically analyzing the distribution of pixel values ​​and the relationships between adjacent pixels in an image. Image statistical analysis mainly includes: histogram analysis, chi-square analysis, etc. 2 Tests include correlation analysis of adjacent pixels, global Shannon entropy analysis, and local Shannon entropy analysis.

[0174] An image histogram displays the number of pixels with different pixel values. Uneven pixel distribution reveals relevant information about the image; therefore, the more uniform the histogram distribution of a encrypted image, the less information it contains, and the higher the encryption security. For example... Figure 9 The figures show the histogram distributions of plaintext and ciphertext in different images. Figure 9 As can be seen, the histogram of the encrypted image is more evenly distributed compared to the histogram of the plaintext image, indicating higher security.

[0175] Histograms provide a visual overview of pixel distribution, χ² 2 The test can analyze the frequency of different pixel values. Equation (29) gives the χ² value for an image of size M×N with 256 gray levels. 2 Calculation formula. χ 2 The smaller the value, the more uniform the pixel distribution. Under a significance level of α = 0.05, the χ² value of the encrypted image... 2 The calculated value should be less than the critical value of 293.2478.

[0176] Table 6 shows the χ² values ​​of the ciphertext images obtained by encrypting the experimental images using the encryption method of this invention. 2 The test results show that the encryption method proposed in this invention passed the χ² test. 2 test.

[0177]

[0178] Among them, O i This represents the frequency of pixel value i in the image. This represents the expected frequency of pixel value i in the image.

[0179] Table 6. Ciphertext Image χ 2 test

[0180]

[0181] The data redundancy in plaintext images leads to strong correlations between adjacent pixels, revealing a wealth of image information. Therefore, for a good encrypted image, the closer the correlation between adjacent pixels is to zero, the better. This invention randomly selects 10,000 pairs of adjacent pixels in the horizontal, vertical, and diagonal directions of both plaintext and encrypted images to analyze their correlations. Figure 10 The test results are shown using Lena and Boat as examples. It can be seen that the pixel distribution of the plaintext image is concentrated and the adjacent pixels show a strong linear relationship, while the pixel distribution of the ciphertext image is more uniform.

[0182] To quantitatively compare and analyze the correlation between adjacent pixels, Equation (30) is used to calculate the correlation coefficient r between adjacent pixels. Table 7 shows the correlation between adjacent pixels of plaintext and ciphertext in the experimental images of this invention. It can be seen that the correlation coefficient of the plaintext image is close to 1, showing a strong linear relationship, while the correlation coefficient of the ciphertext image is close to 0, showing a very weak linear relationship.

[0183] The encrypted image successfully destroys the correlation between adjacent pixels, effectively resisting statistical analysis.

[0184]

[0185] Where u and v are the pixel values ​​of adjacent pixels, respectively.

[0186] Table 7. Correlation coefficients of experimental images

[0187]

[0188] Global Shannon entropy, also known as global information entropy, is an effective method for measuring the randomness and uncertainty of information. For a discrete random variable X, the definition of global Shannon entropy H(X) is shown in equation (31):

[0189]

[0190] Where L is the number of sample points, and here L represents the number of pixel values; p(x it Let be the probability of a sample point, satisfying... Here p(x) t () represents the probability of different pixel values ​​occurring.

[0191] Global Shannon entropy measures the distribution of different pixel values. The more consistent the probability of each pixel value, the larger the calculated global Shannon entropy. For an image with 256 gray levels, the ideal value of global Shannon entropy is 8. Table 8 lists the global Shannon entropy of plaintext and ciphertext of different images. It can be seen that the global Shannon entropy of the images encrypted by the encryption method of this invention is very close to the ideal value of 8.

[0192] Table 8. Information Entropy

[0193]

[0194]

[0195] Wu pointed out several drawbacks of global Shannon entropy, including its unsuitability as a universal metric for images of different sizes, its inefficiency in measuring the entire image, and its inability to truly measure image randomness because it fails to capture the randomness of local image patches. Therefore, he proposed the concept of local Shannon entropy. The definition is shown in equation (32).

[0196]

[0197] Where q represents the total number of image patches, S i ={S1,S2,…,S q} represents q non-overlapping image blocks, T B H(S) represents the number of pixels contained in each block. i ) represents image block S i The Shannon entropy is calculated from equation (31).

[0198] Local Shannon entropy differs from quantitative analysis of global Shannon entropy; instead, it qualitatively provides a test standard. Wu conducted parametric analysis, and for a grayscale image with 256 gray levels, under significance levels α = 0.05, α = 0.01, and α = 0.001, with k = 30 and T... B =In 1936, the range that passed the test As shown in Table 9, Table 10 presents the results of the local Shannon entropy test for the experimental images. It can be seen that all experimental images passed the test at a significance level of α = 0.01, and most images passed the test at α = 0.05, indicating that the encryption method has a strong ability to resist statistical analysis attacks.

[0199] Table 9. k = 30, T B =The range of 8-bit grayscale images passing the local Shannon entropy test at time 1936

[0200]

[0201] Table 10. Local Shannon Entropy Test

[0202]

[0203] Differential attacks involve an attacker making slight modifications to the original image, encrypting both the original and modified images separately, and then analyzing the ciphertext images to crack the encrypted image. A good encryption system should have strong resistance to differential attacks; even changing just one pixel in the original image should produce unpredictable changes in the encrypted image.

[0204] Analysis of resistance to differential attacks mainly includes: non-volatile polymorphism (NPCR) and uniform average polymorphism intensity (UACI). For example... Figure 11 The image shows the ability of the encryption method of this invention to resist differential attacks. The pixel value of the pixel at coordinates (50, 50) in the Lena image was changed from 100 to 200. The unchanged Lena image and the changed Lena image were then encrypted, resulting in two corresponding ciphertext images. The two ciphertext images have significant differences. To quantify the analysis results, NPCR and UACI analyses were performed on the two ciphertext images. NPCR quantitatively calculates the percentage of different pixels in the two images, and UACI quantitatively calculates the average intensity of the difference between the two images. Wu proposed an evaluation method for NPCR and UACI. For a grayscale image with 256 gray levels and an image size of 256×256, under the condition of significance level α = 0.05, when the NPCR is greater than a threshold... UACI is located in the interval Therefore, it can be considered that the encryption algorithm passes the NPCR and UACI tests and is resistant to differential attacks. Tables 11 and 12 show the NPCR and UACI test results for the experimental images, respectively. All experimental images passed the NPCR and UACI tests, indicating that only altering the original... Figure 1 Each pixel, after being encrypted by the encryption method of this invention, produces unpredictable changes in the encrypted image, which can effectively resist differential attacks.

[0205] For an image of size M×N, the calculation formulas for NPCR are shown in equations (33) and (34), and the calculation formula for UACI is shown in equation (35).

[0206]

[0207]

[0208]

[0209] Where C1(s,t) and C2(s,t) represent the pixel values ​​at coordinates (s,t) in images C1 and C2, respectively.

[0210] Table 11. NPCR test

[0211]

[0212] Table 12. UACI Test

[0213]

[0214] Robustness refers to the ability of a system to maintain certain performance under a certain degree of disturbance. Ciphertext images can be compromised during transmission due to attacks or interference from other factors, causing errors in some pixels. A good encryption algorithm should possess good robustness, capable of decrypting the main information in the plaintext image even with partial pixel errors.

[0215] Common attack types include noise attacks and pruning attacks. For example... Figure 12 Salt-and-pepper noise of 0.01, 0.05, and 0.1 was applied to Lena's ciphertext image, and then the noisy ciphertext images were decrypted. It can be seen that even with a noise intensity of 0.1, the main information of the plaintext image can still be identified from the decrypted image. Figure 13 Lena's ciphertext image was cropped by 1 / 16, 1 / 8, 1 / 4, and 1 / 2 of its original size, and then the cropped ciphertext images were decrypted. It can be seen that even with half a pixel missing, the main information in the plaintext image can still be recovered, and the cropping at different locations did not cause any large blocks of missing pixels in the decrypted image. In summary, the encryption method proposed in this invention can effectively resist noise attacks and cropping attacks, and has good robustness.

[0216] To quantify the tolerance of an encryption scheme to data loss and random noise, metrics such as Peak Signal-to-Noise Ratio (PSNR) and Mean Square Error (MSE) can be used to compare the differences between the original and decrypted images. PSNR and MSE are commonly used metrics to measure digital image quality; a higher PSNR indicates higher image fidelity, while a lower MSE indicates less image difference. By comparing the PSNR and MSE of images before and after encryption, the impact of the encryption scheme on image quality and its tolerance to noise and data loss can be assessed. The formulas for calculating PSNR and MSE are shown in equations (36) and (37), respectively.

[0217] Table 13 shows the test results of PSNR and MSE of the Lena image under different levels of cropping and noise attacks. It can be seen that the encryption method of this invention has a certain degree of robustness and fault tolerance, ensuring that the quality of the decrypted image will not significantly degrade due to data loss and increased noise intensity. However, it should be noted that the quality of the decrypted image will still gradually decrease with increasing data loss and noise intensity. Therefore, the encryption method proposed in this invention can withstand a certain level of data loss and noise intensity.

[0218]

[0219]

[0220] Where M and N represent the height and width of the image, respectively, P(s,t) and I(s,t) are the pixel values ​​of the original image and the decrypted image at coordinates (s,t), respectively, and MAX is the maximum possible pixel value of the image.

[0221] Table 13. PSNR and MSE under different clipping and noise attacks

[0222]

[0223] This invention uses a three-dimensional chaotic system to generate the pseudo-random sequence required for encryption. To overcome the low security problem when using only global index scrambling, a novel pixel-level scrambling method based on the image pyramid structure is proposed. This scrambling method first obtains the position coordinates of plaintext image pixels in each image layer through downsampling, then uses a DNA password generated by the pseudo-random sequence to scramble the position coordinates of each image layer, and finally obtains the scrambled image through upsampling. A Galois domain is incorporated into the diffusion stage to improve the security and performance of the encryption algorithm. By introducing the Galois domain, better results can be achieved in protecting image privacy and resisting attacks. Various experimental analyses show that this invention is of great significance for protecting the security of aerial images captured by UAVs for power transmission line inspection, preventing malicious attacks on the power system, protecting the trade secrets of power companies, and ensuring national energy security.

[0224] 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 for smart grids based on image pyramids and Galois domains, characterized in that, The steps are as follows: Step 1: Image preprocessing: Obtain the plaintext image matrix with a size of [size missing]. Calculate the maximum value in {M, N}, and denote the smallest power of 2 (n) that is greater than or equal to the maximum value as [M, N]. ,structure The zero matrix is ​​replaced with the plaintext image matrix in the upper left corner. From 100 pixels, we obtain the image matrix P; Step 2: Generate pseudo-random sequences: Use the plaintext image matrix combined with the SHA-256 algorithm and external key E to obtain the initial values ​​of the three-dimensional chaotic system. Substitute the initial values ​​into the three-dimensional chaotic system for iteration to obtain three chaotic sequences CSA, CSB, and CSC. Numerical processing is performed on chaotic sequences CSA, CSB, and CSC to obtain pseudo-random sequences for pixel-level scrambling. , , Pseudo-random sequences used for DNA encoding and DNA decoding , And pseudo-random sequences for forward multiplicative diffusion and backward additive diffusion in Galois fields. , ; Step 3, Pixel-level scrambling: The image matrix P is globally indexed and scrambled using the chaotic sequence CSA to obtain the image sequence S1, and then the image sequence S1 is rearranged into the image matrix M1; then, a pseudo-random sequence is applied to the image matrix M1. , , Pixel-level scrambling based on the image pyramid structure is performed to obtain the image matrix M2; Step 4, DNA Hierarchical Scrambling: Group the image matrix M2, and... The image matrix M2 is divided into 1 sub-block; each sub-block is based on a pseudo-random sequence. , DNA encoding and DNA decoding rules were selected respectively to perform DNA encoding and DNA decoding, resulting in image matrix M3; Step 5, Galois Domain Diffusion: First, use a pseudo-random sequence The scrambled image matrix M3 is forward diffused using Galois multiplication in the Galois field to obtain a one-dimensional sequence S2; then a pseudo-random sequence is used. The one-dimensional sequence S2 is subjected to inverse diffusion of addition in the Galois field to obtain the one-dimensional image sequence S3. Step 6: Rearrange the one-dimensional sequence S3 into an H-order square matrix to obtain the ciphertext image C, thus completing the entire encryption process.

2. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 1, characterized in that, The method for obtaining the initial value of the three-dimensional chaotic system is as follows: The plaintext image matrix is ​​processed using the SHA-256 algorithm to obtain a key K; then, Galois addition, multiplication, and external key operations are performed sequentially on the key K. The initial values ​​of the three-dimensional chaotic system are obtained by scrambling. The initial values ​​are then substituted into the three-dimensional chaotic system for iteration to obtain three chaotic sequences CSA, CSB, and CSC.

3. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 1 or 2, characterized in that, The pseudo-random sequence , , The generation method is as follows: ; The pseudo-random sequence , The generation method is as follows: ; The pseudo-random sequence , The generation method is as follows: ; Floor() is the floor function; This represents the modulo operation; These represent the first n elements of the chaotic sequences CSA, CSB, and CSC, respectively.

4. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 3, characterized in that, The method for global index scrambling is as follows: First, rearrange the image matrix P column-wise to obtain a one-dimensional image sequence S. 11 Then, the chaotic sequence CSA is sorted in ascending or descending order to obtain the index sequence Index of the chaotic sequence CSA. Based on the index sequence Index, the one-dimensional image sequence S is... 11 The image sequence S1 is obtained by index scrambling.

5. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 1, characterized in that, The pixel-level scrambling method based on the image pyramid structure is as follows: the image matrix M1 is sampled layer by layer downwards, using a pseudo-random sequence. Determine the DNA coding rules or triploid mutation rules of the DNA position coordinates of each layer, and record the position of the plaintext image pixels in all n layers of images; then use pseudo-random sequences Determine the DNA coding rules for each layer, using pseudo-random sequences. The DNA operation method is determined to scramble the positions of plaintext image pixels in each image layer; finally, upsampling is performed according to the scrambled positions until the resolution of the image layer is the same as the resolution of the image matrix M1.

6. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 5, characterized in that, The pixel-level scrambling steps based on the image pyramid structure are as follows: Step 1: Determine the position basis of each layer: The position basis of each image layer is a second-order square matrix A. i This indicates that the pseudo-random sequence Determine the DNA coding rules or triploid mutation rules for each layer of the basal layer; Step 2: Determine the DNA key D for each image layer i Encoding rules: The DNA key is used to scramble the coordinates of plaintext image pixels in each image layer; the pseudo-random sequence is used... Convert the elements in the array to eight-bit binary numbers. Where j=1,2,…,8 are binary bit indices, and i=1,2,…,n are image layer indices; where { , , The number of "1"s in the key determines the value of the i-th layer of DNA, denoted as V. i ;{ , , The three-digit binary number formed by} is converted into a decimal number, which determines the encoding rule R of the i-th layer. i Determine the highest bit Whether the value is "1" determines whether a triploid mutation has occurred in the DNA key of the i-th layer; the value V... i and encoding rule R i Determine DNA key D i ; Step 3: Plaintext image layer cyclic shift: Let N be the displacement number of the plaintext image layer corresponding to the i-th image layer. i First, the plaintext image layer is shifted right for even-numbered rows and left for odd-numbered rows. The resulting image matrix after the row shifts is denoted as BR. i Then, for the image matrix BR i The even-numbered columns are shifted upwards and the odd-numbered columns are shifted downwards. The resulting image matrix after the column shifts is denoted as B. i ; Step 4: Downsampling to determine the position coordinates of plaintext image pixels in each image layer: The plaintext image position coordinates of the i-th layer are determined by the image matrix B. i Image matrix B is obtained by downsampling. i Sampling down layer by layer until the i-th layer, based on the position of the i-th layer as the base A i Determine the position coordinates of each pixel in the plaintext image at layer i; repeat this process until the plaintext position coordinate matrix corresponding to all n layers of the image is determined, denoted as C. i , i=1,2,…,n; Step 5: Scramble the position coordinates: using a pseudo-random sequence The numerical value determines the DNA key D for each layer. i With position coordinates C i The operation method, the DNA encoding method in the DNA operation process is determined by the encoding rule R. i The scrambled position coordinate matrix of the plaintext image in each layer of the image is denoted as E. i ; Step 6: Upsampling: Starting from an image layer with a resolution of only one pixel in the image pyramid structure, upsampling is performed using the scrambled position coordinate matrix E of the i-th layer. i and location base A i Together, determine the position of each pixel in the plaintext image when it is upsampled from layer i+1 to layer i; repeat this process until the resolution of the image layer is the same as the resolution of the plaintext image layer, and obtain the pixel-level scrambled graph matrix M2.

7. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 6, characterized in that, After the downsampling proceeds from layer k to layer (k+1), each layer in layer k... The plaintext image pixels stored within a pixel block are stored in one pixel of the (k+1)th layer, i.e., in the kth layer. The plaintext image pixels stored within a pixel block have the same position coordinates in layer (k+1); after the upsampling from layer k to layer (k-1), each pixel in layer k is expanded to the position coordinates in layer (k-1). A pixel block is a block of pixels in which the plaintext image pixels stored in the k-th layer are allocated to the four pixels extended from that pixel.

8. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 1, 2, 6, or 7, characterized in that, The method for implementing the DNA bit-level scrambling is as follows: Two adjacent pixels in the image matrix M2 are considered as a sub-block. The image matrix is ​​decomposed into eight bit planes. The bit planes of two pixels in each sub-block are cross-combined to obtain eight sets of binary sequences. }, l=1,2,…, ; by pseudo-random sequence DNA sequences are obtained by selecting encoding rules and encoding DNA, and then generated from pseudo-random sequences. The DNA decoding is performed according to the selected decoding rules to obtain eight new binary sequences. The newly obtained binary sequences are decomposed and reassembled into two-pixel bit planes to obtain sub-block scrambled pixels, thus obtaining the DNA bit-level scrambled image matrix M3.

9. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 8, characterized in that, The Galois domain GF(2) 8 The method for implementing forward diffusion in internal multiplication is as follows: traverse the pseudo-random sequence. Replace pixels with a value of "0" with the value obtained by modulo operation of the pixel's position index m to obtain the replaced pseudo-random sequence. ; Iterate through the pseudo-random sequence again Replace the values ​​of elements with the value "0" with the external key. The numerical values; rearrange the image matrix M3 to obtain a one-dimensional image sequence. Using the replaced pseudo-random sequence For image sequences Multiplication operations are performed in the Galois domain on pixels whose pixel values ​​are not "0" to obtain image sequence S2; The Galois domain GF(2) 8 The reverse diffusion of the inner addition operation is: ... Perform addition operations in the Galois field with the corresponding elements in the image sequence S2.

10. The image encryption method for smart grids based on image pyramids and Galois domains according to claim 9, characterized in that, The image sequence S2 is ; The one-dimensional sequence S3 is ; in," "For Galois domain GF(2 8 Multiplication operations within (), m=1,2,…, For sequence position index; The addition operation in the Galois field is an XOR operation; Galois Domain GF(2) 8 The multiplication operation of ) is implemented using the table lookup method as follows: ; Where a and b are both Galois domains GF(2). 8 Elements within ) and These are the positive and negative multiplication tables generated from the primitive polynomials, respectively. This represents the modulo operation; The external key Scrambling is the process of adding an external key. The initial values ​​of the three-dimensional chaotic system are obtained by adding them to the calculated initial parameters of the three-dimensional chaotic system.

Citation Information

Patent Citations

  • Methods for Encrypting and Decrypting Transmission Line Image Data

    CN113763493B