CN115134471A - Image encryption and decryption method and related equipment - Google Patents

Image encryption and decryption method and related equipment Download PDF

Info

Publication number
CN115134471A
CN115134471A CN202210557186.5A CN202210557186A CN115134471A CN 115134471 A CN115134471 A CN 115134471A CN 202210557186 A CN202210557186 A CN 202210557186A CN 115134471 A CN115134471 A CN 115134471A
Authority
CN
China
Prior art keywords
image
sequence
chaotic
scrambling
ciphertext
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210557186.5A
Other languages
Chinese (zh)
Inventor
李超
张军昌
魏东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202210557186.5A priority Critical patent/CN115134471A/en
Publication of CN115134471A publication Critical patent/CN115134471A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32101Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title
    • H04N1/32144Display, printing, storage or transmission of additional information, e.g. ID code, date and time or title embedded in the image data, i.e. enclosed or integrated in the image, e.g. watermark, super-imposed logo or stamp
    • H04N1/32149Methods relating to embedding, encoding, decoding, detection or retrieval operations
    • H04N1/32267Methods relating to embedding, encoding, decoding, detection or retrieval operations combined with processing of the image
    • H04N1/32272Encryption or ciphering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/001Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using chaotic signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0852Quantum cryptography

Abstract

The invention discloses an image encryption and decryption method and related equipment. The method comprises the following steps: extracting an image feature code of an original image, and performing quantum processing on the original image to obtain a quantum image; taking the image feature code as an initial value of a chaotic mapping system to carry out iteration to obtain a chaotic sequence; and encrypting the quantum image by using the chaotic sequence to obtain a first ciphertext image. By the method, the complexity of image encryption can be increased, the decoding difficulty of an attacker is improved, and the security of the encrypted image is guaranteed.

Description

Image encryption and decryption method and related equipment
Technical Field
The present invention relates to the field of image encryption technologies, and in particular, to an image encryption method, a ciphertext image decryption method, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of internet and multimedia technology, multimedia information is more and more widely applied, and for this reason, security of multimedia information is receiving wide attention, and especially, information security of images is particularly concerned. Compared with other multimedia information (such as text information), the image has the characteristics of large data volume, strong correlation between adjacent pixels, high redundancy and the like, and the traditional encryption method has a non-ideal encryption effect when encrypting the image, so that the encrypted image is easy to have poor security.
In the current cryptanalysis research of the image encryption algorithm, the main reason that the encryption method is unsafe is that the security of the encryption method is not high, for example, the complexity of the encrypted image is low, the risk of being identified exists, and the attack of the cryptanalysis algorithm is difficult to resist.
Disclosure of Invention
In view of the above, the technical problem mainly solved by the present invention is to provide an image encryption method, a ciphertext image decryption method, an electronic device, and a computer-readable storage medium, which can increase the complexity of image encryption and increase the difficulty of decryption, so as to be beneficial to ensuring the security of the encrypted image.
In order to solve the technical problems, the invention adopts a technical scheme that: there is provided an image encryption method including: extracting an image feature code of an original image, and performing quantum processing on the original image to obtain a quantum image; taking the image feature code as an initial value of a chaotic mapping system to carry out iteration to obtain a chaotic sequence; and encrypting the quantum image by using the chaotic sequence to obtain a first ciphertext image.
In an embodiment of the present invention, the encrypting the quantum image by using the chaotic sequence to obtain the first ciphertext image includes: and carrying out scrambling processing and/or diffusion processing on the quantum image by using the chaotic sequence to obtain a first ciphertext image.
In an embodiment of the invention, the chaotic mapping system comprises a first sub-chaotic system; iteration is carried out on the image feature code as an initial value of a chaotic mapping system to obtain a chaotic sequence, and the chaotic sequence is used for carrying out encryption processing on the quantum image to obtain a first ciphertext image, wherein the method comprises the following steps: performing first chaotic mapping processing on the image feature code by using a first sub-chaotic system to obtain a scrambling chaotic sequence, wherein the scrambling chaotic sequence has at least three-dimensional characteristics; decomposing pixels of the quantum image into three gray component sequences; and scrambling the gray component sequence by using the scrambling chaotic sequence to obtain a scrambled pixel image, and taking the scrambled pixel image as a first ciphertext image.
In an embodiment of the present invention, the grayscale component sequence includes a first grayscale component sequence, a second grayscale component sequence, and a third grayscale component sequence, and the scrambling chaotic sequence includes a first subsequence, a second subsequence, and a third subsequence; the method for scrambling the gray component sequence by using the scrambling chaotic sequence to obtain the scrambled pixel image comprises the following steps: respectively carrying out transformation processing on the first subsequence, the second subsequence and the third subsequence to obtain a first scrambling sequence, a second scrambling sequence and a third scrambling sequence; and performing exclusive-or operation on the first gray component sequence, the second gray component sequence and the third gray component sequence with the first scrambling sequence, the second scrambling sequence and the third scrambling sequence respectively.
In an embodiment of the present invention, the transforming the first subsequence, the second subsequence, and the third subsequence to obtain a first scrambling sequence, a second scrambling sequence, and a third scrambling sequence respectively includes: the first scrambling sequence is obtained by performing complementation operation on the first subsequence and the gray scale; and/or the second scrambling sequence is obtained by performing complementation operation on the second subsequence and the gray scale; and/or the third scrambling sequence is obtained by performing complementation operation on the third subsequence and the gray scale.
In an embodiment of the invention, the chaotic mapping system comprises a second sub-chaotic system, and the second sub-chaotic system is used for carrying out second chaotic mapping processing on the image feature code to obtain a diffusion chaotic sequence; and performing exclusive OR operation on the diffusion chaotic sequence and the scrambled pixel image to obtain a diffusion scrambled pixel image, and taking the diffusion scrambled pixel image as a first ciphertext image.
In an embodiment of the present invention, extracting the image feature code of the original image includes: acquiring a random number and a hash value of an original image; carrying out complexity processing on the hash value of the original image by using a random number to obtain an iteration initial value; carrying out iterative training on the iterative initial value; performing current iterative training together with the initial iterative value and the training result of the previous iterative training; fusing training results obtained by each iterative training to obtain image feature codes; the method for taking the image feature code as an initial value of the chaotic mapping system comprises the following steps: and performing calculation conversion on the image feature codes to obtain chaotic initial values adaptive to the initial values of the chaotic mapping system, and taking the chaotic initial values as the initial values of the chaotic mapping system.
In an embodiment of the present invention, an encryption key is obtained; decomposing and converting the encryption key to obtain a first sub-key and a second sub-key; performing quantum Fourier transform on the first sub-secret key and the first ciphertext image to obtain an encrypted image; and performing quantum Fourier inverse transformation on the second sub-secret key and the encrypted image to obtain a second ciphertext image.
In order to solve the technical problem, the invention adopts another technical scheme that: provided is a method for decrypting a ciphertext image, the method for decrypting the ciphertext image comprising: acquiring a ciphertext image; the ciphertext image is obtained by encrypting by using the image encryption method in any one embodiment; carrying out decryption processing on the ciphertext image to obtain an original image; wherein the decryption process matches the encryption process.
In an embodiment of the invention, the ciphertext image is a second ciphertext image, and quantum fourier transform is performed on the second ciphertext image and the second sub-key to obtain an encrypted image; performing quantum Fourier inverse transformation on the encrypted image and the first sub-secret key to obtain a first ciphertext image; performing logical operation on the first ciphertext image and the diffusion chaotic sequence to obtain a scrambled pixel image; and performing logical operation on the scrambled pixel image and the scrambling sequence to obtain an original image.
In order to solve the technical problem, the invention adopts another technical scheme that: there is provided an electronic device including: the image encryption device comprises a memory and a processor, wherein the memory stores a computer program, and the processor is used for operating the computer program to realize the image encryption method in any one of the above embodiments or realize the decryption method of the ciphertext image in any one of the above embodiments.
In order to solve the technical problem, the invention adopts another technical scheme that: there is provided a computer readable storage medium for storing instructions/program data executable to implement the image encryption method as in any one of the above embodiments, or the decryption method of a ciphertext image as in any one of the above embodiments.
The invention has the beneficial effects that: different from the prior art, the image feature code is used as the initial calculation value of the chaotic mapping system to iterate to obtain the chaotic sequence corresponding to the original image, so that the encryption processing of the original image is realized, the correlation and redundancy between adjacent pixels are reduced, and the security of the encrypted image is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. Moreover, the drawings and the description are not intended to limit the scope of the inventive concept in any way, but rather to illustrate it by those skilled in the art with reference to specific embodiments.
FIG. 1 is a flow chart illustrating an image encryption method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of extracting feature codes of an image according to the present invention;
FIG. 3 is a flowchart illustrating another embodiment of extracting feature codes of an image according to the present invention;
FIG. 4 is a schematic flow chart of an embodiment of obtaining a quantum image according to the present invention;
FIG. 5 is a flowchart illustrating an image encryption method according to another embodiment of the present invention;
FIG. 6 is a schematic flow chart of an embodiment of obtaining a scrambled pixel image according to the present invention;
FIG. 7 is a schematic flow chart of an embodiment of obtaining a diffusion scrambled pixel image according to the present invention;
FIG. 8 is a flow chart illustrating an embodiment of the present invention for encrypting using an encryption key;
FIG. 9 is a flowchart illustrating an embodiment of obtaining a first sub-key and a second sub-key according to the present invention;
FIG. 10 is a flowchart illustrating a method for decrypting a ciphertext image according to an embodiment of the present invention;
FIG. 11 is a schematic structural diagram of an embodiment of an electronic device of the present invention;
FIG. 12 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
In order to solve the technical problem of poor image security after encryption in the prior art, the invention provides an image encryption method, which comprises the following steps: extracting an image feature code of an original image, and performing quantum processing on the original image to obtain a quantum image; taking the image feature code as an initial value of a chaotic mapping system to carry out iteration to obtain a chaotic sequence; and encrypting the quantum image by using the chaotic sequence to obtain a first ciphertext image. The details will be described below.
Referring to fig. 1, fig. 1 is a flowchart illustrating an image encryption method according to an embodiment of the present invention. It should be noted that the image encryption method set forth in this embodiment is not limited to the following steps:
s101: and extracting the image feature code of the original image, and performing quantum processing on the original image to obtain a quantum image.
In this embodiment, the original image is an image that needs to be encrypted, and feature extraction is performed on the original image to obtain an image feature code of the original image. And carrying out quantum processing on the original image to obtain a quantum image corresponding to the original image.
S102: and (4) taking the image feature code as an initial value of the chaotic mapping system to carry out iteration to obtain a chaotic sequence.
In the embodiment, the image feature code can be used as a calculation initial value to be input into a chaotic mapping system and the like, and the chaotic mapping system can obtain a chaotic sequence corresponding to an original image by carrying out a plurality of iterations, so that pixels are changed, the encryption of the original image is realized, and the execution of further encryption operation is facilitated; the image feature code may be input into the chaotic mapping system as an initial calculation value after being subjected to calculation conversion, which is not limited herein.
S103: and encrypting the quantum image by using the chaotic sequence to obtain a first ciphertext image.
In this embodiment, after the chaotic sequence corresponding to the original image is obtained, the chaotic sequence can be used to further encrypt the quantum image to obtain a first ciphertext image, so that the complexity of the encrypted image is further increased, and the decryption difficulty of an attacker is increased, thereby being beneficial to ensuring the security of the encrypted image.
Therefore, the chaos mapping system is used for iterating the image feature codes to obtain the chaos sequence corresponding to the original image so as to realize encryption processing on the original image and reduce the correlation and redundancy between adjacent pixels, and the chaos sequence is also used for encrypting the quantum image so as to improve the complexity of the encrypted image, improve the decoding difficulty of an attacker and reduce the risk of identifying the encrypted image, thereby being beneficial to ensuring the safety of the encrypted image.
Referring to fig. 2 and fig. 3 in combination, fig. 2 is a schematic flowchart of an embodiment of extracting an image feature code according to the present invention, and fig. 3 is a schematic flowchart of another embodiment of extracting an image feature code according to the present invention. It should be noted that the method for extracting the image feature code set forth in this embodiment is not limited to the following steps:
in this embodiment, the original image may be input into the image feature extraction module 10 for feature extraction to obtain an image feature code corresponding to the original image, and the image feature code is converted into a calculation initial value adapted to the chaotic mapping system through conversion, so that the chaotic sequence is associated with the original image to establish a corresponding relationship between the original image and the chaotic sequence.
Specifically, the original image may be input into the hash value calculation module 11, the hash value calculation module 11 is used to calculate and obtain the hash value of the original image, the random number generation module 12 is used to obtain the random number, the hash value of the original image and the random number are input into the first calculation module 13, the hash value of the original image is subjected to complexity processing by using the random number to obtain an iteration initial value, so as to increase the complexity of the hash value of the original image, thereby increasing the decoding difficulty of an attacker.
The iteration initial value is input to the second calculation module 14 to perform iterative training on the iteration initial value. And in each iterative training, the initial iteration value and the training result of the previous iterative training are input into the second calculation module 14, and the current iterative training is performed together, so that the training result of the iterative training can contain sufficient information. Optionally, several second calculation modules 14 are shown in fig. 3, and in practical applications, one second calculation module 14 may be used for calculation, and for convenience of understanding, the illustrated embodiment performs iterative training on an iteration initial value and a previous training result at each iterative training.
Inputting training results (A (1), A (2), … … and A (n)) obtained by each iterative training into a third calculation module 15, fusing the training results by using the third calculation module 15 to obtain an image feature code corresponding to an original image, inputting the image feature code into a fourth calculation module 16 for adaptive processing to obtain a chaos initial value adaptive to the chaos mapping system, and taking the chaos initial value as a calculation initial value of the chaos mapping system.
Referring to fig. 4, fig. 4 is a schematic flow chart of an embodiment of obtaining a quantum image according to the present invention. It should be noted that the method for obtaining the quantum image described in this embodiment is not limited to the following steps:
for example, the original image may be input into the quantization processing model 20 to calculate a quantum image (as shown in fig. 5), and the encryption using the quantum image has the characteristics of multi-dimension, large capacity, high degree of freedom in design, good robustness, natural parallelism, and difficulty in cracking. The quantization process model 20 may be a quantum FRQI model, and is not limited herein.
Alternatively, the quantum image may be a quantum gray scale image, implementing quantized representations of pixels r (red), g (green), b (blue), respectively denoted as r m 、g m 、b m For subsequent operation of the pixel in quantum space.
To a pair 2 n *2 n Typically represented by the three primary colors red (R), green (G), and blue (B) for each pixel, with the respective component gray scale values between (0, 255) to visually match the color image with the quantitative characterization of the spectral response of the human eye. The image is processed by the quantization model 20 to obtain the quantum expression form
Figure BDA0003655386730000074
Further, the conversion from image to volume sub-image is realized, as shown in the following formula:
Figure BDA0003655386730000071
|c m >=|r m >|g m >|b m > (1-2)
|r m >=cosθ m |0>+sinθ m |1> (1-3)
|g m >=cosω m |0>+sinω m |1> (1-4)
|b m >=cosφ m |0>+sinφ m |1> (1-5)
wherein, | c m Y > and | m > respectively represent the encoded color information and the corresponding positions of the pixels; quantum states |0 > and |1 > represent two-dimensional computation basis quantum states;θ m 、ω m
Figure BDA0003655386730000072
respectively representing red, green and blue phase-encoded information, theta m 、ω m
Figure BDA0003655386730000073
m=0,1,…,2 2n -1; n is the number of qubits required for encoding.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating an image encryption method according to another embodiment of the present invention. It should be noted that the image encryption method set forth in this embodiment is not limited to the following steps:
in an embodiment, the image feature code of the original image is extracted, and the specific extraction manner has been exemplified in the above embodiments; meanwhile, quantum processing is also performed on the original image to obtain a quantum image, and a specific manner of obtaining the quantum image has been described in the above embodiments by way of example, and is not described herein again.
The image feature codes are converted to obtain initial values corresponding to the chaotic mapping system, the chaotic mapping system conducts iteration for a plurality of times to obtain chaotic sequences corresponding to the original images, the chaotic sequences are used for conducting encryption processing on the quantum images, for example, the chaotic sequences and the quantum images can be subjected to logic operation, the chaotic sequences are used for conducting scrambling processing and/or diffusion processing on the quantum images, and a first ciphertext image is obtained.
That is to say, the chaotic sequence and the quantum image may be subjected to a logic operation to scramble the quantum image to obtain a first ciphertext image; or, performing logic operation on the quantum image and the chaotic sequence to perform diffusion processing on the quantum image to obtain a first ciphertext image; or, the quantum image and the chaotic sequence may be subjected to a logical operation to perform scrambling processing and diffusion processing on the quantum image to obtain the first ciphertext image, and it is easy to understand that the logical operation to perform scrambling processing on the quantum image is different from the logical operation to perform diffusion processing on the quantum image.
The following description will be given by taking an example of "performing logical operation on the quantum image and the chaotic sequence, and performing scrambling processing and diffusion processing on the quantum image".
Specifically, the chaotic mapping system may include a first sub-chaotic system 31, the image feature code is input into the first sub-chaotic system 31 as a calculation initial value, the first sub-chaotic system 31 is utilized to perform a first chaotic mapping process on the image feature code, and a scrambling chaotic sequence is obtained, where the scrambling chaotic sequence has at least three-dimensional features.
For example, referring to fig. 5 and fig. 6 in combination, fig. 6 is a schematic flow chart of an embodiment of obtaining a scrambled pixel image according to the present invention. It should be noted that the image encryption method and the method for obtaining the scrambled pixel image described in this embodiment are not limited to the following steps:
the first sub-chaotic system 31 may be a classical Chen chaotic system, a Chen hyper-chaotic system, or the like, and is not limited herein. The computational formula of the Chen chaotic system for performing the first chaotic mapping processing on the image feature code is as follows:
Figure BDA0003655386730000081
wherein, when a is 35, b is 3 and c is 28, the Chen chaotic system will present chaotic state,
Figure BDA0003655386730000082
and performing first chaotic mapping processing on the image feature code to obtain a scrambling chaotic sequence, wherein the scrambling chaotic sequence has three-dimensional characteristics.
Or, a calculation formula of the Chen hyper-chaotic system performing the first chaotic mapping processing on the image feature code is as follows:
Figure BDA0003655386730000091
wherein d, e, h, l, and q are system parameters of the Chen hyperchaotic system, and can be calculated by the first calculation module 13 and the second calculation module shown in fig. 3The block 14, the third calculation module 15 and the fourth calculation module 16 are calculated;
Figure BDA0003655386730000092
iteration for Chen hyperchaotic system 2 2n And the scrambling chaotic sequence obtained in the second time has four-dimensional characteristics so as to increase the complexity of the scrambling chaotic sequence.
The scrambled chaotic sequence comprises a first subsequence, a second subsequence, and a third subsequence (i.e., the first subsequence, the second subsequence, and the third subsequence)
Figure BDA0003655386730000093
Figure BDA0003655386730000094
) The first subsequence, the second subsequence, and the third subsequence may be transformed to obtain a first scrambling sequence, a second scrambling sequence, and a third scrambling sequence.
For example, the first scrambling sequence is obtained by performing a modulo operation on the first subsequence and the gray scale; and/or the second scrambling sequence is obtained by performing complementation operation on the second subsequence and the gray scale; and/or the third scrambling sequence is obtained by performing complementation operation on the third subsequence and the gray scale.
Starting from the first pixel of the quantum image, each pixel can be decomposed into three gray component sequences, and the gray component sequences are scrambled by using the scrambling chaotic sequence to obtain a scrambled pixel image so as to increase the complexity of the scrambling chaotic sequence. Specifically, the gray component sequence includes a first gray component sequence, a second gray component sequence, and a third gray component sequence, and taking the original image as an RGB (red, green, blue, red, green, blue) format as an example, the first gray component sequence, the second gray component sequence, and the third gray component sequence respectively correspond to R, G, B.
And performing exclusive-or operation on the first gray component sequence, the second gray component sequence and the third gray component sequence respectively in the first scrambling sequence, the second scrambling sequence and the third scrambling sequence, thereby scrambling each pixel of the original image and weakening the relevance among the pixels. Specifically, the following formula can be used:
Figure BDA0003655386730000095
wherein the content of the first and second substances,
Figure BDA0003655386730000096
is a first scrambling sequence that is a sequence of bits,
Figure BDA0003655386730000097
for the purpose of the second scrambling sequence, the first scrambling sequence,
Figure BDA0003655386730000098
for the third scrambling sequence, in equation (2-3),
Figure BDA0003655386730000099
amplifying different times when forming a scrambling sequence, and further increasing the complexity of scrambling pixel images; 256, i.e., gray scale of; r is a radical of hydrogen m Is a first gray component sequence, g m Is the second gray component sequence, b m A third sequence of gray components.
Referring to fig. 5 and 7 in combination, fig. 7 is a schematic flow chart of an embodiment of obtaining a diffusion scrambled pixel image according to the present invention. It should be noted that the image encryption method and the method for obtaining the diffusion scrambled pixel image set forth in this embodiment are not limited to the following steps:
the chaotic mapping system has the characteristics of initial value sensitivity, randomness, ergodicity, unpredictability and the like, in the embodiment, the chaotic mapping system further comprises a second sub-chaotic system 32, and the second chaotic mapping processing is carried out on the image feature codes by utilizing the second sub-chaotic system 32 to obtain a diffusion chaotic sequence. In this embodiment, the image feature code may also be subjected to computation conversion to obtain a chaos initial value adapted to the second sub-chaotic system, and the chaos initial value is used as a computation initial value of the second sub-chaotic system to perform iteration, that is, a second chaos mapping process is performed to obtain a diffusion chaotic sequence.
The second sub-chaotic system 32 may be a classical Logistic mapping system, a quantum Logistic mapping system, and the like, which is illustrated below by way of example.
The mathematical expression of the classical Logistic mapping system is shown as the following formula:
x n+1 =μx n (1-x n ) (3-1)
wherein mu is a bifurcation parameter, and mu is more than or equal to 0 and less than or equal to 4.
The quantum Logistic mapping system can be obtained by quantizing a classical Logistic mapping system through a recoil rotor model, and the expression of the quantum Logistic mapping for performing second chaotic mapping processing is shown in the following formula:
Figure BDA0003655386730000101
wherein r is an adjustable parameter, beta is a dissipation parameter, and x n 、y n 、z n Is the state value of the system, x n *、z n Is x n 、z n Complex conjugation of (a).
Specifically, the image feature code is input to the second sub-chaotic system 32 (e.g., a quantum Logistic mapping system, etc.) as a calculation initial value, and the second sub-chaotic system 32 uses the image feature code system iteration 2 2n Then, a length of 2 is obtained 2n Of the chaotic sequence x m 、y m 、z m X of the m 、y m 、z m Is a diffusion chaotic sequence.
The pixels of the scrambled pixel image are respectively subjected to diffusion processing by using the diffusion chaotic sequence, specifically, the diffusion chaotic sequence and the scrambled pixel image can be subjected to exclusive or operation, as shown in the following formula, the diffusion scrambled pixel image is obtained, the diffusion scrambled pixel image is used as a first ciphertext image, and the pixels after scrambling in the scrambled pixel image can be subjected to diffusion processing by using the second sub-chaotic system 32, so that the purpose of pixel hybridization is achieved, and the degree of disorder among the pixels is further improved.
Figure BDA0003655386730000111
Figure BDA0003655386730000112
Wherein r' m 、g’ m 、b’ m Corresponding to a sequence of three gray components, x, for scrambling the pixel image m 、y m 、z m For diffuse chaotic sequences, | F 1 Is a diffusion scrambled pixel image.
Referring to fig. 5, fig. 8 and fig. 9 in combination, fig. 8 is a schematic flowchart illustrating an embodiment of encrypting by using an encryption key according to the present invention, and fig. 9 is a schematic flowchart illustrating an embodiment of obtaining a first sub-key and a second sub-key according to the present invention. It should be noted that the image encryption method, the method for encrypting by using the encryption key and obtaining the first sub-key and the second sub-key described in this embodiment are not limited to the following steps:
and acquiring an encryption key, wherein the encryption key can be set by a user, so that information set by the user can be fused in the encryption process of the original image, and the complexity of the encrypted image is further improved.
Inputting the encryption key into the fifth calculating module 40, decomposing the encryption key by using the fifth calculating module 40, and converting to obtain the first sub-key and the second sub-key, where a specific decomposition manner may be shown by the following formula:
Figure BDA0003655386730000113
Figure BDA0003655386730000114
wherein psi 1j 、υ 1j 、τ 1j 、ψ 2j 、υ 2j 、τ 2j ∈[0,2Π]K1 is the first subkey, and K2 is the second subkey.
Performing quantum Fourier transform on the first sub-secret key and the first ciphertext image to obtain an encrypted image, wherein the following formula is shown:
Figure BDA0003655386730000115
wherein, B rm 、B gm 、B bm Obtained by the foregoing formula (3-3), K1 is the first subkey, | F 2 Is an encrypted image, | F 1 "is the first ciphertext image.
And performing quantum Fourier inverse transformation on the second sub-secret key and the encrypted image to obtain a second ciphertext image, wherein the formula is as follows:
Figure BDA0003655386730000121
wherein, | F 3 Is the second ciphertext image.
Therefore, in the image encryption method of the embodiment, the image feature code is output by processing the input original image through the image feature extraction module, the image feature code can be used for verifying the integrity of the image and improving the falsified identification, and then the image feature code is input as the initial value of the first sub-chaotic system and the second sub-chaotic system after a series of calculation conversion is performed on the image feature code, so that the one-to-one correspondence between the image and the chaotic sequence is realized; the original image is processed by a quantum processing model to obtain a quantum image, and the quantized representation of pixels r, g and b is realized, so that the subsequent operation is facilitated; scrambling processing is carried out by utilizing the first sub-chaotic system, and the reduction of the relevance among pixels is realized; carrying out diffusion processing on the pixels of the disordered pixel image by using a second sub-chaotic system to realize pixel hybridization; the pixels of the diffusion scrambled pixel image are encrypted by utilizing quantum Fourier transform and quantum Fourier inverse transform, so that the pixel value is changed, a final ciphertext image, namely a second ciphertext image is obtained, the safety and the encryption efficiency of the encrypted image are improved, and known plaintext attack, plaintext attack selection and statistical analysis attack can be effectively resisted.
In an alternative embodiment, the scrambled pixel image may be taken as the first ciphertext image; or, the quantum image and the chaotic sequence are subjected to logic operation to perform diffusion processing on the quantum image to obtain a diffusion pixel image, and the diffusion pixel image may be used as the first ciphertext image, which is not limited herein. The specific implementation of performing the diffusion processing on the quantum image and the chaotic sequence through the logic operation is similar to the diffusion processing on the chaotic pixel image in the above embodiment, and is not repeated here.
Referring to fig. 10, fig. 10 shows a method for decrypting a ciphertext image according to the present invention. It should be noted that the decryption method for the ciphertext image described in this embodiment is not limited to the following steps:
s201: and acquiring a ciphertext image.
In this embodiment, the ciphertext image may be obtained by encrypting using the image encryption method described in the above embodiment, that is, the ciphertext image may be the first ciphertext image/the second ciphertext image.
S202: and carrying out decryption processing on the ciphertext image to obtain an original image.
In this embodiment, after the ciphertext image is obtained, the decryption process is performed on the ciphertext image, and in order to restore the original image, the decryption method for performing the decryption process should match the encryption method for the encryption process.
The following explains the decryption process by way of example, taking the ciphertext image obtained in step S201 as the second ciphertext image explained above.
Performing quantum Fourier transform on the second ciphertext image and the second sub-key to obtain an encrypted image, wherein the following formula is shown in detail:
Figure BDA0003655386730000131
wherein, | F 3 K2 is the second sub-key, K1 is the first sub-key, B rm 、B gm 、B bm Obtained by the foregoing formula (3-3).
Performing quantum Fourier inverse transformation on the encrypted image and the first sub-secret key to obtain a first ciphertext image, wherein the first ciphertext image is obtained by the following formula:
Figure BDA0003655386730000132
wherein, | F 1 Is the first ciphertext image.
Performing logical operation on the first ciphertext image and the diffusion chaotic sequence to obtain a scrambled pixel image, wherein the following formula is shown in detail:
Figure BDA0003655386730000133
wherein x is m 、y m 、z m To diffuse chaotic sequences, B rm 、B gm 、B bm Obtained by the formula (5-2) of r' m 、g’ m 、b’ m A sequence of three gray components is assigned to the scrambled pixel image.
Performing logical operation on the scrambled pixel image and the scrambling sequence to obtain an original image, wherein the following formula is shown in detail:
Figure BDA0003655386730000134
wherein, among others,
Figure BDA0003655386730000141
is the first scrambling sequence and is the second scrambling sequence,
Figure BDA0003655386730000142
for the purpose of the second scrambling sequence, the first scrambling sequence,
Figure BDA0003655386730000143
is a third scrambling sequence.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
In an embodiment, the electronic device 50 comprises a memory (not shown) and a processor 51, the memory being used for storing computer programs needed for the processor 51 to run. The processor 51 is configured to run a computer program to implement the image encryption method as set forth in any one of the embodiments above, or the decryption method of the ciphertext image as set forth in any one of the embodiments above.
The processor 51 may also be referred to as a CPU (Central Processing Unit). The processor 51 may be an integrated circuit chip having signal processing capabilities. The processor 51 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The general purpose processor may be a microprocessor or the processor 51 may be any conventional processor or the like.
Referring to fig. 12, fig. 12 is a schematic structural diagram of an embodiment of a computer-readable storage medium 60 according to the present invention, in an embodiment, the computer-readable storage medium is used for storing instructions/program data 61, and the instructions/program data 61 can be executed to implement the image encryption method described in any of the above embodiments or the decryption method of the ciphertext image described in any of the above embodiments, which is not described herein again.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are illustrative, e.g., a division of modules or units into one logical division, and an actual implementation may have another division, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present invention, which is substantially or partly contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a computer readable storage medium 60 and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method set forth in the embodiments of the present invention. And the aforementioned computer-readable storage medium 60 includes: a U-disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, a server, and various media capable of storing program codes.
In addition, in the present invention, unless otherwise expressly specified or limited, the terms "connected," "stacked," and the like are to be construed broadly, e.g., as meaning permanently connected, detachably connected, or integrally formed; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. An image encryption method, comprising:
extracting an image feature code of an original image, and performing quantum processing on the original image to obtain a quantum image;
and iterating the image feature code as an initial value of a chaotic mapping system to obtain a chaotic sequence, and encrypting the quantum image by using the chaotic sequence to obtain a first ciphertext image.
2. The image encryption method according to claim 1, wherein the encrypting the quantum image by using the chaotic sequence to obtain a first ciphertext image comprises:
and carrying out scrambling processing and/or diffusion processing on the quantum image by using the chaotic sequence to obtain the first ciphertext image.
3. The image encryption method according to claim 2, wherein the chaotic mapping system includes a first sub-chaotic system;
the image feature code is used as an initial value of a chaotic mapping system to carry out iteration to obtain a chaotic sequence, and the chaotic sequence is used for carrying out encryption processing on the quantum image to obtain a first ciphertext image comprises the following steps:
performing first chaotic mapping processing on the image feature code by using the first sub-chaotic system to obtain a scrambling chaotic sequence, wherein the scrambling chaotic sequence has at least three-dimensional characteristics;
decomposing pixels of the quantum image into three gray component sequences;
and scrambling the gray component sequence by using the scrambling chaotic sequence to obtain a scrambled pixel image, and taking the scrambled pixel image as the first ciphertext image.
4. The image encryption method according to claim 3, wherein the sequence of grayscale components includes a first sequence of grayscale components, a second sequence of grayscale components, and a third sequence of grayscale components, and the scrambling chaotic sequence includes a first subsequence, a second subsequence, and a third subsequence;
the scrambling processing of the gray component sequence by using the scrambling chaotic sequence to obtain a scrambled pixel image comprises:
respectively carrying out transformation processing on the first subsequence, the second subsequence and the third subsequence to obtain a first scrambling sequence, a second scrambling sequence and a third scrambling sequence;
and performing exclusive-or operation on the first gray component sequence, the second gray component sequence and the third gray component sequence respectively with a first scrambling sequence, a second scrambling sequence and a third scrambling sequence.
5. The image encryption method according to claim 4, wherein the transforming the first subsequence, the second subsequence, and the third subsequence to obtain a first scrambling sequence, a second scrambling sequence, and a third scrambling sequence respectively comprises:
the first scrambling sequence is obtained by performing complementation operation on the first subsequence and the gray scale; and/or
The second scrambling sequence is obtained by performing complementation operation on the second subsequence and the gray scale; and/or
And the third scrambling sequence is obtained by performing a complementation operation on the third subsequence and the gray scale.
6. The image encryption method according to claim 3, wherein the chaotic mapping system includes a second sub-chaotic system;
the method further comprises the following steps:
performing second chaotic mapping processing on the image feature code by using a second sub-chaotic system to obtain a diffusion chaotic sequence;
and performing exclusive-or operation on the diffusion chaotic sequence and the scrambled pixel image to obtain a diffusion scrambled pixel image, and taking the diffusion scrambled pixel image as the first ciphertext image.
7. The image encryption method according to claim 1, wherein said extracting the image feature code of the original image comprises:
acquiring a random number and a hash value of the original image;
performing complexity processing on the hash value of the original image by using the random number to obtain an iteration initial value;
performing iterative training on the iteration initial value; performing current iterative training together with the initial iterative value and the training result of the previous iterative training;
fusing training results obtained by each iterative training to obtain the image feature codes;
the step of using the image feature code as an initial value of the chaotic mapping system comprises:
and performing calculation conversion on the image feature code to obtain a chaos initial value adaptive to the chaos mapping system initial value, and taking the chaos initial value as the chaos mapping system initial value.
8. The image encryption method according to claim 1, characterized in that the method further comprises:
acquiring an encryption key;
decomposing and converting the encryption key to obtain a first sub-key and a second sub-key;
performing quantum Fourier transform on the first sub-secret key and the first ciphertext image to obtain an encrypted image;
and performing quantum Fourier inverse transformation on the second sub-secret key and the encrypted image to obtain a second ciphertext image.
9. A method for decrypting a ciphertext image, comprising:
acquiring a ciphertext image; the ciphertext image is obtained by encrypting by using the image encryption method according to any one of claims 1 to 8;
carrying out decryption processing on the ciphertext image to obtain an original image;
wherein the decryption process matches the encryption process.
10. The method for decrypting a ciphertext image according to claim 9, wherein the ciphertext image is a second ciphertext image, the method comprising:
performing quantum Fourier transform on the second ciphertext image and the second sub-key to obtain an encrypted image;
carrying out quantum Fourier inverse transformation on the encrypted image and the first sub-secret key to obtain a first ciphertext image;
performing logical operation on the first ciphertext image and the diffusion chaotic sequence to obtain a scrambled pixel image;
and performing logical operation on the scrambled pixel image and the scrambling sequence to obtain the original image.
11. An electronic device, comprising:
a memory in which a computer program is stored, and a processor for operating the computer program to implement the image encryption method of any one of claims 1 to 8, or to implement the decryption method of the ciphertext image of any one of claims 9 to 10.
12. A computer-readable storage medium for storing instructions/program data executable to implement the image encryption method of any one of claims 1 to 8 or the decryption method of a ciphertext image of any one of claims 9 to 10.
CN202210557186.5A 2022-05-20 2022-05-20 Image encryption and decryption method and related equipment Pending CN115134471A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210557186.5A CN115134471A (en) 2022-05-20 2022-05-20 Image encryption and decryption method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210557186.5A CN115134471A (en) 2022-05-20 2022-05-20 Image encryption and decryption method and related equipment

Publications (1)

Publication Number Publication Date
CN115134471A true CN115134471A (en) 2022-09-30

Family

ID=83376426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210557186.5A Pending CN115134471A (en) 2022-05-20 2022-05-20 Image encryption and decryption method and related equipment

Country Status (1)

Country Link
CN (1) CN115134471A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116915922A (en) * 2023-09-13 2023-10-20 中移(苏州)软件技术有限公司 Image transmission method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116915922A (en) * 2023-09-13 2023-10-20 中移(苏州)软件技术有限公司 Image transmission method and device, electronic equipment and storage medium
CN116915922B (en) * 2023-09-13 2023-12-01 中移(苏州)软件技术有限公司 Image transmission method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
Chen et al. Compression-unimpaired batch-image encryption combining vector quantization and index compression
CN113297606B (en) Color quantum image encryption and decryption method based on multiple chaos and DNA operation
CN110139000B (en) Image compression encryption method based on compressed sensing and life game scrambling
CN112202984B (en) Ciphertext domain reversible information hiding method based on error correction redundancy
Boussif et al. Securing DICOM images by a new encryption algorithm using Arnold transform and Vigenère cipher
CN107392970B (en) Digital image encryption method based on bit plane and high-dimensional chaotic system
CN110148078B (en) Two-dimensional compressed sensing-based two-color image compression and encryption method
Xiang et al. Cryptanalysis and improvement of a reversible data-hiding scheme in encrypted images by redundant space transfer
CN115694784A (en) Data safety storage method
Pashakolaee et al. Hyper-chaotic Feeded GA (HFGA): a reversible optimization technique for robust and sensitive image encryption
CN114157772B (en) Digital image encryption method based on space-time chaotic system and half tensor product compressed sensing
CN113691362B (en) Bit plane image compression encryption method based on hyperchaotic system and DNA coding
Gabr et al. A combination of decimal-and bit-level secure multimedia transmission
CN115134471A (en) Image encryption and decryption method and related equipment
CN116506218B (en) User data interactive computing privacy protection method and system in cloud environment
CN107507254A (en) Compression of images encryption method based on arithmetic coding
Shao et al. Trinion discrete cosine transform with application to color image encryption
Govindasamy et al. Coverless image steganography using Haar integer wavelet transform
CN112769545A (en) Image encryption method based on adjacent pixel Joseph transformation and Mealy state machine
CN111723386A (en) Dynamic DNA color image encryption method based on SHA-512
Alhassan et al. Enhancing image security during transmission using residue number system and k-shuffle
Chang et al. Distortion‐free secret image sharing method with two meaningful shadows
Wazery et al. A hybrid technique based on RSA and data hiding for securing handwritten signature
Abed A proposed encoding and hiding text in an image by using fractal image compression
CN105704499B (en) A kind of selective satellite image compression encryption method based on ChaCha20 and CCSDS

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination