Image encryption method and device, program product and electronic equipment
By generating quantum keys based on chaotic sequences to encrypt images, and using nonlinear mapping functions and DNA encryption technology, the problem of low transaction information security in the financial industry is solved, and high-security transmission and storage of images is achieved.
Patent Information
- Application Number
- CN202410711560.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-03
AI Technical Summary
In the financial industry, transaction information contained in digital images suffers from low information security during transmission and storage, and existing technologies have not been able to effectively solve this problem.
By generating a quantum key based on a chaotic sequence and using this key to encrypt the image, the pseudo-random sequence generated by the nonlinear mapping function is more random and secure. Combined with DNA encryption and decoding technology, the image can be decrypted. High security encryption.
It improves the security of images during transmission and storage, ensures the security of transaction information in financial institutions, and solves the problem of low information security.
Smart Images

Figure CN118590591A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image encryption, financial technology and other related technical fields, and specifically, to an image encryption method, device, program product and electronic device. Background Art
[0002] With the rapid development of network technology and multimedia technology, the current society has entered a comprehensive digital era. Among them, digital images, as one of the important information carriers, are increasingly used in the financial industry and other fields. For example, large banks store a large number of digital images including customer information and transaction information. In the office system of financial institutions, if the original digital images including customer information and transaction information are directly transmitted and stored, it will cause technical problems such as easy leakage of customer information and transaction information and low information security.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The present application provides an image encryption method, device, program product and electronic device to at least solve the technical problem of low information security in the process of transmitting and storing images including transaction information in the prior art.
[0005] According to one aspect of the present application, there is provided an image encryption method, comprising: obtaining a target sequence by performing encryption operations on a first sequence and a second sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions; generating a quantum key according to the target sequence, wherein the quantum key is represented by a matrix; encrypting a first image by using the quantum key to obtain a target encrypted image, wherein the first image is used to represent transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0006] Optionally, the image encryption method also includes: intercepting L values in the first sequence as a third sequence, intercepting L values in the second sequence as a fourth sequence, wherein L is a positive integer; performing rounding and normalization operations on the third sequence to obtain a fifth sequence, wherein the rounding operation is used to convert the values in the third sequence and the fourth sequence into integers, and the normalization operation is used to update the values obtained by the rounding operation to within a preset range; performing rounding and normalization operations on the fourth sequence to obtain a sixth sequence; and obtaining a target sequence by performing DNA encryption on the fifth sequence and the sixth sequence, wherein the DNA encryption is used to perform DNA addition and subtraction mixed operations on the values in the fifth sequence and the sixth sequence.
[0007] Optionally, the image encryption method also includes: converting each numerical value in the fifth sequence into a binary code to obtain a first code corresponding to the fifth sequence; converting each numerical value in the sixth sequence into a binary code to obtain a second code corresponding to the sixth sequence; performing a DNA encryption operation on the first code and the second code to obtain a DNA sequence, wherein the elements in the DNA sequence are in the form of letters; and obtaining a target sequence by performing DNA decoding on each element in the DNA sequence, wherein the DNA decoding is used to convert the elements in the DNA sequence from letter form to numerical form.
[0008] Optionally, the image encryption method further includes: obtaining a first matrix by converting the target sequence into a column-sorted form, wherein element values in the first matrix are numerical values in the target sequence; and generating a quantum key based on the first matrix.
[0009] Optionally, the image encryption method also includes: generating a second matrix based on the first image, wherein the second matrix is used to represent the grayscale information in the first image, and the second matrix has the same size as the matrix corresponding to the quantum key; obtaining the correspondence between element values in the second matrix and numerical values included in the quantum key, wherein the arrangement position of the element values in the second matrix and the arrangement position of the numerical values corresponding to the element values in the quantum key are the same; encrypting the element value corresponding to each numerical value in the quantum key, and determining the target encrypted image based on the encryption result.
[0010] Optionally, the image encryption method also includes: performing a degradation operation on the first image to obtain a second image, wherein the resolution of the second image is lower than the resolution of the first image; obtaining a first mapping matrix between the second image and the first image, wherein the first mapping matrix is used to convert a low-resolution image into a high-resolution image; performing a dimensionality reduction operation on the first mapping matrix to obtain a second mapping matrix, wherein the second mapping matrix is a one-dimensional matrix; and encrypting the second mapping matrix according to a target sequence to obtain a target encrypted matrix.
[0011] Optionally, the image encryption method also includes: decrypting the target encrypted image based on the quantum key to obtain a first decrypted image; decrypting the target encryption matrix based on the target sequence to obtain a first mapping matrix; and enhancing the resolution of the first decrypted image according to the first mapping matrix to obtain a first image.
[0012] According to another aspect of the present application, an image encryption device is also provided, including: a first encryption unit, used to obtain a target sequence by performing encryption operation on a first sequence and a second sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, and the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions; a first generation unit, used to generate a quantum key based on the target sequence, wherein the quantum key is represented by a matrix; a second encryption unit, used to encrypt a first image by means of a quantum key to obtain a target encrypted image, wherein the first image is used to represent transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0013] According to another aspect of the present application, a computer program product is also provided, in which a computer program is stored, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned image encryption methods.
[0014] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any one of the above-mentioned image encryption methods.
[0015] In the present application, firstly, an encryption operation is performed on a first sequence and a second sequence to obtain a target sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, and the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions. Then, a quantum key is generated according to the target sequence, wherein the quantum key is represented in a matrix manner. After that, a first image is encrypted by the quantum key to obtain a target encrypted image, wherein the first image is used to represent transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0016] From the above content, it can be seen that the present application provides a method for generating quantum keys based on chaotic sequences and encrypting digital images through quantum keys. Since the pseudo-random sequence (i.e., chaotic sequence) generated by the nonlinear mapping function in the chaotic system has the characteristics of large key space and initial value sensitivity, in the present application, two different chaotic sequences generated by two different nonlinear mapping functions are encrypted, and the randomness of the numerical values in the obtained target sequence is stronger. Therefore, the randomness and security of the quantum key generated based on the target sequence in the present application are higher.
[0017] It can be seen that the present application encrypts the original digital image (i.e., the first image) to be stored and transmitted through a quantum key with higher randomness and security to obtain a target encrypted image, thereby achieving the purpose of using the target encrypted image as a medium for storing and transmitting transaction information in financial institutions, and achieving the technical effect of improving the security of storage objects and transmission objects, thereby solving the technical problem of low information security in the process of transmitting and storing images including transaction information in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 is a flow chart of an optional image encryption method according to an embodiment of the present application;
[0020] Figure 2 is a schematic diagram of an optional DNA addition operation rule according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of an optional DNA subtraction operation rule according to an embodiment of the present application;
[0022] Figure 4 is a flow chart of an optional image degradation method according to an embodiment of the present application;
[0023] Figure 5 is a flowchart of an optional method for generating a first mapping matrix according to an embodiment of the present application;
[0024] Figure 6 is a flowchart of an optional convolutional neural network learning process according to an embodiment of the present application;
[0025] Figure 7 is a schematic diagram of an optional image encryption device according to an embodiment of the present application;
[0026] Figure 8 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] It should also be noted that the relevant information (including information on system tasks) and data (including but not limited to data for display and analysis) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0030] In addition, the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant information and data involved in this application comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken and do not violate public order and good morals. In addition, this application provides corresponding operation entrances for users to choose to agree to authorization or refuse authorization. If the user chooses to refuse authorization, he / she will enter the corresponding expert decision-making process.
[0031] According to an embodiment of the present application, an embodiment of an image encryption method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] The present application provides an image encryption system for executing the image encryption method in the present application. Figure 1 is a flowchart of an optional image encryption method according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0033] Step S101, obtaining a target sequence by performing encryption operation on a first sequence and a second sequence.
[0034] In step S101, the first sequence is a chaotic sequence generated by a first preset function, and the second sequence is a chaotic sequence generated by a second preset function. The first preset function and the second preset function are two different nonlinear mapping functions.
[0035] Optionally, the target sequence obtained by performing encryption operation on the first sequence and the second sequence is also a chaotic sequence.
[0036] Alternatively, chaotic sequences can be generated by chaotic systems, which are highly sensitive to initial conditions, i.e., small initial differences may cause the chaotic system to evolve completely different trajectories. The characteristics of chaotic sequences include: pseudo-randomness, chaotic sequences are mathematically deterministic, but behave similarly to random number sequences, with good random properties; unpredictability, because the sensitivity of chaotic systems depends on initial conditions, it is difficult to accurately predict the future state of chaotic sequences; periodicity, chaotic sequences are usually periodic, but the period may be very long, even approaching infinity, and statistical properties, the statistical properties of chaotic sequences are similar to those of true random number sequences, such as uniformity, independence, and distribution.
[0037] Optionally, the first preset function is preferably a Logistic mapping function, wherein the expression of the Logistic mapping function is shown in the following formula (1):
[0038]
[0039] In the above formula (1), β is the dissipation parameter; r is the control parameter; x, y, z are complex numbers; x * and z * are the complex conjugates of x and z respectively. As the number of iterations increases, y n , z n Gradually tends to 0, x n Enter a state of chaos.
[0040] Optionally, the second preset function is preferably a Chebyshev mapping function, and the expression of the Chebyshev mapping function is shown in the following formula (2):
[0041] x n+1 = cos(k cos -1 x n) (2)
[0042] In the above formula (2), x n ∈[-1, 1] When k≥2 (k is the order, k=4 here), no matter how close the initial values are, the iterated sequences are unrelated to each other, that is, the numerical sequences generated within this range are all chaotic.
[0043] Step S102, generating a quantum key according to the target sequence.
[0044] In step S102, the quantum key is represented by a matrix.
[0045] Alternatively, in the classical key distribution method, the key is usually transmitted through a classical communication channel, during which the key may face the threat of eavesdropping. However, quantum keys can utilize the superposition principle and non-cloning property of quantum states so that eavesdropping during the transmission process can be detected, thereby improving the security of the key during transmission.
[0046] Step S103, encrypting the first image by using a quantum key to obtain a target encrypted image.
[0047] In step S103, the first image is used to represent the transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0048] Alternatively, traditional digital image encryption schemes are mainly implemented by computers and electronic devices for digital signal processing, and the encryption performance of such encryption schemes is difficult to further improve. The development of quantum technology has provided a new direction for image encryption. Due to the characteristics of quantum computing, the technical solution for image encryption based on quantum keys has greatly improved the performance of image encryption. In addition, since the pseudo-random sequences generated by chaotic systems have the characteristics of large key space and initial value sensitivity, the image encryption scheme based on quantum keys implemented in combination with chaos theory has stronger security.
[0049] From the above content, it can be seen that the present application provides a method for generating quantum keys based on chaotic sequences and encrypting digital images through quantum keys. Since the pseudo-random sequence (i.e., chaotic sequence) generated by the nonlinear mapping function in the chaotic system has the characteristics of large key space and initial value sensitivity, in the present application, two different chaotic sequences generated by two different nonlinear mapping functions are encrypted, and the randomness of the numerical values in the obtained target sequence is stronger. Therefore, the randomness and security of the quantum key generated based on the target sequence in the present application are higher.
[0050] It can be seen that the present application encrypts the original digital image (i.e., the first image) to be stored and transmitted through a quantum key with higher randomness and security to obtain a target encrypted image, thereby achieving the purpose of using the target encrypted image as a medium for storing and transmitting transaction information in financial institutions, and achieving the technical effect of improving the security of storage objects and transmission objects, thereby solving the technical problem of low information security in the process of transmitting and storing images including transaction information in the prior art.
[0051] In an optional embodiment, the image encryption system first intercepts L values in the first sequence as the third sequence, and intercepts L values in the second sequence as the fourth sequence, where L is a positive integer. Then, the image encryption system performs rounding and normalization operations on the third sequence to obtain a fifth sequence, wherein the rounding operation is used to convert the values in the third and fourth sequences into integers, and the normalization operation is used to update the values obtained by the rounding operation to a preset range. Thereafter, the image encryption system performs rounding and normalization operations on the fourth sequence to obtain a sixth sequence. Finally, the image encryption system obtains a target sequence by performing DNA encryption on the fifth and sixth sequences, wherein DNA encryption is used to perform DNA mixed addition and subtraction operations on the values in the fifth and sixth sequences.
[0052] Optionally, in order to ensure the randomness of the numerical sequences intercepted from the first sequence and the second sequence, the image encryption system first removes the first 2000 digits of the numerical values in the first sequence and the first 2000 digits of the numerical values in the second sequence, and then intercepts L numerical values from the first sequence as the third sequence and intercepts L numerical values from the second sequence as the fourth sequence.
[0053] Optionally, since the values in the chaotic sequence are usually real numbers of infinite precision and have a certain complexity, the image encryption system can convert the values in the third sequence and the fourth sequence into integers by rounding the values in the third sequence and the fourth sequence, thereby reducing the calculation complexity of the subsequent image encryption system for the values in the sequence. In addition, since the accuracy of the image encryption system for calculating the values is limited, converting the values in the third sequence and the fourth sequence into integers can avoid calculation errors caused by the numerical accuracy in the chaotic sequence exceeding the preset calculation accuracy of the image encryption system, thereby improving the accuracy of the subsequent image encryption system for calculating the values in the sequence.
[0054] In an optional embodiment, the image encryption system first converts each numerical value in the fifth sequence into a binary code to obtain a first code corresponding to the fifth sequence. Thereafter, the image encryption system converts each numerical value in the sixth sequence into a binary code to obtain a second code corresponding to the sixth sequence. Then, the image encryption system performs a DNA encryption operation on the first code and the second code to obtain a DNA sequence, wherein the elements in the DNA sequence are in the form of letters. Finally, the image encryption system obtains a target sequence by performing DNA decoding on each element in the DNA sequence, wherein DNA decoding is used to convert the elements in the DNA sequence from letter form to numerical form.
[0055] Optionally, the DNA encryption algorithm has the capability of high-density storage and parallel processing of numerical values.
[0056] Optionally, the image encryption system first converts the first code into a first DNA sequence and the second code into a second DNA sequence based on DNA operation rules. Thereafter, the image encryption system obtains a target DNA sequence by performing DNA addition and subtraction mixed operations on the first DNA sequence and the second DNA sequence.
[0057] Optionally, the DNA base pairing rule is that A and T are complementary, and G and C are paired. Therefore, according to the complementary pairing principle of DNA base pairs, a DNA coding theory is proposed, that is, a numerical value is encoded into a DNA sequence according to a certain coding rule. First, the numerical value is decomposed into a binary code, and then each two adjacent binary codes are represented by a DNA coding value (A, T, G, C). Considering that 0 and 1 complement each other in binary, this application stipulates that 00 represents A, 11 represents T, 01 represents C, and 10 represents G. For example, if the size of a numerical value in the sequence is 183, it is converted into a binary code of 10110111, and 10110111 is DNA-encoded according to the DNA coding rule, and the result obtained is GTCT.
[0058] Optionally, Figure 2 is a schematic diagram of an optional DNA addition operation rule according to an embodiment of the present application, Figure 3 is a schematic diagram of an optional DNA subtraction operation rule according to an embodiment of the present application. The DNA addition and subtraction mixed operation rule used in the present application is shown in the following formula (3):
[0059]
[0060] Optionally, in the above formula (3), i represents the sequence number of the DNA values in the first DNA sequence and the second DNA sequence in the sequence, 2 2n Is a positive integer.
[0061] In an optional embodiment, the image encryption system first obtains a first matrix by converting the target sequence into a column-sorted form, wherein the element values in the first matrix are the numerical values in the target sequence, and then the image encryption system generates a quantum key based on the first matrix.
[0062] Optionally, the target sequence includes 2 2n values, the target sequence of the image encryption system is converted into a column-sorted form, and the size of the first matrix is 2 n ×2 n , assuming that the quantum key in the image encryption system is represented by |A>, the method for generating the quantum key is shown in the following formula (4):
[0063]
[0064] In the above formula (4), A XY =N ij (i,j∈[0,2 n -1]), N ij is the element value in the first matrix.
[0065] Optionally, the target sequence in the present application is also a chaotic sequence. The quantum key generated by the image encryption system using the chaotic sequence is highly random and unpredictable, thereby ensuring the security of the quantum key. The generation process of the chaotic sequence is usually affected by tiny disturbances within the system, which makes the generated quantum key highly resistant to external interference. This anti-interference ability can enhance the stability and reliability of quantum key transmission.
[0066] Optionally, since the preset parameters of the chaotic sequence generation algorithm can be flexibly adjusted to meet different security requirements and different application scenarios, the flexibility of the chaotic sequence enables the image encryption system to adjust the length of the generated quantum key according to specific security requirements and application scenarios. In addition, the chaotic system can usually be implemented through a simple nonlinear dynamic model. Compared with other random number generation methods, the use of chaotic sequences to generate quantum keys requires fewer resources.
[0067] In an optional embodiment, the image encryption system first generates a second matrix based on the first image, wherein the second matrix is used to represent the grayscale information in the first image, and the second matrix has the same size as the matrix corresponding to the quantum key. Then, the image encryption system obtains the correspondence between the element values in the second matrix and the numerical values included in the quantum key, wherein the arrangement position of the element values in the second matrix and the arrangement position of the numerical values corresponding to the element values in the quantum key are the same. Then, the image encryption system encrypts the element value corresponding to each numerical value in the quantum key, and determines the target encrypted image based on the encryption result.
[0068] Optionally, the image encryption system can extract grayscale information from the first image by the following method, including:
[0069] (1) Average value method: By calculating the average value of the red channel value, green channel value, and blue channel value of each pixel in the first color image, and then using this average value to replace each pixel value in the original image, a grayscale image is obtained.
[0070] (2) Weighted average method: The red channel value, green channel value and blue channel value of each pixel in the first color image are weighted averaged according to the preset weight of each channel, and then the weighted average value is used to replace each pixel value in the original image.
[0071] (3) Optical method: Use an appropriate optical filter (such as a grayscale filter) to capture a grayscale image directly on the imaging device of the first image.
[0072] (4) Deep learning method: Using deep learning technology, grayscale information is directly extracted from the color first image through a pre-trained neural network model.
[0073] Optionally, the image encryption system can also represent the position information and grayscale information in the first image based on the quantum bit sequence through the NEQR (Non-Equilibrium Quantum Relations) model. Assuming that the size of the first image is 2 n ×2 n , the grayscale value range is [0, 2 q -1], in the NEQR model, two qubit sequences of length n are required to represent the position information, while one qubit sequence of length q is required to represent the grayscale information.
[0074] Optionally, the NEQR expression is as shown in the following formula (5):
[0075]
[0076] In the above formula (5), Represents the grayscale information of the image, And K = q-1, q-2, ..., 0, and |XY> = |X> |Y> = |X n-1 , X n-2 , ..., X0>|Y n-1 , Y n-2 , ..., Y0> represents the position information of the image, Y t , X t ∈{0, 1}.
[0077] For example, taking the first image of size 2x2 as an example, the NEQR expression corresponding to the first image with the grayscale information and position information of each pixel marked is shown in the following formula (6):
[0078]
[0079] In an optional embodiment, the image encryption system first performs a degradation operation on the first image to obtain a second image, wherein the resolution of the second image is lower than that of the first image. Thereafter, the image encryption system obtains a first mapping matrix between the second image and the first image, wherein the first mapping matrix is used to convert the low-resolution image into a high-resolution image. Then, the image encryption system performs a dimensionality reduction operation on the first mapping matrix to obtain a second mapping matrix, wherein the second mapping matrix is a one-dimensional matrix. Finally, the image encryption system encrypts the second mapping matrix according to a target sequence to obtain a target encryption matrix.
[0080] Optionally, the image degradation operation refers to performing a blur operation on a real high-resolution image to obtain a low-resolution image corresponding to the high-resolution image. Figure 4 is a flow chart of an optional image degradation method according to an embodiment of the present application, such as Figure 4 As shown, the degradation operation of the image encryption system includes three operation steps: image blurring, image downsampling and noise degradation. Among them, the image blurring process is used to simulate through two convolutions (isotropic and anisotropic Gaussian blurs), the image downsampling is used to reduce the number of pixels included in the image by randomly selecting pixels from the nearest neighbor, bilinear and bicubic interpolation, and the noise degradation is used to add random noise that obeys the Gaussian distribution to each pixel of the image.
[0081] Optionally, the expression of the degenerate operation is shown in the following formula (7):
[0082]
[0083] In the above formula (7), represents a low-resolution image, I represents a high-resolution image, k represents a blur kernel, and n represents Gaussian noise. s represents downsampling by s times, Represents a convolution operation.
[0084] Optionally, the inverse process of the degradation operation is expressed as shown in the following formula (8):
[0085]
[0086] In the above formula (8), represents the high-resolution estimation map, represents a low-resolution image, φ -1represents the inverse transformation, θ β Represents various noise factors that cause image blur.
[0087] Optionally, in the process of encrypting the second mapping matrix according to the target sequence, the image encryption system performs a bitwise XOR operation on the second mapping matrix and the target sequence, and uses the obtained one-dimensional mapping relationship matrix after the chaotic mapping is scrambled as the target encryption matrix, wherein the expression of the bitwise XOR operation is shown in the following formula (9):
[0088] D(i)=bitxor(c(i),F'(i)),(i=1,2,...,2 2n ) (9)
[0089] In the above formula (9), the function bitxor performs a "bitwise XOR" operation on K′(i) and F′(i), and the return value is D(i). From the operational characteristics of the XOR operation, it can be seen that using the XOR operation on a certain value twice in a row can achieve the effect of restoring the original value.
[0090] In an optional embodiment, the image encryption system first decrypts the target encrypted image based on the quantum key to obtain a first decrypted image. Then, the image encryption system decrypts the target encryption matrix based on the target sequence to obtain a first mapping matrix. Then, the image encryption system enhances the resolution of the first decrypted image according to the first mapping matrix to obtain a first image.
[0091] Optionally, the first decrypted image obtained through the encryption and decryption process in the image encryption system may have an image distortion problem, and the image encryption system can improve the image resolution of the first decrypted image through the first mapping matrix, thereby solving the technical problem of the distortion of the first decrypted image.
[0092] Optionally, the image encryption system can obtain a first mapping matrix between the second image and the first image by a deep learning method. Figure 5 is a flowchart of an optional method for generating a first mapping matrix according to an embodiment of the present application, such as Figure 5As shown in the figure: first, obtain the image to be encrypted (i.e., the first image), perform a degradation operation on the image to be encrypted to obtain a low-resolution image (i.e., the second image), treat the non-degraded image to be encrypted as a high-resolution image, then input the low-resolution image and the high-resolution image into the convolutional neural network for learning, and before sending the image into the convolutional neural network, the image encryption system pre-establishes the correspondence between the image blocks in the high-resolution image and the image blocks in the low-resolution image, and the image encryption system then sends the one-to-one corresponding high-resolution image blocks and low-resolution image blocks into the convolutional neural network for learning, thereby obtaining a transformation matrix from the low-resolution image to the high-resolution image, and iteratively optimizes the transformation matrix under the constraint of the mean square error loss function, and finally, uses the transformation matrix obtained by the last optimization as the first mapping matrix.
[0093] Optionally, Figure 6 is a flowchart of an optional convolutional neural network learning process according to an embodiment of the present application, such as Figure 6 As shown in the figure: The convolutional neural network consists of 8 convolutional layers. First, the convolutional neural network extracts one-to-one corresponding image blocks from the input low-resolution and high-resolution images. Then, the extracted image blocks are sent to 8 convolutional layers to learn the features between the low-resolution image blocks and the high-resolution image blocks. Finally, the features between the low-resolution image blocks and the high-resolution image blocks are spliced to obtain the features of the low-resolution image and the high-resolution image.
[0094] In an optional embodiment, the present application provides a quantum image encryption and decryption algorithm based on deep learning and hybrid chaos, that is, the present application first generates a chaotic sequence based on quantum Logistic mapping and Chebyshev mapping, and obtains two different chaotic sequences. Then, the DNA encryption algorithm is used to perform DNA encoding and operation on the two chaotic maps to obtain a DNA-encrypted hybrid chaotic sequence. Then, a quantum key image |A> is generated based on the hybrid chaotic sequence, wherein |A> is used to encrypt the grayscale information of the pixels in the quantum image |I>, thereby achieving the purpose of encrypting the image |I> based on the quantum image encryption technology.
[0095] In addition, the present application also obtains the mapping relationship matrix between the low-resolution image and the high-resolution image (i.e., the quantum image to be encrypted |I>) through deep learning technology, and then performs a bitwise XOR operation on the one-dimensional mapping relationship matrix obtained by reducing the dimension of the mapping relationship matrix and the mixed chaotic sequence after the DNA encryption to obtain the scrambled encrypted mapping relationship matrix. When the image needs to be decrypted, the present application restores the pixels of the decrypted image through the decrypted mapping relationship matrix, thereby achieving the purpose of improving the resolution of the decrypted image. The specific scheme is as follows:
[0096] Step 1: Two different chaotic sequences (i.e., the first sequence and the second sequence) are obtained through quantum chaotic Logistic mapping and Chebyshev mapping;
[0097] Step 2: After removing the first 2000 bits of each chaotic sequence, take 2 bits from each of the remaining chaotic sequences. 2n Values, and perform rounding and normalization operations on each value to obtain the normalized Logistic mapping chaotic sequence a i (i∈[0,2 2n ]) and Chebyshev map chaotic sequence and b i (i∈[0,2 2n ]);
[0098] Step 3: The chaotic sequence a i (i∈[0,2 2n ]) and a i (i∈[0,2 2n Each value in ]) is converted into binary, and then DNA encoding is performed according to the DNA encoding rules to obtain two DNA sequences A i and B i ;
[0099] Step 4: Use DNA addition and subtraction mixed operation rules to perform DNA sequence A i and B i Perform DNA encryption to obtain the encrypted chaotic sequence C i (i∈[0,2 2n ]);
[0100] Step 5: According to the corresponding rules, the chaotic sequence C i (i∈[0,2 2n ]) is decoded by DNA to obtain the chaotic sequence c i (i∈[0,2 2n ]) (i.e., the target sequence), and c i ∈[0, 255];
[0101] Step 6: The chaotic sequence c i (i∈[0,2 2n ]) are arranged in columns to obtain a 2 n ×2 n The size of the matrix N (i.e. the first matrix), the chaotic sequence c i (i∈[0,2 2n ]) is an element value in the matrix N;
[0102] Step 7: Generate a quantum key image |A> (i.e., quantum key) based on the matrix N;
[0103] Step 8: Perform quantum image representation on the image M to be encrypted to obtain the quantum image |I> (i.e., the second matrix) to be encrypted, whose size is 2 n ×2 n ;
[0104] Step 9: Encrypt the grayscale information of the pixels in the quantum image |I> through the quantum key image |A> to obtain the encrypted image O (i.e., the target encrypted image).
[0105] Step 10: Perform a degradation operation on the encrypted image M to obtain a low-resolution image M′ (i.e., the second image) with a size of 2 n ×2 n ;
[0106] Step 11: Use deep learning technology to learn the mapping relationship matrix F (i.e., the first mapping matrix) between the low-resolution image M′ and the high-resolution image M (i.e., the image to be encrypted before degradation), whose size is 2 n ×2 n ;
[0107] Step 12: Reduce the dimension of the mapping relationship matrix F and expand it by columns to obtain a one-dimensional matrix F′ (i.e., the second mapping matrix) with a size of 1×2 2n ;
[0108] Step 13: Combine the one-dimensional matrix F′ with the chaotic sequence c i (i∈[0,2 2n ]) performs bitwise XOR operation to obtain the scrambled one-dimensional relationship matrix D (i.e., the target encryption matrix), whose size is 1×2 2n ;
[0109] Step 14: perform an inverse operation on the encrypted image O in step 9 and the one-dimensional mapping relationship matrix D after scrambling in step 13 to obtain a decrypted image (i.e., a first decrypted image) and a decrypted original mapping relationship F;
[0110] Step 15: Use the original mapping relationship F obtained by decryption to restore the resolution of the pixels in the decrypted image to obtain the original high-resolution image M.
[0111] In the present application, firstly, an encryption operation is performed on a first sequence and a second sequence to obtain a target sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, and the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions. Then, a quantum key is generated according to the target sequence, wherein the quantum key is represented in a matrix manner. After that, a first image is encrypted by the quantum key to obtain a target encrypted image, wherein the first image is used to represent transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0112] From the above content, it can be seen that the present application provides a method for generating quantum keys based on chaotic sequences and encrypting digital images through quantum keys. Since the pseudo-random sequence (i.e., chaotic sequence) generated by the nonlinear mapping function in the chaotic system has the characteristics of large key space and initial value sensitivity, in the present application, two different chaotic sequences generated by two different nonlinear mapping functions are encrypted, and the randomness of the numerical values in the obtained target sequence is stronger. Therefore, the randomness and security of the quantum key generated based on the target sequence in the present application are higher.
[0113] It can be seen that the present application encrypts the original digital image (i.e., the first image) to be stored and transmitted through a quantum key with higher randomness and security to obtain a target encrypted image, thereby achieving the purpose of using the target encrypted image as a medium for storing and transmitting transaction information in financial institutions, and achieving the technical effect of improving the security of storage objects and transmission objects, thereby solving the technical problem of low information security in the process of transmitting and storing images including transaction information in the prior art.
[0114] According to another aspect of the embodiment of the present application, there is also provided an image encryption device, Figure 7 is a schematic diagram of an optional image encryption device according to an embodiment of the present application, such as Figure 7 As shown, the image encryption device includes: a first encryption unit 701, a first generation unit 702 and a second encryption unit 703.
[0115] Optionally, the first encryption unit is used to obtain a target sequence by performing encryption operations on the first sequence and the second sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions; the first generation unit is used to generate a quantum key based on the target sequence, wherein the quantum key is represented by a matrix; the second encryption unit is used to encrypt the first image by using the quantum key to obtain a target encrypted image, wherein the first image is used to represent the transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0116] In an optional embodiment, the first encryption unit includes: an interception subunit, a first operation subunit, a second operation subunit and a first encryption subunit.
[0117] Optionally, a truncation subunit is used to truncate L values in the first sequence as a third sequence, and to truncate L values in the second sequence as a fourth sequence, wherein L is a positive integer; a first operation subunit is used to perform rounding and normalization operations on the third sequence to obtain a fifth sequence, wherein the rounding operation is used to convert the values in the third sequence and the fourth sequence into integers, and the normalization operation is used to update the values obtained by the rounding operation to within a preset range; a second operation subunit is used to perform rounding and normalization operations on the fourth sequence to obtain a sixth sequence; a first encryption subunit is used to obtain a target sequence by performing DNA encryption on the fifth sequence and the sixth sequence, wherein the DNA encryption is used to perform DNA addition and subtraction mixed operations on the values in the fifth sequence and the sixth sequence.
[0118] In an optional embodiment, the first encryption subunit includes: a first conversion module, a second conversion module, an encryption operation module and a decoding module.
[0119] Optionally, a first conversion module is used to convert each numerical value in the fifth sequence into a binary code to obtain a first code corresponding to the fifth sequence; a second conversion module is used to convert each numerical value in the sixth sequence into a binary code to obtain a second code corresponding to the sixth sequence; an encryption operation module is used to perform a DNA encryption operation on the first code and the second code to obtain a DNA sequence, wherein the elements in the DNA sequence are in the form of letters; a decoding module is used to obtain a target sequence by performing DNA decoding on each element in the DNA sequence, wherein DNA decoding is used to convert the elements in the DNA sequence from letter form to numerical form.
[0120] In an optional embodiment, the first generating unit includes: a conversion subunit and a first generating subunit.
[0121] Optionally, the conversion subunit is used to obtain a first matrix by converting the target sequence into a column-sorted form, wherein the element values in the first matrix are the numerical values in the target sequence; and the first generation subunit is used to generate a quantum key based on the first matrix.
[0122] In an optional embodiment, the first encryption unit includes: a second generation subunit, an acquisition subunit and a second encryption subunit.
[0123] Optionally, a second generating subunit is used to generate a second matrix based on the first image, wherein the second matrix is used to represent the grayscale information in the first image, and the second matrix has the same size as the matrix corresponding to the quantum key; an acquiring subunit is used to acquire the correspondence between element values in the second matrix and numerical values included in the quantum key, wherein the arrangement position of the element values in the second matrix and the arrangement position of the numerical values corresponding to the element values in the quantum key are the same; a second encryption subunit is used to encrypt the element value corresponding to each numerical value in the quantum key, and determine the target encrypted image based on the encryption result.
[0124] In an optional embodiment, the image encryption device further includes: a degradation unit, an acquisition unit, a dimensionality reduction unit and a third encryption unit.
[0125] Optionally, a degradation unit is used to perform a degradation operation on the first image to obtain a second image, wherein the resolution of the second image is lower than that of the first image; an acquisition unit is used to acquire a first mapping matrix between the second image and the first image, wherein the first mapping matrix is used to convert a low-resolution image into a high-resolution image; a dimensionality reduction unit is used to perform a dimensionality reduction operation on the first mapping matrix to obtain a second mapping matrix, wherein the second mapping matrix is a one-dimensional matrix; and a third encryption unit is used to encrypt the second mapping matrix according to a target sequence to obtain a target encrypted matrix.
[0126] In an optional embodiment, the image encryption device further includes: a first decryption unit, a second decryption unit and an enhancement unit.
[0127] Optionally, the first decryption unit is used to decrypt the target encrypted image based on the quantum key to obtain a first decrypted image; the second decryption unit is used to decrypt the target encryption matrix based on the target sequence to obtain a first mapping matrix; and the enhancement unit is used to enhance the resolution of the first decrypted image according to the first mapping matrix to obtain a first image.
[0128] From the above content, it can be seen that the image encryption device provides a method for generating quantum keys based on chaotic sequences and encrypting digital images through quantum keys. Since the pseudo-random sequence (i.e., chaotic sequence) generated by the nonlinear mapping function in the chaotic system has the characteristics of large key space and initial value sensitivity, the image encryption device encrypts two different chaotic sequences generated by two different nonlinear mapping functions, and the randomness of the values in the obtained target sequence is stronger. Therefore, the quantum key generated by the image encryption device based on the target sequence has higher randomness and security.
[0129] It can be seen that the image encryption device encrypts the original digital image to be stored and transmitted (i.e., the first image) through a quantum key with higher randomness and security to obtain a target encrypted image, thereby achieving the purpose of using the target encrypted image as a medium for storing and transmitting transaction information in financial institutions, and achieving the technical effect of improving the security of storage objects and transmission objects, thereby solving the technical problem of low information security in the process of transmitting and storing images including transaction information in the prior art.
[0130] According to another aspect of an embodiment of the present application, a computer program product is further provided. The computer program product includes a stored computer program, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned image encryption methods.
[0131] According to another aspect of an embodiment of the present application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned image encryption methods by executing the executable instructions.
[0132] Optionally, Figure 8 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 8 As shown, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, any one of the above-mentioned image encryption methods is implemented.
[0133] Optionally, when executing the program, the processor can implement the following steps: obtain a target sequence by performing encryption operations on the first sequence and the second sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, and the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions; generate a quantum key according to the target sequence, wherein the quantum key is represented by a matrix; encrypt the first image by the quantum key to obtain a target encrypted image, wherein the first image is used to represent transaction information, and the target encrypted image is used to represent the encrypted transaction information.
[0134] Optionally, when the processor executes the program, it can implement the following steps: intercept L values in the first sequence as the third sequence, intercept L values in the second sequence as the fourth sequence, where L is a positive integer; perform rounding and normalization operations on the third sequence to obtain a fifth sequence, wherein the rounding operation is used to convert the values in the third sequence and the fourth sequence into integers, and the normalization operation is used to update the values obtained by the rounding operation to within a preset range; perform rounding and normalization operations on the fourth sequence to obtain a sixth sequence; obtain a target sequence by performing DNA encryption on the fifth sequence and the sixth sequence, wherein the DNA encryption is used to perform DNA mixed addition and subtraction operations on the values in the fifth sequence and the sixth sequence.
[0135] Optionally, when executing the program, the processor can implement the following steps: convert each numerical value in the fifth sequence into a binary code to obtain a first code corresponding to the fifth sequence; convert each numerical value in the sixth sequence into a binary code to obtain a second code corresponding to the sixth sequence; perform DNA encryption operation on the first code and the second code to obtain a DNA sequence, wherein the elements in the DNA sequence are in the form of letters; obtain a target sequence by performing DNA decoding on each element in the DNA sequence, wherein DNA decoding is used to convert the elements in the DNA sequence from letter form to numerical form.
[0136] Optionally, when the processor executes the program, the following steps can be implemented: a first matrix is obtained by converting the target sequence into a column-sorted form, wherein the element values in the first matrix are the numerical values in the target sequence; and a quantum key is generated based on the first matrix.
[0137] Optionally, when the processor executes the program, the following steps can be implemented: generating a second matrix based on the first image, wherein the second matrix is used to represent the grayscale information in the first image, and the second matrix has the same size as the matrix corresponding to the quantum key; obtaining the correspondence between the element values in the second matrix and the numerical values included in the quantum key, wherein the arrangement position of the element values in the second matrix and the arrangement position of the numerical values corresponding to the element values in the quantum key are the same; encrypting the element value corresponding to each numerical value in the quantum key, and determining the target encrypted image based on the encryption result.
[0138] Optionally, when the processor executes the program, it can implement the following steps: perform a degradation operation on the first image to obtain a second image, wherein the resolution of the second image is lower than the resolution of the first image; obtain a first mapping matrix between the second image and the first image, wherein the first mapping matrix is used to convert a low-resolution image into a high-resolution image; perform a dimensionality reduction operation on the first mapping matrix to obtain a second mapping matrix, wherein the second mapping matrix is a one-dimensional matrix; and encrypt the second mapping matrix according to a target sequence to obtain a target encrypted matrix.
[0139] Optionally, when the processor executes the program, it can implement the following steps: decrypting the target encrypted image based on the quantum key to obtain a first decrypted image; decrypting the target encryption matrix based on the target sequence to obtain a first mapping matrix; and enhancing the resolution of the first decrypted image according to the first mapping matrix to obtain a first image.
[0140] From the above content, it can be seen that the present application provides a method for generating quantum keys based on chaotic sequences and encrypting digital images through quantum keys. Since the pseudo-random sequence (i.e., chaotic sequence) generated by the nonlinear mapping function in the chaotic system has the characteristics of large key space and initial value sensitivity, in the present application, two different chaotic sequences generated by two different nonlinear mapping functions are encrypted, and the randomness of the numerical values in the obtained target sequence is stronger. Therefore, the randomness and security of the quantum key generated based on the target sequence in the present application are higher.
[0141] It can be seen that the present application encrypts the original digital image (i.e., the first image) to be stored and transmitted through a quantum key with higher randomness and security to obtain a target encrypted image, thereby achieving the purpose of using the target encrypted image as a medium for storing and transmitting transaction information in financial institutions, and achieving the technical effect of improving the security of storage objects and transmission objects, thereby solving the technical problem of low information security in the process of transmitting and storing images including transaction information in the prior art.
[0142] The above-mentioned embodiments or examples disclosed in the present application are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection disclosed in the present application. In the absence of contradiction, each step in a certain embodiment or example in the present application can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.
[0143] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0144] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0147] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0148] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0149] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0150] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0151] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. An image encryption method, characterized in that: include: A target sequence is obtained by performing encryption operation on a first sequence and a second sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions; Generating a quantum key according to the target sequence, wherein the quantum key is represented by a matrix; The first image is encrypted by the quantum key to obtain a target encrypted image, wherein the first image is used to represent the transaction information, and the target encrypted image is used to represent the encrypted transaction information.
2. The image encryption method according to claim 1, characterized in that: By performing encryption operation on the first sequence and the second sequence, a target sequence is obtained, including: L values in the first sequence are intercepted as a third sequence, and L values in the second sequence are intercepted as a fourth sequence, where L is a positive integer; performing a rounding operation and a normalization operation on the third sequence to obtain a fifth sequence, wherein the rounding operation is used to convert values in the third sequence and the fourth sequence into integers, and the normalization operation is used to update the values obtained by the rounding operation to within a preset range; Performing the rounding operation and the normalization operation on the fourth sequence to obtain a sixth sequence; The target sequence is obtained by performing DNA encryption on the fifth sequence and the sixth sequence, wherein the DNA encryption is used to perform DNA addition and subtraction mixed operations on the numerical values in the fifth sequence and the sixth sequence.
3. The image encryption method according to claim 2, characterized in that: The target sequence is obtained by performing DNA encryption on the fifth sequence and the sixth sequence, comprising: Convert each value in the fifth sequence into a binary code to obtain a first code corresponding to the fifth sequence; Convert each value in the sixth sequence into a binary code to obtain a second code corresponding to the sixth sequence; Performing DNA encryption operation on the first code and the second code to obtain a DNA sequence, wherein the elements in the DNA sequence are in the form of letters; The target sequence is obtained by performing DNA decoding on each element in the DNA sequence, wherein the DNA decoding is used to convert the elements in the DNA sequence from letter form to numerical form.
4. The image encryption method according to claim 1, characterized in that: Generating a quantum key according to the target sequence includes: A first matrix is obtained by converting the target sequence into a column-sorted form, wherein element values in the first matrix are numerical values in the target sequence; The quantum key is generated according to the first matrix.
5. The image encryption method according to claim 1, characterized in that: Encrypting the first image by using the quantum key to obtain a target encrypted image includes: generating a second matrix according to the first image, wherein the second matrix is used to represent grayscale information in the first image, and the second matrix has the same size as the matrix corresponding to the quantum key; Obtaining a correspondence between element values in the second matrix and numerical values included in the quantum key, wherein an arrangement position of the element value in the second matrix and an arrangement position of the numerical value corresponding to the element value in the quantum key are the same; According to each numerical value in the quantum key, the element value corresponding to the numerical value is encrypted, and the target encrypted image is determined according to the encryption result.
6. The image encryption method according to claim 1, characterized in that: After obtaining the target sequence by performing encryption operation on the first sequence and the second sequence, the image encryption method further includes: Performing a degradation operation on the first image to obtain a second image, wherein a resolution of the second image is lower than a resolution of the first image; Acquire a first mapping matrix between the second image and the first image, wherein the first mapping matrix is used to convert a low-resolution image into a high-resolution image; Performing a dimensionality reduction operation on the first mapping matrix to obtain a second mapping matrix, wherein the second mapping matrix is a one-dimensional matrix; The second mapping matrix is encrypted according to the target sequence to obtain a target encrypted matrix.
7. The image encryption method according to claim 6, characterized in that: After encrypting the second mapping matrix according to the target sequence to obtain a target encrypted matrix, the image encryption method further includes: Decrypting the target encrypted image based on the quantum key to obtain a first decrypted image; Decrypting the target encrypted matrix based on the target sequence to obtain a first mapping matrix; The resolution of the first decrypted image is enhanced according to the first mapping matrix to obtain the first image.
8. An image encryption device, characterized in that: include: A first encryption unit is used to obtain a target sequence by performing encryption operation on a first sequence and a second sequence, wherein the first sequence is a chaotic sequence generated by a first preset function, the second sequence is a chaotic sequence generated by a second preset function, and the first preset function and the second preset function are two different nonlinear mapping functions; A first generating unit, configured to generate a quantum key according to the target sequence, wherein the quantum key is represented by a matrix; The second encryption unit is used to encrypt the first image by using the quantum key to obtain a target encrypted image, wherein the first image is used to represent the transaction information, and the target encrypted image is used to represent the encrypted transaction information.
9. A computer program product, characterized in that The computer program product comprises a computer program, wherein when the computer program is executed, the computer program product is controlled to execute the image encryption method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the image encryption method described in any one of claims 1 to 7.
