Image encryption method based on quantum key distribution and pixel scrambling

Through the method based on quantum key distribution and pixel messaging, the problem of low security of classic image encryption algorithms is solved, and high-security image encryption is achieved to effectively prevent various attacks.

CN114579993BActive Publication Date: 2025-04-08ENG UNIV OF THE CHINESE PEOPLES ARMED POLICE FORCE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210185470.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2025-04-08
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

The existing classic image encryption algorithms are low in security and cannot meet modern information security needs.

Method used

Using an image encryption method based on quantum key distribution and pixel scrambling, a key is generated through the quantum key distribution protocol, and converted into the same pixel matrix as the image, and encryption is achieved through XOR operation.

Benefits of technology

The security of image encryption is improved, and the encrypted images are difficult to crack by attackers through weak correlation and high information entropy, effectively preventing statistical attacks and information entropy attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579993B_ABST
    Figure CN114579993B_ABST
Patent Text Reader

Abstract

The present invention discloses an image encryption method based on quantum key distribution and pixel scrambling in the field of information security technology, comprising the following steps: S1: image preprocessing; S2: QKD key generation; S3: pixel scrambling + QKD encryption of the image; S4: decryption using the generated QDK key; S5: pixel restoration; S6: obtaining the original image; the key used in the image encryption algorithm based on quantum key distribution of the present invention is generated by a quantum key distribution protocol, and the biggest advantage compared with other classical image encryption algorithms is high security. By performing a performance analysis on the encryption algorithm, it is concluded that the algorithm has good statistical characteristics and can effectively prevent statistical attacks; the correlation of the encrypted image in three directions is very weak, so that the attacker cannot use the correlation to obtain useful information; the greater the pixel difference between the plaintext image and the ciphertext image; the information entropy of the ciphertext image is very close to the ideal value, and can resist the attack of information entropy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to an image encryption method based on quantum key distribution and pixel scrambling. Background Art

[0002] Images are an important way to carry information. The security of images in transmission has always been a hot topic in the field of information security research. For this reason, various image encryption algorithms have been proposed, including encryption algorithms based on various transformation theories, encryption algorithms based on chaos theory, and encryption algorithms that combine transformation theory and chaos theory. However, these are all encryption algorithms in the classical field. Traditional classical image encryption algorithms have low security and can no longer meet existing needs. The development of quantum mechanics has brought new ideas to the secure transmission of information. By utilizing the characteristics of quantum mechanics itself, unconditional secure transmission of information can be achieved.

[0003] Therefore, it is urgent to design an image encryption method based on quantum key distribution and pixel scrambling. Summary of the invention

[0004] The purpose of the present invention is to provide an image encryption method based on quantum key distribution and pixel scrambling to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solution: an image encryption method based on quantum key distribution and pixel scrambling, comprising the following steps:

[0006] S1: Image preprocessing;

[0007] S2: QKD key generation;

[0008] S3: pixel scrambling + QKD encryption of the image;

[0009] S4: Decrypt using the generated QDK key;

[0010] S5: pixel recovery;

[0011] S6: Obtain the original image.

[0012] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, in the above-mentioned S3, the quantum key has been obtained through the quantum key distribution protocol, and according to the image to be sent, the generated key is converted into the same pixel matrix as the image to be encrypted, and a simple XOR operation is performed on the corresponding pixels of the two matrices to achieve encryption.

[0013] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, assuming that a certain 2 N ×2 NGrayscale image, each pixel requires 8 bits to store color information, the color value range is {0,1,...,255}, the grayscale image is converted into the corresponding two-dimensional pixel matrix represented as A;

[0014]

[0015] Formula (1) Matrix A ij is the pixel value of the image, each pixel value A ij (i=1…n,j=1…n) takes values ​​between [0, 255]; each pixel value A ij Convert to 8-bit binary code group [a ij0 a ij1 …a ij7 ](a ij0 , a ij1 , …a ij7 The values ​​are 0 or 1 respectively), and the matrix becomes A 1 ;

[0016]

[0017] Using QKD to generate quantum keys, a one-dimensional quantum key sequence can be generated as {b 1 ,b 2 ,…,b M}(b 1 ,b 2 ,…,b M The values ​​are 0 or 1 respectively) to satisfy M = 8NN, and 8 elements are grouped together to generate a code group, forming a matrix B with the same rows and columns as the pixels of the image to be encrypted, as shown in formula (3);

[0018]

[0019] Among them, satisfying b 1 =b 1,0 ,b 2 =b 2,1 ,…,b M =b 8NN,7 ;

[0020] A 1 By performing XOR operation on the binary bits of the corresponding elements of B to achieve encryption, the matrix C can be obtained.

[0021] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, the first pair of code groups c 110 c 111 …c 117 Take A as an example to illustrate the encryption process. 1 XORing each element with B, the results are as follows:

[0022]

[0023]

[0024] Among them, XOR complete c 110 c 111 …c 117 Still an 8-bit code group; all code groups generate matrix C in the original position 1 ;

[0025]

[0026] C 1 Each binary 8-bit code group is converted into decimal to obtain matrix C, which is the encrypted image matrix;

[0027]

[0028] The matrix C corresponds to the encrypted image.

[0029] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, during decryption, because the sender and the receiver obtain the key through the quantum key distribution protocol through negotiation, the keys obtained by both parties are exactly the same, and the receiver performs corresponding decryption according to the encryption method of the sender.

[0030] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, the specific operation is: the receiver sets the key to the same matrix as formula (3), and then performs an XOR operation with the matrix in formula (5) to restore the original image.

[0031] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, the key used in the image encryption algorithm based on quantum key distribution in this scheme is generated by a quantum key distribution protocol.

[0032] Furthermore, in the above-mentioned image encryption method based on quantum key distribution and pixel scrambling, the key generated by QDK is replaced by a random two-dimensional matrix in Matlab.

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

[0034] 1. The key used in the image encryption algorithm based on quantum key distribution of the present invention is generated by a quantum key distribution protocol. Compared with other classical image encryption algorithms, its biggest advantage is high security. Through performance analysis of the encryption algorithm, it is concluded that the algorithm has good statistical characteristics and can effectively prevent statistical attacks. The correlation in three directions of the encrypted image is very weak, so that attackers cannot use the correlation to obtain useful information. The greater the pixel difference between the plaintext image and the ciphertext image, the greater the information entropy of the ciphertext image is, and the information entropy of the ciphertext image is very close to the ideal value, which can resist the attack of information entropy.

[0035] 2. The quantum key distribution protocol in the present invention can generate a secure key, convert the key generated by negotiation between the communicating parties into a pixel matrix corresponding to the image to be encrypted, perform XOR operation on the pixel matrix and the elements corresponding to the pixel matrix of the corresponding image, and then scramble the row and column pixels to achieve encryption; the decryption party uses the key negotiated with the sender to perform XOR, and the row and column can be decrypted after the row and column are restored; the algorithm is simple to implement, and experimental simulation has proved that the histogram of the encrypted image is uniformly distributed, the pixel correlation is very weak, the pixel change rate and information entropy are high, and the method has high security. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0037] Figure 1 This is a diagram of the image encryption and decryption process of the present invention;

[0038] Figure 2 This is a schematic diagram of the encryption effect diagram structure of the present invention;

[0039] Figure 3 Schematic diagram of histogram of plain text image and encrypted image of the present invention;

[0040] Figure 4 Schematic diagram of correlation distribution between plaintext image and ciphertext image of the present invention;

[0041] Attachment: Figure 2 In (a), (b), and (c), the left side is the plaintext image, and the right side is the ciphertext image; Figure 3 In (a), (b), and (c), the left side is the histogram of the plaintext image, and the right side is the histogram of the ciphertext image; Figure 3In (a), the left side is the horizontal correlation of the plaintext image, and the right side is the horizontal correlation of the ciphertext image. In (b), the left side is the vertical correlation of the plaintext image, and the right side is the vertical correlation of the ciphertext image. In (c), the left side is the diagonal correlation of the plaintext image, and the right side is the diagonal correlation of the ciphertext image. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] The present invention provides a technical solution: an image encryption method based on quantum key distribution and pixel scrambling, comprising the following steps:

[0044] S1: Image preprocessing;

[0045] S2: QKD key generation;

[0046] S3: pixel scrambling + QKD encryption of the image;

[0047] S4: Decrypt using the generated QDK key;

[0048] S5: pixel recovery;

[0049] S6: Obtain the original image.

[0050] In the above S3, the quantum key has been obtained through the quantum key distribution protocol. According to the image to be sent, the generated key is converted into the same pixel matrix as the image to be encrypted, and a simple XOR operation is performed on the corresponding pixels of the two matrices to achieve encryption.

[0051] Assume that 2 N ×2 N Grayscale image, each pixel requires 8 bits to store color information, the color value range is {0,1,...,255}, the grayscale image is converted into the corresponding two-dimensional pixel matrix represented as A;

[0052]

[0053] Formula (1) Matrix A ij is the pixel value of the image, each pixel value A ij (i=1…n,j=1…n) takes values ​​between [0, 255]; each pixel value A ij Convert to 8-bit binary code group [a ij0 a ij1…a ij7 ](a ij0 , a ij1 , …a ij7 The values ​​are 0 or 1 respectively), and the matrix becomes A 1 ;

[0054]

[0055] Using QKD to generate quantum keys, a one-dimensional quantum key sequence can be generated as {b 1 ,b 2 ,…,b M}(b 1 ,b 2 ,…,b M The values ​​are 0 or 1 respectively) to satisfy M = 8NN, and 8 elements are grouped together to generate a code group, forming a matrix B with the same rows and columns as the pixels of the image to be encrypted, as shown in formula (3);

[0056]

[0057] Among them, satisfying b 1 =b 1,0 ,b 2 =b 2,1 ,…,b M =b 8NN,7 ;

[0058] A 1 By performing XOR operation on the binary bits of the corresponding elements of B to achieve encryption, the matrix C can be obtained.

[0059] With the first pair of code group c 110 c 111 …c 117 Take A as an example to illustrate the encryption process. 1 XORing each element with B, the results are as follows:

[0060]

[0061]

[0062] Among them, XOR complete c 110 c 111 …c 117 Still an 8-bit code group; all code groups generate matrix C in the original position 1 ;

[0063]

[0064] C 1 Each binary 8-bit code group is converted into decimal to obtain matrix C, which is the encrypted image matrix;

[0065]

[0066] The matrix C corresponds to the encrypted image.

[0067] During decryption, the sender and receiver negotiate the key through the quantum key distribution protocol, and the keys obtained by both parties are exactly the same. The receiver performs the corresponding decryption according to the sender's encryption method. The specific operation is: the receiver sets the key to the same matrix as formula (3), and then performs an XOR operation with the matrix in formula (5) to restore the original image.

[0068] The key used in the image encryption algorithm based on quantum key distribution in this scheme is generated by the quantum key distribution protocol. The key generated by QDK is replaced by a random two-dimensional matrix in Matlab.

[0069] Performance analysis of encryption algorithms: There are many methods for performance analysis of image encryption algorithms. This scheme analyzes the encryption effect of the image from multiple angles, such as histogram, pixel correlation, pixel change rate, information entropy key space, etc., to evaluate the performance of the encryption algorithm.

[0070] 1. Histogram analysis

[0071] The histogram reflects the statistical characteristics of the grayscale value of the image. From the comparison of the histograms of the plaintext image and the ciphertext image in the figure, we can see that the histogram pixel value distribution of the ciphertext image is very uniform compared to the plaintext image. Therefore, this algorithm cannot provide any valuable statistical information and can effectively prevent statistical attacks.

[0072] 2. Correlation analysis

[0073] The correlation of an image is the correlation between two adjacent pixels in the image. This adjacency relationship includes horizontal, vertical and diagonal adjacency. The correlation coefficient of adjacent pixels is shown in formula (6). This paper randomly selects 3000 pairs of adjacent pixels from the plaintext image and the ciphertext image for experiments, and obtains the correlation distribution diagrams between horizontal, vertical and diagonal adjacent pixels. This paper only shows the correlation distribution of one image in three directions, as shown in the figure.

[0074]

[0075] in, is the pixel average, x i,j ,y i,j The size of the pixel value at the corresponding position.

[0076] The correlation coefficients in three directions are calculated according to the formula defined by correlation. It can be seen that the plaintext image has a strong correlation in three directions, while the encrypted image has a very weak correlation in three directions, which indicates that the useful information of the ciphertext image is well hidden, making it impossible for attackers to use correlation to obtain useful information.

[0077] 3. Pixel change rate analysis

[0078] The pixel change rate (NPCR) is used to reflect the change between the pixels of the plaintext image and the ciphertext image, and is defined as follows:

[0079]

[0080] Here, W and H represent the width and height of the image respectively, and i and j represent the position information of the image pixels.

[0081] The larger the NPCR value, the greater the pixel difference between the plaintext image and the ciphertext image, and the better the encryption scheme. The pixel change rate of the three images was simulated, and the experimental results are shown in the table. From the table, it can be seen that the NPCR values ​​of the plaintext and ciphertext images of the three images tend to 100%.

[0082] Pixel change rate

[0083]

[0084] 4. Information entropy test

[0085] Information entropy can represent the uncertainty of image information. The more uniform the grayscale distribution of the image is, the greater the entropy value is. The information entropy of the source S is calculated as follows (8):

[0086]

[0087] Among them, P(S i ) represents pixel S i The ideal entropy value of an encrypted image should be 8 bits. The table shows the information entropy of three plaintext images and the corresponding ciphertext images. From the comparison between the two, it can be seen that the information entropy of the ciphertext image is very close to the ideal value, indicating that the algorithm can resist the attack of information entropy.

[0088] The value of information entropy

[0089]

[0090] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0091] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. An image encryption method based on quantum key distribution and pixel scrambling, characterized in that: The following steps are involved: S1: Image preprocessing; S2: QKD key generation; S3: scramble the pixels of the image and perform QKD encryption; The quantum key has been obtained through the quantum key distribution protocol. According to the image to be sent, the generated key is converted into the same pixel matrix as the image to be encrypted, and a simple XOR operation is performed on the corresponding pixels of the two matrices to achieve encryption; Assume that Grayscale image, each pixel requires 8 bits to store color information, the color value range is {0,1,...,255}, the grayscale image is converted into the corresponding two-dimensional pixel matrix represented as A; (1) Formula (1) In matrix A is the pixel value of the image, each pixel value Take values ​​between [0, 255]; each pixel value Convert to 8-bit binary code group ( are 0 or 1 respectively), the matrix becomes A 1; (2) Using QKD to generate quantum keys, the one-dimensional quantum key sequence is generated as ( The values ​​are 0 or 1 respectively) , group 8 elements together to generate a code group, forming a matrix B with the same number of rows and columns as the pixels of the image to be encrypted, as shown in formula (3); (3) Among them, satisfy ; Will A 1 and B The binary bits of the corresponding elements are encrypted by XOR operation to obtain the matrix C; The first pair of code groups Take the example to explain the encryption process. A 1 and B XOR each element one by one, and the results are as follows: , , , , , , (4) Among them, XOR is complete Still an 8-bit code group; all code groups generate matrices in their original positions C 1; Will C Each binary 8-bit code group in 1 is converted into decimal to obtain matrix C, which is the encrypted image matrix; (5) The matrix C corresponds to the encrypted image; S4: Decrypt using the generated QDK key; S5: pixel recovery; S6: Obtain the original image.

2. According to claim 1, an image encryption method based on quantum key distribution and pixel scrambling is characterized in that: During decryption, the sender and receiver obtain the key through the quantum key distribution protocol through negotiation, and the keys obtained by both parties are exactly the same. The receiver performs the corresponding decryption according to the sender's encryption method.

3. The image encryption method based on quantum key distribution and pixel scrambling according to claim 2 is characterized in that: The specific operation is as follows: the receiver sets the key to the same matrix as formula (3), and then performs an XOR operation with the matrix in formula (5) to restore the original image.

4. The image encryption method based on quantum key distribution and pixel scrambling according to claim 1, characterized in that: The keys used in the image encryption algorithm based on quantum key distribution are generated by the quantum key distribution protocol.

5. The image encryption method based on quantum key distribution and pixel scrambling according to claim 1, characterized in that: The key generated by QDK is replaced by a random two-dimensional matrix in Matlab.

Citation Information

Patent Citations

  • Four-dimensional Hopfield neural network image encryption method based on quantum Fourier transformation

    CN107592198A

  • New image encryption method

    CN109660696A