Quantum image encryption method based on two-dimensional cross mapping and dynamic diffusion

By adopting a quantum image encryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion, the problems of small key space and high computational complexity in existing image encryption methods are solved, achieving efficient quantum image encryption and improving both security and efficiency.

CN114978487BActive Publication Date: 2026-04-14CHANGCHUN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGCHUN UNIV OF SCI & TECH
Filing Date
2022-04-29
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing image encryption methods suffer from small key spaces, high image processing algorithm complexity, and long computation time. Furthermore, traditional algorithms are unsuitable for image encryption and fail to meet information security requirements.

Method used

A quantum image encryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion is adopted. The classical image is converted into a quantum image through the NEQR quantum representation model. A chaotic sequence is generated by the two-dimensional cross-chaotic system, and bit-level operations and iterative diffusion are performed. Encryption is carried out by combining the parallelism of quantum computing.

Benefits of technology

This improves the diffusion efficiency of image encryption, increases the key space, reduces computational complexity, and achieves efficient quantum image encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114978487B_ABST
    Figure CN114978487B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of quantum image encryption and discloses a quantum image encryption method based on two-dimensional cross mapping and dynamic diffusion, which is used for solving the problems of small key space, high complexity of image processing algorithm and time-consuming calculation in the prior art image encryption method. The quantum image encryption and decryption method based on two-dimensional cross chaotic mapping and dynamic diffusion generates a chaos sequence related to a plaintext by a two-dimensional cross chaotic system 2D-LAS, converts a classical image into a quantum image by using an NEQR model, performs a bit-level operation on pixel values of the quantum image by using dynamic diffusion, wherein the bit-level operation includes a bit-level shift operation, a bit-level cross XOR shift operation and a bit-level cyclic shift operation, the shuffling process is to cyclically shift the image between rows and columns, and after the shuffling is completed, the image is iteratively XORed, and the pixel is subjected to a diffusion operation, so that the diffusion efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum image encryption technology, specifically to a quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion. Background Technology

[0002] In recent years, my country has faced severe information security challenges, not only from the same global information security leaks but also from unique problems and challenges arising from different foundations and stages of development. In certain specialized fields, from the exposure of celebrities' private photos to the leakage of medical information, satellite imagery, and remote sensing data, digital image encryption has become a hot and difficult research area in information security. However, due to the high data redundancy, strong correlation between adjacent pixels, and large data volume of digital images, they are vulnerable to various types of attacks during transmission. Traditional encryption algorithms (such as DES and AES) are not entirely suitable for image encryption. Image encryption typically consists of two stages: scrambling and diffusion. The scrambling stage changes the positions of pixels, while the diffusion stage changes the pixel values ​​to hide the statistical structure of the plaintext. Multiple scrambling-diffusion iterations are designed to ensure a corresponding level of security.

[0003] With the rapid development of computer science, quantum computing has made groundbreaking progress. Due to the superposition property of quantum states, storing the same amount of data in an image requires far fewer qubits than storing the same amount of digital data in a quantum image. This results in lower computational complexity compared to classical digital image encryption algorithms. Combining quantum computing with classical image encryption algorithms, leveraging the parallel computing capabilities of quantum computers, presents a secure and effective method for designing cryptographic systems. Summary of the Invention

[0004] This invention addresses the problems of small key spaces, high complexity of image processing algorithms, and time-consuming computation in existing image encryption methods. Quantum encryption technology can achieve theoretical security. Quantum image encryption combines classical encryption methods with quantum information theory, offering advantages such as large capacity, high efficiency, parallelism, and difficulty in cracking. This invention provides a quantum image encryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion.

[0005] A quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion is implemented by the following steps:

[0006] Step 1: Use the grayscale image of size M×N as the original image Image;

[0007] Step 2: Using the NEQR quantum representation model, represent the original image Image as a quantum image |I>.

[0008] Step 3: Calculate the hash value of the original image Image using SHA-256, represented by array H, and obtain the initial values ​​x0, y0 of the two-dimensional cross-chaotic system based on array H;

[0009] Step 4: Iterate the 2D-LAS chaotic system M×N times using initial values ​​x0 and y0 to obtain two chaotic sequences XS and YS with lengths of M×N respectively;

[0010] Step 5: Map the pseudo-random sequences XS and YS from Step 4 to 0 to 2. k Between -1, obtain sequence X1 and sequence Y1; k = log2 M-1;

[0011] Step 6: Select a portion of the sequences X1 and Y1 obtained in Step 5 as the cyclic row shift control sequences CRS1, CRS2 and the cyclic column shift control sequences CCS1, CCS2;

[0012] Step 7: Map the values ​​of the chaotic sequence YS obtained in Step 4 to a range of 1 to 3 to obtain the selection control sequence SC;

[0013] Map the values ​​of the chaotic sequence YS obtained in step four to a range of 1 to 4 to obtain the cyclic shift control sequence CS.

[0014] Step 8: Convert the selection control sequence SC and the cyclic shift control sequence CS obtained in Step 7 into M×N two-dimensional arrays CSC and SCS, respectively;

[0015] Step 9: Perform dynamic selective diffusion on the quantum image |I> obtained in Step 2 to obtain the diffused quantum image ||I1>. The specific process is as follows:

[0016] Select the pixel in the y-th row and x-th column Dynamically select the diffusion operation based on the value of SCS(y,x);

[0017] When SCS(y,x)=1, bit-level swapping is performed on the current binary pixel value of the quantum image |I> using a controlled swapping gate;

[0018] When SCS(y,x)=2, the current binary pixel value of the quantum image |I> Perform bit-level XOR and bit-level shift operations;

[0019] When SCS(y,x)=3, a bit-level cyclic left shift operation is performed on the current binary pixel value of the quantum image ||I>. The number of bits shifted depends on the current value of the array CSC(y,x). After traversing all pixels in the quantum image |I>, the diffused quantum image ||I1> is obtained.

[0020] Step 10: Extract the classical image I1 from the quantum image |I1> using quantum measurement, and perform an inline loop scrambling operation on the classical image I1 to obtain the scrambled image z;

[0021] Step 11: Perform an intra-column cyclic scrambling operation on the scrambled image z obtained in Step 10 to obtain the scrambled image Zz;

[0022] The scrambled image Zz is transformed into a 1×(M×N) one-dimensional matrix ZZz;

[0023] Step 12: Arrange the chaotic sequence XS described in Step 4 in ascending order to obtain the index matrix Index;

[0024] Step 13: Scramble the index of the one-dimensional matrix ZZz from Step 11, and then convert it into a two-dimensional matrix to obtain the scrambled matrix ZZ.

[0025] Step 14: Represent the scrambled matrix ZZ obtained in Step 13 as a quantum image |ZZ> using the NEQR quantum representation model;

[0026] Then, an iterative XOR diffusion operation is performed on the quantum image |ZZ> to obtain the final ciphertext image |C>, as shown in the following equation:

[0027]

[0028] In the formula, The first value is Invert the first value.

[0029] The beneficial effects of this invention are as follows: The quantum image encryption and decryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion proposed in this invention generates a plaintext-related chaotic sequence using a two-dimensional cross-chaotic system 2D-LAS. First, a classical image is converted into a quantum image using a NEQR model. Then, dynamic diffusion is used to perform bit-level operations on the pixel values ​​of the quantum image, including bit-level shift operations, bit-level cross-XOR shift operations, and bit-level cyclic shift operations. The scrambling process first performs cyclic shifts between rows and columns of the image. After scrambling, the image is iteratively XORed and then diffused to the pixels, thereby improving the diffusion efficiency. Attached Figure Description

[0030] Figure 1 The encryption process flowchart of the quantum image encryption and decryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion described in this invention;

[0031] Figure 2 The flowchart of the decryption process in the quantum image encryption and decryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion described in this invention;

[0032] Figure 3 The diagram shows the effect of quantum image encryption and decryption based on two-dimensional cross-chaotic mapping and dynamic diffusion as described in this invention: Figure 3 (a) is the original image of the "sailboat"; where Figure 3 (b) is the encrypted version of the "sailboat" image; where Figure 3 (c) is the final decryption result of the "sailboat" image;

[0033] Figure 4 The quantum circuit diagram for the quantum image encryption and decryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion described in this invention is as follows: Figure 4 (a) represents the bit-plane shifting operation of a quantum circuit; where Figure 4 (b) represents the bit-plane cross-XOR shift operation of the quantum circuit; where Figure 4 (c) is the iterative XOR diffusion operation of the quantum circuit;

[0034] Figure 5 Histogram analysis was performed using the quantum image encryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion described in this invention: where Figure 5 (a) is Figure 3 (a) Histogram; where Figure 5 (b) is Figure 3 (b) Histogram. Detailed Implementation

[0035] Specific Implementation Method 1: Combination Figure 1 and Figure 2 This embodiment describes a quantum image encryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion.

[0036] Step 1: Use the grayscale image of size M×N as the original image Image;

[0037] Step 2: Using the NEQR quantum representation model, represent the original image Image as a quantum image |I>.

[0038]

[0039] in, This represents the grayscale information of the pixel corresponding to the position |yx>, where |yx>=|y> and |x>=|y n-1 y n-2 …y0>|x n-1 x n-2 …x0> represents the position coordinates; symbol Represents the tensor product;

[0040] Step 3: Calculate the hash value of the original image Image using SHA-256. The 256-bit hash value, represented as a hexadecimal array, can be obtained using the following formula:

[0041] H = [h1, h2, ..., h 64 ]

[0042] Step 4: Using some sequences in array H, calculate the initial values ​​x0, y0 of the two-dimensional cross-chaotic system according to the following formula:

[0043]

[0044] Where w,v = 1,2,…,57, and hex2dec is used to convert the hexadecimal number represented by the string into a decimal number;

[0045] Step 5: Use a 2D-LAS chaotic system, as shown in the formula:

[0046]

[0047] Where t = 1, 2, ..., M × N - 1, a and μ are control parameters, xs(t) is the t-th value of the xs sequence generated by the 2D-LAS chaotic system, and ys(t) is the t-th value of the ys sequence generated by the 2D-LAS chaotic system.

[0048] Step 6: Iterate the 2D-LAS chaotic system from Step 5 M×N times using initial values ​​x0 and y0 to obtain two pseudo-random sequences XS and YS of length M×N, as shown in the formula:

[0049]

[0050] Step 7: Map the pseudo-random sequences XS and YS from Step 6 to 0 to 2. k The values ​​between -1 and Y1 are denoted as X1 and Y1, respectively.

[0051] Where k = log2 M-1.

[0052] Step 8: Select a portion of the sequences X1 and Y1 obtained in Step 7 as the cyclic row shift control sequences CRS1 and CRS2 and the cyclic column shift control sequences CCS1 and CCS2, as shown in the formula:

[0053]

[0054] Where k1 = 1, 2, ..., M, k2 = 1, 2, ..., N.

[0055] Step 9: Map the values ​​of the chaotic sequence YS obtained in Step 6 to the range of 1 to 3 to obtain the selection control sequence, denoted as SC;

[0056] SC = uint8(mod(ceil(YS*10)) 6 ),3)+1),SC∈[1,2,3]

[0057] Here, ceil is the round-up operation.

[0058] Step 10: Map the values ​​of the chaotic sequence YS obtained in Step 6 to the range of 1 to 4 to obtain the cyclic shift control sequence denoted as CS;

[0059] CS = uint8(mod(ceil(YS*10)) 6 ),4)+1),CS∈[1,2,3,4]

[0060] Step 11: Convert the one-dimensional arrays SC and CS obtained in Steps 9 and 10 into two-dimensional arrays SCS and CSC of size M×N, respectively.

[0061] Step 12: Perform dynamic selective diffusion on the quantum image |I>, as follows:

[0062] Select the pixel in the y-th row and x-th column Dynamically select the diffusion operation based on the value of SCS(y,x):

[0063] When SCS(y,x)=1, the current binary pixel value of the quantum image |I> is swapped at the bit level using a quantum controlled swapping gate, as shown in the following equation:

[0064]

[0065] A controlled swap gate is used for bit-level swapping: first, the 7th qubit is swapped with the 3rd qubit, the 6th qubit with the 2nd qubit, the 5th qubit with the 1st qubit, and the 4th qubit with the 0th qubit. Then, the 6th qubit is swapped with the 5th qubit, the 4th qubit with the 3rd qubit, and the 2nd qubit with the 1st qubit. U YX For control of the switching gate; for Transitional substitution;

[0066]

[0067] When SCS(y,x)=2, the current binary pixel value of the quantum image |I> Perform bit-level XOR and bit-level swap operation;

[0068] First, perform a cross-OR operation:

[0069]

[0070] First, a cross-XOR operation is performed, where the 0th qubit is XORed with the 7th qubit to obtain the new state of the 7th qubit; the 1st qubit is XORed with the 6th qubit to obtain the new state of the 6th qubit; the 2nd qubit is XORed with the 5th qubit to obtain the new state of the 5th qubit; and the 3rd qubit is XORed with the 4th qubit to obtain the new state of the 4th qubit.

[0071] After the cross-XOR operation, a bit-level shift operation is performed:

[0072]

[0073]

[0074] When SCS(y,x)=3, a bit-level cyclic left shift operation is performed on the current binary pixel value of the quantum image ||I>. The number of bits shifted depends on the current value of the array CSC(y,x).

[0075]

[0076] After traversing all the pixels in the quantum image |I>, the diffused quantum image ||I1> is obtained.

[0077] Where x = 0, 1, ..., N-1, y = 0, 1, ..., M-1, This refers to the XOR operation of qubits implemented using a controlled NOT gate, U YX For control of the switching gate.

[0078] Step 13: Extract the classical image I1 from it using quantum measurement.

[0079] Step 14: Perform an inline loop scrambling operation on the classic image I1 to obtain the scrambled image z;

[0080] When CRS1 is greater than or equal to CCS1, the i-th row of matrix I1 is cyclically shifted to the right by CRS1-CCS1 positions.

[0081] z(i,:)=circshift(I1(i,:),double(CRS1(i))-double(CCS1(i)))

[0082] When CRS1 is less than CCS1, the i-th row of matrix I1 is cyclically shifted left by CCS1-CRS1 positions.

[0083] z(i,:)=circshift(I1(i,:),double(CRS1(i))-double(CCS1(i)))

[0084] Where (i,:) represents all pixel values ​​in the i-th row of the image, i = 1, 2, ..., M, and circshift() represents the circular shift function;

[0085] Step 15: Perform an intra-column cyclic scrambling operation on the scrambled image z obtained in Step 14 to obtain the scrambled image Zz;

[0086] When CRS2 is greater than or equal to CCS2, the j-th column of the matrix is ​​cyclically shifted down by CRS2-CCS2 positions.

[0087] Zz(:,j)=circshift(z(:,j),double(CRS2(j))-double(CCS2(j)))

[0088] When CRS2 is less than CCS2, the j-th column of the matrix is ​​cyclically shifted up by CCS2-CRS2 positions.

[0089] Zz(:,j)=circshift(z(:,j),double(CRS2(j))-double(CCS2(j)))

[0090] Where (:,j) represents all pixel values ​​in the j-th column of the image, j = 1, 2, ..., N;

[0091] Step 16: Perform matrix transformation on the image Zz to convert it into a one-dimensional matrix ZZz of size 1×(M×N);

[0092] Step 17: Arrange the chaotic sequence XS described in Step 6 in ascending order to obtain the index matrix Index;

[0093] Step 18: Scramble the index of the one-dimensional matrix ZZz and then convert it into a two-dimensional matrix to obtain the scrambled matrix ZZ.

[0094] Step 19: For the scrambled matrix ZZ obtained in Step 18, considering the security of transmission, matrix ZZ can be represented as a quantum image |ZZ> using NEQR;

[0095] Step 20: Perform iterative XOR diffusion operations on the quantum image |ZZ> to obtain the final ciphertext image |C> as follows:

[0096]

[0097] in, The first value is Invert the first value.

[0098] This embodiment also includes an image decryption method, which is implemented by the following steps:

[0099] Step 23: Perform an inverse iterative XOR diffusion operation on the ciphertext image |C> to obtain the quantum image |ZZ′>, as shown in the formula:

[0100]

[0101] Where x″=N-1,N-2,…,1, The first value is Invert the first value.

[0102] Step 24: Extract the classical matrix ZZ′ from the quantum image |ZZ′> using quantum measurement, and obtain the position decryption index sequence Index′ for the chaotic sequence XS described in Step 6 according to the method shown in Step 18;

[0103] Step 25: Transform the classical matrix ZZ′ into a one-dimensional matrix and then scramble it with the inverse index to obtain the one-dimensional matrix ZZz′;

[0104] The one-dimensional matrix ZZz′ is transformed into an M×N image Zz′ and an inverse scrambling operation is performed within the columns to obtain the scrambled image z′.

[0105] When CRS2 is greater than or equal to CCS2, the j-th column of the matrix is ​​cyclically shifted up by CRS2-CCS2 positions.

[0106] z′(:,j)=circshift(ZZ′(:,j),double(CCS2(j))-double(CRS2(j)))

[0107] When CRS2 is less than CCS2, the j-th column of the matrix is ​​cyclically shifted down by CCS2-CRS2 positions.

[0108] z′(:,j)=circshift(ZZ′(:,j),double(CCS2(j))-double(CRS2(j)))

[0109] Step 28: Perform an in-row loop reverse scrambling operation on the scrambled image z′ to obtain the scrambled image I1′;

[0110] When CRS1 is greater than or equal to CCS1, the i-th row of the matrix is ​​cyclically shifted left by CRS1-CCS1 positions.

[0111] I1′(i,:)=circshift(z′(i,:),double(CCS1(i))-double(CRS1(i)))

[0112] When CRS1 is less than CCS1, the i-th row of the matrix is ​​cyclically shifted to the right by CCS1-CRS1 positions.

[0113] I1′(i,:)=circshift(z′(i,:),double(CCS1(i))-double(CRS1(i)))

[0114] Where (i,:) represents all pixel values ​​in the i-th row of the image, i = 1, 2, ..., M;

[0115] Step 29: Represent the scrambled image I1′ as a quantum image ||I1′> using NEQR;

[0116] The quantum image ||I1′> is then subjected to dynamic selective inverse diffusion, as follows:

[0117] Select the pixel in the y-th row and x-th column Dynamically select diffusion operation based on the value of SCS(y,x)

[0118] When SCS(y,x)=1, the current binary pixel value of the quantum image ||I1′> is swapped at the bit level using a quantum swap gate;

[0119]

[0120]

[0121] When SCS(y,x)=2, the current binary pixel value of the quantum image |I1′> Perform bit-level swapping and bit-level XOR operations;

[0122] First, perform a bit-level swap operation:

[0123]

[0124] After bit-level shifting, perform an XOR operation:

[0125]

[0126]

[0127] When SCS(y,x)=3, a bit-level cyclic right shift operation is performed on the current binary pixel value of the quantum image |I1′>. The number of bits shifted depends on the current value of the array CSC(y,x).

[0128]

[0129] Where x = 0, 1, ..., N-1, y = 0, 1, ..., M-1, and The changed grayscale value. This refers to the qubit XOR operation implemented using a controlled NOT gate.

[0130] Step 31: Obtain the quantum image |I′> through the aforementioned dynamic selection of reverse diffusion;

[0131] Step 32: Extract the classical image I from the quantum image |I′> using quantum measurement to finally obtain the decrypted image I.

[0132] Specific Implementation Method Two: Combination Figures 1 to 5 This embodiment describes a specific implementation of the quantum image encryption method based on two-dimensional cross-chaotic mapping and dynamic diffusion described in Implementation Method 1. The method is implemented through the following steps:

[0133] In this embodiment, the user's encryption and decryption keys are set as: the initial value of the 2D-LAS chaotic system, the number of iterations, and the control parameters for dynamic adaptive diffusion.

[0134] Step 1: Use a 512×512 grayscale image as the original image (Image), as shown in the attached image. Figure 3 As shown in (a);

[0135] Step 2: Using the NEQR quantum representation model, the original image Image is represented as a quantum image |I> by formula (1);

[0136]

[0137] in, This represents the grayscale information of the pixel corresponding to the position |yx>, where |yx>=|y> and |x>=|y n-1 y n-2 …y0>|x n-1 x n-2 …x0> represents the position coordinates; symbol Represents the tensor product.

[0138] Step 3: Calculate the hash value of the original image Image using SHA-256. The 256-bit hash value, represented by a hexadecimal array, can be obtained using formula (2):

[0139] H = [h1, h2, ..., h 64 (2)

[0140] Step 4: Using some sequences in array H, calculate the initial values ​​x0, y0 of the two-dimensional cross-chaotic system according to the following formula (3):

[0141]

[0142] Wherein, hex2dec is used to convert a hexadecimal number represented by a string into a decimal number. In this embodiment, x0 = 0.3538, y0 = 0.4262;

[0143] Step 5: Use a 2D-LAS chaotic system, as shown in Equation (4):

[0144]

[0145] Where t = 1, 2, ..., 262143, a, μ are control parameters.

[0146] Step 6: Iterate the two-dimensional cross-chaotic system from step 5 262144 times using initial values ​​x0, y0 to obtain two pseudo-random sequences XS and YS of length M×N, as shown in formula (5):

[0147]

[0148] Step 7: Map the pseudo-random sequences XS and YS from Step 6 to the range of 0 to 255, and denote them as X1 and Y1.

[0149] Step 8: Select a portion of the sequences X1 and Y1 obtained in Step 7 as the cyclic row shift control sequences CRS1 and CRS2 and the cyclic column shift control sequences CCS1 and CCS2, as shown in Formula (6):

[0150]

[0151] Where k1 = 1, 2, ..., 512, k2 = 1, 2, ..., 512.

[0152] Step 9: Map the values ​​of the chaotic sequence YS obtained in Step 6 to between 1 and 3 to obtain the selection control sequence denoted as SC, as shown in Formula (7);

[0153] SC = uint8(mod(ceil(YS*10)) 6 ),3)+1),SC∈[1,2,3] (7)

[0154] Here, ceil is the round-up operation.

[0155] Step 10: Map the value of the chaotic sequence YS obtained in Step 6 to between 1 and 4 to obtain the cyclic shift control sequence denoted as CS, as shown in Formula (8);

[0156] CS = uint8(mod(ceil(YS*10)) 6 ),4)+1),CS∈[1,2,3,4] (8)

[0157] Step 11: Convert the selection control sequence SC and the cyclic shift control sequence CS obtained in Step 9 and Step 10 into two-dimensional arrays SCS and CSC of size 512×512, respectively.

[0158] Step 12: Perform dynamic selective diffusion on the quantum image |I>, as follows:

[0159] Select the pixel in the y-th row and x-th column Dynamically select diffusion operation based on the value of SCS(y,x)

[0160] When SCS(y,x)=1, the current binary pixel value of the quantum image |I> is swapped at the bit level using a quantum swap gate, as shown in the appendix. Figure 4 As shown in (a);

[0161]

[0162]

[0163] When SCS(y,x)=2, the current binary pixel value of the quantum image |I> Perform bit-level XOR and bit-level shift operations, as shown in the appendix. Figure 4 As shown in (b);

[0164] First, perform a cross-OR operation:

[0165]

[0166] After the cross-XOR operation, a bit-level shift operation is performed:

[0167]

[0168]

[0169] When SCS(y,x)=3, a bit-level cyclic left shift operation is performed on the current binary pixel value of the quantum image |I>. The number of bits shifted depends on the current value of the array CSC(y,x).

[0170]

[0171] After traversing all the pixels in the quantum image |I>, the diffused quantum image |I1> is obtained.

[0172] Where x = 0, 1, ..., N-1, y = 0, 1, ..., M-1, The changed grayscale value. The XOR operation of a qubit implemented by a controlled NOT gate, U YX For control of the switching gate;

[0173] Step 13: Extract the classical image I1 from the quantum image |I1> using quantum measurement;

[0174] Step 14: Perform an inline loop scrambling operation on the classic image I1 to obtain the scrambled image z;

[0175] When the cyclic row shift control sequence CRS1 is greater than or equal to the cyclic column shift control sequence CCS1, the i-th row of the classic image I1 is cyclically shifted right by CRS1-CCS1 positions.

[0176] z(i,:)=circshift(I1(i,:),double(CRS1(i))-double(CCS1(i))) (13)

[0177] When the cyclic row shift control sequence CRS1 is less than the cyclic column shift control sequence CCS1, the i-th row of the classic image I1 is cyclically shifted left by CCS1-CRS1 positions.

[0178] z(i,:)=circshift(I1(i,:),double(CRS1(i))-double(CCS1(i))) (14)

[0179] Where (i,:) represents all pixel values ​​in the i-th row of the image, i = 1, 2, ..., 512;

[0180] Step 15: Perform an intra-column cyclic scrambling operation on the scrambled image z obtained in Step 14 to obtain the scrambled image Zz.

[0181] When CRS2 is greater than or equal to CCS2, the j-th column of the matrix is ​​cyclically shifted down by CRS2-CCS2 positions.

[0182] Zz(:,j)=circshift(z(:,j),double(CRS2(j))-double(CCS2(j))) (15)

[0183] When CRS2 is less than CCS2, the j-th column of the matrix is ​​cyclically shifted up by CCS2-CRS2 positions.

[0184] Zz(:,j)=circshift(z(:,j),double(CRS2(j))-double(CCS2(j))) (16)

[0185] Where (:,j) represents all pixel values ​​in the j-th column of the image, j = 1, 2, ..., 512;

[0186] Step 16: Perform matrix transformation on the scrambled image Zz to convert it into a 1×262144 one-dimensional matrix ZZz;

[0187] Step 17: Arrange the chaotic sequence X described in Step 5 in ascending order to obtain the index matrix Index;

[0188] Step 18: Scramble the index of the one-dimensional matrix ZZz, and then convert it into a two-dimensional matrix to obtain the scrambled one-dimensional matrix ZZ.

[0189] Step 19: Represent the scrambled matrix ZZ obtained in Step 18 as a quantum image |ZZ> using NEQ;

[0190] Step 20: Perform iterative XOR diffusion operations on the quantum image |ZZ> to obtain the final ciphertext image |C>, as shown in the appendix. Figure 4 As shown in (c);

[0191]

[0192] Where x′=1,2,…,N-1, The first value is Invert the first value;

[0193] It also includes an image decryption method, implemented through the following steps:

[0194] Step 23: Perform an iterative XOR operation on the ciphertext image |C> to obtain the quantum image |ZZ′>, as shown in formula (18):

[0195]

[0196] Where x″=N-1,N-2,…,1, The first value is Invert the first value;

[0197] Step 24: Extract the classical matrix ZZ′ from the matrix |ZZ′> using quantum measurement, and obtain the position decryption index sequence Index′ for the chaotic sequence XS according to the method shown in Step 18;

[0198] Step 25: Transform the classical matrix ZZ′ into a one-dimensional matrix and then scramble it with the inverse index to obtain the one-dimensional matrix ZZz′;

[0199] The one-dimensional matrix ZZz′ is transformed into a 512×512 image Zz′ and an in-column cyclic reverse scrambling operation is performed to obtain the scrambled image z′.

[0200] When CRS2 is greater than or equal to CCS2, the j-th column of the matrix is ​​cyclically shifted up by CRS2-CCS2 positions.

[0201] z′(:,j)=circshift(ZZ′(:,j),double(CCS2(j))-double(CRS2(j))) (19)

[0202] When CRS2 is less than CCS2, the j-th column of the matrix is ​​cyclically shifted down by CCS2-CRS2 positions.

[0203] z′(:,j)=circshift(ZZ′(:,j),double(CCS2(j))-double(CRS2(j))) (20)

[0204] Step 28: Perform an in-row loop reverse scrambling operation on the scrambled image z′ to obtain the scrambled image I1′;

[0205] When CRS1 is greater than or equal to CCS1, the i-th row of the matrix is ​​cyclically shifted left by CRS1-CCS1 positions.

[0206] I'1(i,:)=circshift(z'(i,:),double(CCS1(i))-double(CRS1(i))) (21)

[0207] When CRS1 is less than CCS1, the i-th row of the matrix is ​​cyclically shifted to the right by CCS1-CRS1 positions.

[0208] I′1(i,:)=circshift(z′(i,:),double(CCS1(i))-double(CRS1(i))) (22)

[0209] Where (i,:) represents all pixel values ​​in the i-th row of the image, i = 1, 2, ..., 512;

[0210] Step 29: Represent the scrambled image I1′ as a quantum image |I1′> using NEQR;

[0211] Step 30: Perform dynamic selective inverse diffusion on the quantum image |I1′>, as follows:

[0212] Select the pixel in the y-th row and x-th column Dynamically select diffusion operation based on the value of SCS(y,x)

[0213] When SCS(y,x)=1, the current binary pixel value of the quantum image |I1′> is swapped at the bit level using a quantum swap gate;

[0214]

[0215]

[0216] When SCS(y,x)=2, the current binary pixel value of the quantum image ||I1′> Perform bit-level swapping and bit-level XOR operations;

[0217] First, perform a bit-level swap operation:

[0218]

[0219] After bit-level shifting, perform an XOR operation:

[0220]

[0221]

[0222] When SCS(y,x)=3, a bit-level cyclic right shift operation is performed on the current binary pixel value of the quantum image |I1′>. The number of bits shifted depends on the current value of the array CSC(y,x).

[0223]

[0224] Where x = 0, 1, ..., N-1, y = 0, 1, ..., M-1, and The changed grayscale value. This refers to the XOR operation of qubits implemented using a controlled NOT gate, U YX For control of the switching gate.

[0225] Step 31: Obtain the quantum image |I′> through the aforementioned dynamic selection of reverse diffusion;

[0226] Step 32: Extract the classical image I from the quantum measurement of the quantum image |I′>, and finally obtain the decrypted image I.

[0227] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0228] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion, which is implemented by the following steps: Step 1: [The text appears to be incomplete and contains several typos. A more accurate translation would require the full context. The grayscale image is used as the original image Image; Step 2: Represent the original image as a quantum image using the NEQR quantum representation model. ; Step 3: Calculate the hash value of the original image Image using SHA-256, represented by array H. Obtain the initial values ​​of the two-dimensional cross-chaotic system based on array H. ; Step 4: Use initial values Iterating over the 2D-LAS chaotic system Next, two lengths are obtained. chaotic sequence ; Step 5: Map the pseudo-random sequences XS and YS from Step 4 to 0 to 1. Between these two sequences, obtain sequence X1 and sequence Y1; Step 6: Select a portion of the sequences X1 and Y1 obtained in Step 5 as the cyclic row shift control sequences CRS1, CRS2 and the cyclic column shift control sequences CCS1, CCS2; Step 7: Map the values ​​of the chaotic sequence YS obtained in Step 4 to a range of 1 to 3 to obtain the selection control sequence SC; Map the values ​​of the chaotic sequence YS obtained in step four to a range of 1 to 4 to obtain the cyclic shift control sequence CS. Step 8: Convert the selection control sequence SC and the cyclic shift control sequence CS obtained in Step 7 into... Two-dimensional arrays CSC and SCS; Step 9: Analyze the quantum image obtained in Step 2. Performing dynamic selective diffusion to obtain the quantum image after diffusion | The specific process is as follows: Select the pixel in the y-th row and x-th column The diffusion operation is dynamically selected based on the value of SCS(y,x); When SCS(y,x)=1, for the quantum picture The current binary pixel value is bit-level swapped using a controlled swapping gate; When SCS(y,x)=2, for the quantum picture Current binary pixel value Perform bit-level XOR and bit-level shift operations; When SCS(y,x)=3, for quantum picture The current binary pixel value is subjected to a bit-level circular left shift operation, and the number of bits shifted depends on the current value of the array CSC(y,x); when traversing the quantum image After processing all pixels, the diffused quantum image is obtained. ; Step 10: Using quantum measurement to obtain quantum images Extracting classic images and classic images Perform an inline loop scrambling operation to obtain a scrambled image. ; Step 11: Scramble the image obtained in Step 10. Perform a scrambling operation within the column to obtain a scrambled image. ; The scrambled image Perform matrix transformation to convert it into One-dimensional matrix ; Step 12: Arrange the chaotic sequence XS described in Step 4 in ascending order to obtain the index matrix. ; Step 13: For the one-dimensional matrix in Step 11 The indexes are scrambled, and then the matrix is ​​converted into a two-dimensional matrix to obtain the scrambled matrix. ; Step Fourteen: The scrambled matrix obtained in Step Thirteen... It is represented as a quantum image using the NEQR quantum representation model. ; And the quantum image Perform iterative XOR diffusion operations to obtain the final ciphertext image. As shown in the following formula: ; In the formula, The first value is Invert the first value.

2. The quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion according to claim 1, characterized in that: It also includes an image decryption method, implemented through the following steps: Step A: encrypt the image Perform inverse iterative XOR diffusion operations to obtain a quantum picture. As shown in the formula: in, The first value is Invert the first value; Step B: Using quantum measurement to obtain quantum images Extracting classical matrices The position decryption index sequence is obtained from the chaotic sequence XS using the method shown in step fourteen. ; Step C: For classical matrices Convert to a one-dimensional matrix and then scramble it using the inverse index to obtain a one-dimensional matrix. ; The one-dimensional matrix Transform into Image Then, perform a reverse scrambling operation within the column to obtain the scrambled image. ; when Greater than or equal to At that time, the j-th column of the matrix is ​​shifted upwards cyclically. Bit; ; when Less than At that time, the j-th column of the matrix shifts down cyclically. Bit; Step D: The scrambled image Perform an inverse scrambling operation within the row to obtain the scrambled image. ; when Greater than or equal to At that time, the matrix of the first... Circular left shift Bit; ; when Less than When the i-th row of the matrix is ​​circularly shifted to the right... Bit; ; in, Represents the first in the image All pixel values ​​in the row, Step E: The scrambled image Representing it as a quantum picture using NEQR | ; And for quantum images | Dynamically selected inverse diffusion is used to obtain a quantum picture. ; Step F: For the quantum image Extracting classical images from quantum measurements ultimately yields the decrypted image. .

3. The quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion according to claim 1, characterized in that: In step seven, the formula for selecting the control sequence SC is as follows: in, Represents an 8-bit unsigned integer. This is a rounding up operation; The formula for the cyclic shift control sequence CS is as follows: 。 4. The quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion according to claim 1, characterized in that: In step nine, When SCS(y,x)=1, for the quantum picture The current binary pixel value is bit-level swapped using a controlled swapping gate; the specific process is as follows: ; That is: first, swap the 7th qubit with the 3rd qubit, the 6th qubit with the 2nd qubit, the 5th qubit with the 1st qubit, and the 4th qubit with the 0th qubit; then swap the 6th qubit with the 5th qubit, the 4th qubit with the 3rd qubit, and the 2nd qubit with the 1st qubit. For control of the switching gate, Transitional substitution; When SCS(y,x)=2, for the quantum picture Current binary pixel value Perform bit-level XOR and bit-level shift operations; the formula is as follows: ; That is: first, a cross-XOR operation is performed, where the 0th qubit is XORed with the 7th qubit to obtain the new state of the 7th qubit; the 1st qubit is XORed with the 6th qubit to obtain the new state of the 6th qubit; the 2nd qubit is XORed with the 5th qubit to obtain the new state of the 5th qubit; and the 3rd qubit is XORed with the 4th qubit to obtain the new state of the 4th qubit. After the cross-XOR operation, a bit-level shift operation is performed: ; When SCS(y,x)=3, for the quantum picture | The current binary pixel value is subjected to a bit-level circular left shift operation, and the number of bits shifted depends on the current value of the array CSC(y,x); in, The XOR operation of qubits implemented using a controlled NOT gate; When traversing the quantum image After processing all pixels, the diffused quantum image is obtained. .

5. The quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion according to claim 1, characterized in that: In step ten, the classic image is processed. Perform an inline loop scrambling operation to obtain a scrambled image. The specific process is as follows: When the cyclic shift control sequence Greater than or equal to cyclic column shift control sequence At that time, classic images Circular right shift of the i-th row Bit; ; When the cyclic shift control sequence Less than the cyclic column shift control sequence At that time, classic images Circular left shift of the i-th row Bit; in, For the first in the image All pixel values ​​in the row, 6. The quantum image encryption method based on two-dimensional cross-mapping and dynamic diffusion according to claim 1, characterized in that: Step 11: Scramble the image obtained in Step 10. Perform a scrambling operation within the column to obtain a scrambled image. ; The specific process is as follows: when Greater than or equal to At that time, the j-th column of the matrix shifts down cyclically. Bit; when Less than At that time, the j-th column of the matrix is ​​shifted upwards cyclically. Bit; in, For all pixel values ​​in the j-th column of the image,

Citation Information

Patent Citations

  • Plaintext correlation-based full-connection-like network image encryption method

    CN112887075A

  • Color quantum image encryption and decryption method based on multi-chaos and DNA operation

    CN113297606A