Image encryption method, device and equipment and image decryption method

Through deep learning compression and two-dimensional target chaotic mapping combined with Arnold chaotic and chaotic circumference cyclic shift processing, the problem of image encryption in the prior art failing to consider both compression and encryption, and an image encryption method with high chaotic performance and security is realized.

CN120050366AActive Publication Date: 2025-05-27ANHUI UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510192262.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-05-27
Estimated Expiration
2045-02-21

AI Technical Summary

Technical Problem

Existing image encryption methods fail to consider both image compression and encryption, resulting in low chaotic performance and insufficient security.

Method used

The original plaintext image is compressed through the first deep learning network, and the hash value of the compressed plaintext image is calculated. Based on the hash value, the first chaotic sequence and the second chaotic sequence are obtained through the two-dimensional target chaos mapping, and the target encrypted image is obtained by combining Arnold chaos and chaotic circumference cyclic shift processing.

Benefits of technology

It improves the chaotic performance and security of image encryption, and combines efficient image compression and encryption, which is difficult to crack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050366A_ABST
    Figure CN120050366A_ABST
Patent Text Reader

Abstract

The invention relates to an image encryption method, device and equipment and an image decryption method, and the method comprises the steps: compressing an original plaintext image through a first deep learning network, and obtaining a compressed plaintext image; based on the hash value of the compressed plaintext image, obtaining a first chaotic sequence and a second chaotic sequence through target chaotic mapping; performing Arnodean scrambling processing on the compressed plaintext image to obtain an initial encrypted image; and based on the first chaos sequence and the second chaos sequence, performing chaos circumference cyclic shift processing on the initial encrypted image to obtain a target encrypted image. According to the image encryption method disclosed by the invention, deep learning compression and image encryption are efficiently combined, and the chaotic system adopted by the image encryption method has higher chaotic performance, so that the image encryption method has higher safety performance and is more difficult to crack, and the problem that compression and encryption of the image are not considered at the same time in the current image encryption method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data encryption and decryption, and in particular to an image encryption method, device and equipment, and an image decryption method. Background Art

[0002] As an important information carrier, digital images play an irreplaceable role in data transmission. However, with the popularization of the Internet and the rapid development of network technology, the use and transmission of digital images are increasing, which makes the security and confidentiality of images face great challenges, and the demand for efficient image transmission and storage is also increasing. Therefore, in information transmission, it is very necessary to consider image compression and encryption at the same time.

[0003] In addition, in the current image encryption method, one-dimensional discrete chaotic mapping is usually used. Since the one-dimensional discrete chaotic mapping has too few parameters, the generated control key space is small, and the parameter range of the chaotic behavior is narrow and discontinuous, which reduces the chaotic performance of image encryption.

[0004] With regard to the problem that current image encryption methods fail to consider image compression and encryption at the same time, no effective solution has been proposed yet. Summary of the invention

[0005] The present invention provides an image encryption method, device and equipment, and an image decryption method to solve the problem that the current image encryption method fails to consider image compression and encryption at the same time.

[0006] In a first aspect, the present invention provides an image encryption method, comprising:

[0007] Compressing the original plaintext image through a first deep learning network to obtain a compressed plaintext image;

[0008] Based on the hash value of the compressed plaintext image, the first chaotic sequence and the second chaotic sequence are obtained through the target chaotic mapping. The target chaotic mapping is:

[0009]

[0010] Among them, a and b represent the first parameter and the second parameter respectively, x n and x n+1 Respectively represent the first sequence values ​​before and after the nth iteration. Multiple generations of first sequence values ​​constitute the first chaotic sequence. n and n+1 Respectively represent the second sequence values ​​before and after the nth iteration. Multiple generations of second sequence values ​​constitute the second chaotic sequence. a, b, x 0 and 0 Determined based on the hash value of the compressed plaintext image and an external key;

[0011] Perform Arnold scrambling on the compressed plaintext image to obtain an initial encrypted image;

[0012] Based on the first chaotic sequence and the second chaotic sequence, perform chaotic circular shift processing on the initial encrypted image to obtain a target encrypted image.

[0013] In a second aspect, the present invention provides an image decryption method, including:

[0014] Obtain the target encrypted image processed by the image encryption method described in the first aspect, as well as the hash value and external key of the corresponding compressed plaintext image;

[0015] Based on the hash value of the compressed plaintext image and the external key, obtain the first chaotic sequence and the second chaotic sequence through the target chaotic mapping;

[0016] Based on the first chaotic sequence and the second chaotic sequence, perform inverse chaotic circular shift processing on the target encrypted image to obtain an initial decrypted image;

[0017] Perform inverse Arnold scrambling on the initial decrypted image to obtain a compressed plaintext image;

[0018] Decompress the compressed plaintext image through a second deep learning network, and perform noise reduction on the decompression result through a third deep learning network to obtain the original plaintext image.

[0019] In a third aspect, the present invention provides an image encryption and decryption method, including an encryption step executed by a first terminal and a decryption step executed by a second terminal;

[0020] The encryption step includes:

[0021] Compress the original plaintext image through a first deep learning network and quantize the compression result to obtain a compressed plaintext image; wherein, the original plaintext image is input into the first deep learning model in blocks;

[0022] Based on the hash value of the compressed plaintext image, obtain the first chaotic sequence and the second chaotic sequence through the target chaotic mapping, and the target chaotic mapping is:

[0023]

[0024] wherein, a and b respectively represent the first parameter and the second parameter, x n and x n+1 respectively represent the first sequence values before and after the nth iteration, and multiple generations of first sequence values form the first chaotic sequence, y n and y n+1 respectively represent the second sequence values before and after the nth iteration, and multiple generations of second sequence values form the second chaotic sequence, a, b, x 0and y 0 Determined according to the hash value of the compressed plaintext image and the external key;

[0025] Perform Arnold scrambling on the compressed plaintext image to obtain the initial encrypted image;

[0026] Based on the first chaotic sequence and the second chaotic sequence, perform chaotic circular shift processing on the initial encrypted image to obtain the target encrypted image;

[0027] The decryption steps include:

[0028] Based on the hash value of the compressed plaintext image and the external key, obtain the first chaotic sequence and the second chaotic sequence through the target chaotic mapping;

[0029] Based on the first chaotic sequence and the second chaotic sequence, perform inverse chaotic circular shift processing on the target encrypted image to obtain the initial decrypted image;

[0030] Perform inverse Arnold scrambling on the initial decrypted image to obtain the compressed plaintext image;

[0031] Decompress the compressed plaintext image after inverse quantization through the second deep learning network, and perform noise reduction on the decompression result through the third deep learning network to obtain the original plaintext image;

[0032] Among them, the first deep learning network and the second deep learning network adopt end-to-end joint training.

[0033] Fourthly, in the present invention, an image encryption device is provided, including:

[0034] An image compression module, configured to compress the original plaintext image through the first deep learning network and quantize the compression result to obtain the compressed plaintext image; wherein, the original plaintext image is input into the first deep learning model in blocks;

[0035] A chaotic mapping module, configured to obtain the first chaotic sequence and the second chaotic sequence through the target chaotic mapping based on the hash value of the compressed plaintext image, and the target chaotic mapping is:

[0036]

[0037] Wherein, a and b respectively represent the first parameter and the second parameter, x n and x n+1 respectively represent the first sequence values before and after the nth iteration, and multiple generations of the first sequence values form the first chaotic sequence, y n and y n+1 respectively represent the second sequence values before and after the nth iteration, and multiple generations of the second sequence values form the second chaotic sequence, a, b, x 0 and y 0Determined according to the hash value of the compressed plaintext image and an external key;

[0038] An image scrambling module, configured to perform Arnold scrambling on the compressed plaintext image to obtain an initial encrypted image;

[0039] An image shifting module, configured to perform chaotic circular shift processing on the initial encrypted image based on a first chaotic sequence and a second chaotic sequence to obtain a target encrypted image.

[0040] In a fifth aspect, the present invention provides an encryption device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the image encryption method described in the first aspect.

[0041] Compared with the related art, the present invention provides an image encryption method, and its main process includes: first, compressing the original plaintext image through a first deep learning network to obtain a compressed plaintext image. Moreover, the original plaintext image is input into the first deep learning network in blocks, and in order to better connect with subsequent image encryption, the compression result is quantized to obtain the compressed plaintext image; then, calculating the hash value of the compressed plaintext image, and obtaining a first chaotic sequence and a second chaotic sequence through a two-dimensional target chaotic map based on the above hash value, and then successively performing sliding Arnold scrambling processing and chaotic circular shift processing on the compressed plaintext image based on the two chaotic sequences to finally obtain a target encrypted image. Therefore, the image encryption method in the present invention efficiently combines deep learning compression and image encryption, and the chaotic system adopted by the image encryption method has higher chaotic performance, and thus has higher security performance and is more difficult to be cracked, solving the problem that the current image encryption method fails to consider both image compression and encryption at the same time.

[0042] Details of one or more embodiments of the present application are set forth in the following drawings and description, so that other features, objects, and advantages of the present application become more comprehensible. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flowchart of the image encryption method provided in this embodiment;

[0044] Figure 2 is a schematic diagram of the image encryption method provided in this embodiment;

[0045] Figure 3 is a schematic diagram of the image decryption method provided in this embodiment;

[0046] Figure 4 is a diagram of the change of the Lyapunov exponent when the parameter a of the target chaotic map provided in this embodiment changes continuously;

[0047] Figure 5 It is the Lyapunov exponent change diagram of the target chaotic map provided in this embodiment when the parameter b changes continuously;

[0048] Figure 6 It is a schematic diagram of chaotic circle cyclic shift provided in this embodiment;

[0049] Figure 7 It is a schematic diagram of the effect of the image encryption and decryption method provided in this embodiment. Specific Embodiments

[0050] For a clearer understanding of the purpose, technical solution and advantages of this application, the following describes and explains this application with reference to the accompanying drawings and embodiments.

[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by those with ordinary skills in the technical field to which this application belongs. In this application, words such as "a", "one", "a kind of", "the", "these" and the like do not indicate a limitation in quantity, and they can be singular or plural. The terms "including", "comprising", "having" and any variants thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products or devices. The terms "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly connected. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the associated objects before and after are in an "or" relationship. The terms "first", "second", "third" and the like involved in this application only distinguish similar objects and do not represent a specific sorting of the objects.

[0052] In this embodiment, an image encryption method is provided. Referring to Figure 1 and Figure 2 , this process includes step S110, step S120, step S130 and step S110.

[0053] Step S110, compressing the original plaintext image through a first deep learning network and quantifying the compression result to obtain a compressed plaintext image; wherein, the original plaintext image is input into the first deep learning model in blocks.

[0054] In this embodiment, the first deep learning network is a fully connected layer neural network without bias terms. It receives image patches of size 32×32 as input and outputs one-dimensional CS measurement values of 1×(SR×1024), where SR represents the sampling rate. In preprocessing, the original plaintext image is divided into 32×32×L non-overlapping blocks, where L represents the number of image blocks. Since compression is performed by a fully connected layer neural network, these image blocks are reshaped into one-dimensional vectors to match the 1024 neurons of the first fully connected layer. The input and output dimensions of the first fully connected layer are 1×1024. In this fully connected layer, the network performs a linear transformation operation on the input one-dimensional vector to extract the features of the input. The input dimension of the second fully connected layer is 1×1024, and the output dimension is 1×(SR×1024). The function of this fully connected layer is to further compress the input one-dimensional vector and reduce the dimension by a factor of SR.

[0055] As can be seen from the above example, the image compression process mainly uses the compressive sensing theory to perform CS sampling on the initial plaintext image of size M×M. It specifically includes step S111, step S112, and step S113.

[0056] Step S111: Obtain n1 original plaintext images of size M×M.

[0057] Step S112: Image block division: Divide n 1 original plaintext images into n 2 image blocks of size BS×BS; where, n 2 =n 1 ×(M / BS) 2 .

[0058] Step S113: Image compression. The compression process can be expressed as:

[0059] B i =φA i , i = 1, 2,..., n 2

[0060] where, A i represents the i-th image block of size BS×BS, and B i represents the compressed value of A i with a size of (BS 2 ×SR)×1. φ is the compression matrix for performing the compression function. In this embodiment, a fully connected layer without bias terms is used as the image compression network (the first deep learning network), and its function is the same as that of the compression matrix.

[0061] Step S114, quantization. To ensure the integrity and reliability of the compressed data during processing and facilitate subsequent encryption operations, it is necessary to quantize the sampled values (compressed values) output by the first deep learning network. The quantized data is an 8-bit unsigned integer. The quantization formula is as follows:

[0062]

[0063] where B represents the matrix of compressed values of all image blocks output by the first deep learning network, min and max respectively represent the minimum and maximum compressed values in B, floor and reshape respectively represent the floor function and the reshape function, and C represents the quantized B, that is, the compressed plaintext image, with a size of M×(M×SR).

[0064] Step S120, based on the hash value of the compressed plaintext image, obtain the first chaotic sequence and the second chaotic sequence through the target chaotic map. The target chaotic map is as follows:

[0065]

[0066] where a and b respectively represent the first parameter and the second parameter, x n and x n+1 respectively represent the first sequence values before and after the nth iteration. Multiple generations of the first sequence values form the first chaotic sequence. y n and y n+1 respectively represent the second sequence values before and after the nth iteration. Multiple generations of the second sequence values form the second chaotic sequence. a, b, x 0 and y 0 are determined according to the hash value of the compressed plaintext image and the external key.

[0067] The above target chaotic map is a two-dimensional chaotic map, which has strong chaos. Referring to Figure 4 which shows that there are two positive Lyapunov exponents when the parameter a in the target chaotic map changes continuously. Referring to Figure 5 which shows that there are two positive Lyapunov exponents when the parameter b in the target chaotic map changes continuously. Both show that the target chaotic map has obvious hyperchaotic characteristics, that is, it is hyperchaotic in a continuous large range interval, can provide more complex chaotic sequences and a larger key space, and increase the security of the encryption algorithm or scheme.

[0068] In this step, it is necessary to first calculate the hash value of the compressed plaintext image. In this embodiment, the calculation steps of the hash value of the compressed plaintext image include: adding random noise to the compressed plaintext image, and then using the SHA-256 hash function to calculate the 256-bit binary hash value of the compressed plaintext image; converting the 256-bit binary hash value into 32 decimal hash values, each 8 bits are converted into a decimal number between 0 and 255, and the 32 decimal numbers are represented as h 1 、h 2 、....、h 31 and h 32 . After obtaining the 32 decimal hash values, the parameters and sequence initial values in the target chaotic map can be calculated in combination with the external key. In this embodiment, the determination formulas for a, b, x 0 and y 0 are as follows:

[0069]

[0070] where, represents bitwise exclusive OR calculation, h i represents the i-th decimal hash value, and t 1 、t 2 、t 3 and t 4 are all external keys.

[0071] Step S130, perform Arnold scrambling on the compressed plaintext image to obtain the initial encrypted image. Arnold scrambling means scrambling the positions of each pixel point in the image, and multiple rounds of iterative scrambling will be performed. Two scrambling parameters will be used during the scrambling process. In traditional Arnold scrambling, the scrambling parameters used in each round of scrambling are the same. In this embodiment, in order to further improve the encryption intensity, the scrambling parameters used in each round of scrambling are selected to be updated. Specifically, Arnold is set to sliding Arnold scrambling. Sliding Arnold scrambling uses different scrambling parameters in each generation of scrambling. The determination formula for the scrambling parameters in each generation is:

[0072] A i =floor(l 2i-1 ×2 16 mod16)

[0073] B i =floor(l 2i ×2 16 mod16)

[0074] where, A i and B i respectively represent the scrambling parameters of the i-th generation, and l 2i-1 ×2 16mod16 represents the remainder when the product of the (2i - 1)-th sequence value in the chaotic sequence l and 2 16 is divided by 16, and l 2i ×2 16 mod16 represents the remainder when the product of the 2i-th sequence value in the chaotic sequence l and 2 16 is divided by 16, floor represents the floor function, and l represents any chaotic sequence among the first chaotic sequence and the second chaotic sequence.

[0075] The unpredictability and high randomness of the chaotic sequence endow it with good encryption performance. Using the chaotic sequence to generate parameters in the Arnold transform iteration can improve the security of the encryption algorithm and make it more difficult for attackers to crack the encrypted information.

[0076] The sliding Arnold scrambling process essentially applies an encryption process to the image. After the sliding Arnold scrambling process, the initial encrypted image can be obtained, and the initial encrypted image is the compressed plaintext image that has undergone one encryption process.

[0077] Step S140: Based on the first chaotic sequence and the second chaotic sequence, perform chaotic circular shift processing on the initial encrypted image to obtain the target encrypted image.

[0078] This step is to encrypt the initial encrypted image again. The circular shift processing is to perform a circular shift on the binary representation of the pixel value of each pixel point in the image. There are two important parameters mainly involved in the circular shift, namely the shift step and the shift direction. For example, for the binary representation of a certain pixel value of 100101, shifting it two steps to the left becomes 010110, that is, all numerical values are shifted two bits to the left, and the two leftmost bit values are filled to the two rightmost bit positions, forming a shift effect where the head and tail are connected, so it is called circular shift.

[0079] In this embodiment, step S140 specifically includes: generating a shift matrix that matches the number of pixels of the initial encrypted image, and the numerical values and directions of each element in the shift matrix are determined by the first chaotic sequence and the second chaotic sequence respectively: performing circular shift processing on the binary representation of the corresponding pixels in the initial encrypted image according to each element in the shift matrix respectively to obtain the target encrypted image. Each element in the shift matrix corresponds to each pixel in the initial encrypted image, and each element represents the shift step of the corresponding pixel through the numerical size and represents the shift direction of the corresponding pixel through the positive or negative sign. It should be noted that the number of sequence values in the first chaotic sequence and the second chaotic sequence should be greater than the number of pixels in the initial encrypted image.

[0080] The following specifically illustrates steps S120, S130, and S140 through an example.

[0081] In one example, the encryption process includes chaotic sequence generation, sliding Arnold scrambling, and chaotic circular shift.

[0082] Chaotic sequence generation: Using the calculated keys a, b, x 0 and y 0 , input them into the target chaotic map and iterate M×M + L + 2000 times (assuming the pixel size of the compressed plaintext image is M×M). Discard the first 2000 numbers of the iterated sequence to offset the transient effect of the chaotic system.

[0083] Sliding Arnold scrambling: Perform the sliding Arnold scrambling process on the compressed plaintext image. The number of encryption rounds is set to L, and the scrambling parameter for each sliding Arnold scrambling is controlled by a chaotic sequence of length L. It should be noted that in this example, the parts of two chaotic sequences with lengths of M×M and L are respectively used for chaotic circular shift and sliding Arnold scrambling. Of course, it is also possible not to make a distinction, and the same chaotic sequence is used for both parts.

[0084] Chaotic circular shift: Perform left - right random circular shift at the pixel level on an 8 - bit image (in this example, the binary representation of the pixel is 8 bits, and the binary representation of the pixel can also be represented by more or fewer bits). The length and direction of the shift are determined by a matrix CONT (shift matrix) of size M×M, and CONT is generated as follows:

[0085] CONT = floor(mod(abs(x L+1:M×M+L+1 )×10 16 , 8))

[0086]

[0087] where x L+1:M×M+L+1 represents the local sequence composed of the sequence values from the (L + 1)-th to the (M×M + L + 1)-th in the first chaotic sequence, y L+1:M×M+L+1 represents the local sequence composed of the sequence values from the (L + 1)-th to the (M×M + L + 1)-th in the second chaotic sequence, abs represents the absolute value function, mod represents the modulo function, floor represents the floor function, and mean represents the mean function. The first formula above shows the value - taking process of each element in CONT, which is determined according to the corresponding sequence value in the first chaotic sequence. The second formula above shows the positive - negative determination process of each element in CONT, which is determined according to the corresponding sequence value in the second chaotic sequence. When a certain sequence value in the second chaotic sequence is greater than the mean of y L+1:M×M+L+1 , the corresponding element in CONT is positive, otherwise it is negative.

[0088] Through the above formula, each element of CONT obtained is within the range of [-7, 7], and there are a total of 15 ways of circular shift. Exemplarily, referring to Figure 6 , when the second element in a certain row of CONT is 1, the binary representation of the pixel value 140 at the second position in the corresponding row of the initial encrypted image is shifted 1 bit to the right to become 70; when the ninth element in a certain row of CONT is -2, the binary representation of the pixel value 98 at the ninth position in the corresponding row of the initial encrypted image is shifted 2 bits to the left to become 137.

[0089] It should be noted that in some existing conventional image encryption algorithms, chaotic mapping is also used to generate a chaotic sequence, and the step size in the circular cyclic shift of each image pixel is determined based on the chaotic sequence. However, these image encryption algorithms use one-dimensional chaotic mapping, that is, only a single chaotic sequence is generated, and the shift step size is determined according to the single chaotic sequence. In this embodiment, the target chaotic mapping used is two-dimensional chaotic mapping, which can generate two sets of chaotic sequences, and the shift step size and shift direction are generated according to the two sets of chaotic mappings respectively, so that the entire encryption algorithm is more complex and difficult to crack, and the chaos of the encryption algorithm is improved.

[0090] As can be seen from the above introduction, in this embodiment, an image encryption method is provided, and its main process includes: first, the original plaintext image is compressed by a first deep learning network to obtain a compressed plaintext image (deep learning compression has not been introduced into image encryption in the prior art), and the original plaintext image is input into the first deep learning network in blocks, and in order to better connect with the subsequent image encryption, the compression result is quantized to obtain a compressed plaintext image; then, the hash value of the compressed plaintext image is calculated, and based on the above hash value, a first chaotic sequence and a second chaotic sequence are obtained through two-dimensional target chaotic mapping (one-dimensional chaotic mapping is usually used in the prior art), and then the compressed plaintext image is subjected to sliding Arnold scrambling processing (the Arnold scrambling in the prior art uses fixed scrambling parameters) and chaotic circular cyclic shift processing (the chaotic circular cyclic shift processing in the prior art only uses a set of chaotic sequences to generate the shift step size) in sequence based on the two chaotic sequences, and finally the target encrypted image is obtained. Therefore, the image encryption method in this embodiment efficiently combines deep learning compression and image encryption, and the chaotic system used in this image encryption method has higher chaotic performance, and thus has higher security performance and is more difficult to crack, solving the problem that the current image encryption method fails to consider both image compression and encryption at the same time.

[0091] Based on the above image encryption method, a corresponding image decryption method is also provided in this embodiment. Essentially, the image decryption process is the opposite of the image encryption process. Referring to Figure 3, the image decryption method provided in this embodiment includes step S210, step S220, step S230, step S240, step S250, and step S260.

[0092] Step S210, obtain the target encrypted image processed by the image encryption method in this embodiment, as well as the hash value of the corresponding compressed plaintext image and the external key.

[0093] The image encryption method is executed by the image sender, and the image decryption method is executed by the image receiver. In addition to sending the target encrypted image to the image receiver, the image sender also sends the hash value of the compressed plaintext image generated during the encryption process to the image receiver, and the external key can be provided to the image sender and the image receiver by an external system.

[0094] Step S220, based on the hash value of the compressed plaintext image and the external key, obtain the first chaotic sequence and the second chaotic sequence through the target chaotic map. Among them, the target chaotic map adopted is the same as the image encryption method.

[0095] Specifically, the target chaotic map is:

[0096]

[0097] Among them, a and b respectively represent the first parameter and the second parameter, x n and x n+1 respectively represent the first sequence values before and after the nth iteration, and multiple generations of the first sequence values form the first chaotic sequence, y n and y n+1 respectively represent the second sequence values before and after the nth iteration, and multiple generations of the second sequence values form the second chaotic sequence.

[0098] After obtaining 32 decimal hash values, the parameters and sequence initial values in the target chaotic map can be calculated in combination with the external key. In this embodiment, the determination formulas for a, b, x 0 and y 0 include:

[0099]

[0100] Among them, represents the bitwise exclusive OR calculation, h i represents the i-th decimal hash value, t 1 , t 2 , t 3 and t 4 are all external keys.

[0101] Step S230: Based on the first chaotic sequence and the second chaotic sequence, perform an inverse chaotic circular shift operation on the target encrypted image to obtain the initial decrypted image.

[0102] Through the two chaotic sequences, the shift matrix used in the image encryption process can be calculated, and then the corresponding pixel points can be reset based on each element in the shift matrix. Exemplarily, when the element in the first row and first column of the shift matrix is -5, it indicates that in the chaotic circular shift operation, the binary representation of the pixel in the first row and first column of the initial encrypted image is shifted left by 5 bits. Therefore, in the inverse chaotic circular shift operation, the binary representation of the pixel in the first row and first column of the initial decrypted image needs to be shifted right by 5 bits.

[0103] Step S240: Perform an inverse Arnold scrambling operation on the initial decrypted image to obtain the compressed plaintext image.

[0104] Through the two chaotic sequences, the Arnold scrambling parameters used in the image encryption process can also be calculated. After obtaining these scrambling parameters, the inverse process of Arnold scrambling can be performed to restore the compressed plaintext image.

[0105] Step S250: Decompress the compressed plaintext image after inverse quantization through the second deep learning network, and perform noise reduction on the decompression result through the third deep learning network to obtain the original plaintext image.

[0106] Inverse quantization refers to the inverse process of the quantization performed in the image encryption process.

[0107] Through the above inverse chaotic circular shift operation and inverse Arnold scrambling operation, the compressed plaintext image can be obtained from the target encrypted image. Since the compressed plaintext image is compressed through the first deep learning network, in this embodiment, the corresponding second deep learning network is used to decompress the compressed plaintext image.

[0108] Among them, the structure of the second deep learning network is symmetric to the structure of the first deep learning network. The number of neurons in the first layer is determined by SR, and the number of neurons in the second layer is 1024. Through the linear mapping of the two layers of neurons, the compressed vector can be extracted. When outputting, the output of the one-dimensional vector with a length of 1024 is converted into a 32×32 image block. It should be noted that in this embodiment, neither of these two networks uses an activation function nor a bias term.

[0109] Further, in order to improve the quality of image decompression, in this embodiment, the third deep learning network adopts a convolutional neural network, which is used to recover non-linear signals. Exemplarily, the third deep learning network consists of two convolutional blocks, and each convolutional block has three convolutional layers. In each block, the first convolutional layer uses a kernel of size 5×5 to generate 32 feature maps. The second layer generates 64 feature maps, and the convolutional kernel size is 3×3. The third layer uses a kernel of size 11×11 to generate 1 feature map. To accelerate convergence, improve stability and generalization ability, batch normalization is performed on the first two convolutional layers, and the Relu activation function is used. Each convolutional layer is padded so that the size of the generated feature map is equal to the size of the image block.

[0110] The above is the image decryption method provided in this embodiment, which is essentially the reverse process of the image encryption method in this embodiment. Specifically, reference can be made to the description of the image encryption method in this embodiment.

[0111] Based on the image encryption method and image decryption method provided in this embodiment, an image encryption and decryption method is also provided in this embodiment, including an encryption step executed by the first terminal and a decryption step executed by the second terminal.

[0112] The encryption step is the step of the image encryption method provided in this embodiment; the decryption step is the step of the image decryption method provided in this embodiment. Specifically, reference can be made to the above description of the image encryption method and image decryption method, and details are not described here again.

[0113] In the process of image encryption and decryption, the first deep learning network, the second deep learning network and the third deep learning network are required. In this embodiment, end-to-end joint training is performed on the first deep learning network and the second deep learning network. The compression and decompression processes are integrated into a network for training. In this case, the network optimizes the entire compression and decompression process through the backpropagation algorithm, enabling the network to learn how to retain the key features and details of the original image at a high compression rate. This end-to-end training method enables the network to automatically learn the optimal compression and decompression strategies and has high flexibility and adaptability. The first deep learning network and the second deep learning network combine the principles of structured sampling and optimization algorithms in compressive sensing, as well as the learning of effective features of massive data in deep learning, and train the network to learn efficient image compression and decompression to achieve higher compression rates and better reconstruction quality. The training process is described below through an example.

[0114] Exemplarily, considering the training progress, the same dataset of 91 images as Reconnet can be used. To reduce overfitting and improve the generalization ability of the model, data augmentation techniques are adopted to increase the training samples. Specifically, these 91 images are flipped vertically and horizontally, generating 182 different images. Subsequently, the training images are cropped into sub-images of 32×32 pixels with a stride of 16, resulting in 31,462 image patches.

[0115] The training process of the three deep learning networks is divided into two steps: one is the linear network training (the joint training of the first and second deep learning networks), and the other is the non-linear network training (the training of the third deep learning network). Both networks use the mean squared error (MSE) as the loss function. The Adam optimization algorithm is used to update the weights and biases of the network to minimize the MSE value. The ratio of the training set to the validation set is set to 8:2. For the linear network, end-to-end training is adopted, and the input and output of the network training are the same data. The maximum number of iterations and the batch size are set to 800 and 64 respectively. To accelerate the model's convergence to the optimal solution, a dynamic learning rate is used in training. The initial learning rate is 10^-4, and it decays by 1 / 10 every 350 iterations. For the non-linear network, the input is the output of the previous network. The maximum number of iterations and the batch size are set to 1000 and 256 respectively, the initial learning rate is 10^-4, and it decays by 1 / 10 every 300 iterations.

[0116] The networks are trained using the deep learning toolbox provided by MATLAB 2021b. All experiments are conducted on a desktop computer with an i5-12400F CPU and 32GB of memory, and the training is accelerated using an NVIDIA RTX 2060s.

[0117] From the above description, it can be seen that the image encryption method and image decryption provided in this embodiment have the following technical advantages.

[0118] 1. Fusion: Creatively fuse deep learning and chaos theory in an information encryption scheme. Utilize the powerful feature learning ability of the neural network to retain the original features of the compressed image to the greatest extent, and use the chaotic sequence to encrypt the compressed information. This not only greatly improves the running efficiency of the encryption process but also reduces the requirement for transmission bandwidth.

[0119] 2. The newly developed chaotic system 2D-CSHM: The newly proposed two-dimensional hyperchaotic system 2D-CSHM has a simple structure, a large chaotic range, and is easy to implement. As an index characterizing the degree of chaos of the system, a higher Lyapunov exponent means that the chaotic sequence generated by the system has a higher complexity, and has higher unpredictability and sensitivity, which can provide a larger key space and more complex chaotic sequences. Applying it to the image encryption process will have higher security.

[0120] 3. Using the principle of deep learning to compress images: In the process of image compression, traditional compression algorithms usually based on fixed transformation and coding methods often cause loss of image quality and generally have mediocre performance. While deep learning algorithms can adaptively adjust the compression strategy according to the image content, learn the details and texture information of the image, so as to better remove redundant information while maintaining a high recovery quality.

[0121] New encryption algorithm: The encryption key is obtained from the hash value of the image, which is used to control 2D-CSHM to generate high-performance chaotic pseudo-random sequences. The generation of the key is associated with the information of the compressed image, and this key associated with the image can effectively resist chosen-plaintext attacks. A new sliding Arnold scrambling algorithm is designed, where the parameters of each round of scrambling are no longer fixed, but directly controlled by the chaotic sequence generated by 2D-CSHM. In addition, in the diffusion process, the preprocessed chaotic sequence is used to perform random bit cyclic shifts on the pixel values, significantly improving the arrangement distribution of the pixel values of the compressed image. The experimental simulation results show that the encryption mechanism designed by combining 2D-CSHM with the encryption algorithm is more secure and can effectively prevent the illegal access and tampering of image data during transmission and storage.

[0122] Refer to Figure 5 , which is the example effect display diagram of the image encryption and decryption method provided in this embodiment. Figure 7 In (a), (b), (c) and (d) are different original plaintext images respectively, Figure 7 In part (e) is the corresponding compressed plaintext image, Figure 7 In part (f) is the corresponding target encrypted image, Figure 7 In part (g) is the decompressed compressed plaintext image, Figure 7 In part (h) is the decompressed original plaintext image, Figure 7 In part (i) is the denoised original plaintext image.

[0123] Based on the image encryption method in this embodiment, an image encryption device is also provided in this embodiment for implementing the corresponding image encryption method.

[0124] The image encryption device includes: an image compression module, a chaotic mapping module, an image scrambling module, and an image shifting module.

[0125] The image compression module is used to compress the original plaintext image through a first deep learning network and quantize the compression result to obtain a compressed plaintext image; wherein, the original plaintext image is input into the first deep learning model in blocks.

[0126] The chaotic mapping module is used to obtain a first chaotic sequence and a second chaotic sequence through a target chaotic mapping based on the hash value of the compressed plaintext image, and the target chaotic mapping is:

[0127]

[0128] wherein, a and b respectively represent a first parameter and a second parameter, x n and x n+1 respectively represent the first sequence values before and after the nth iteration, and multiple generations of the first sequence values form the first chaotic sequence, y n and y n+1 respectively represent the second sequence values before and after the nth iteration, and multiple generations of the second sequence values form the second chaotic sequence, and a, b, x 0 and y 0 are determined according to the hash value of the compressed plaintext image and an external key.

[0129] The image scrambling module is used to perform Arnold scrambling on the compressed plaintext image to obtain an initial encrypted image.

[0130] The image shifting module is used to perform chaotic circular shift processing on the initial encrypted image based on the first chaotic sequence and the second chaotic sequence to obtain a target encrypted image.

[0131] It should be noted that the above-mentioned each module can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module can be located in the same processor; or the above-mentioned each module can also be located in different processors in any combined form.

[0132] In this embodiment, an encryption device is further provided, which includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the image encryption method provided in this embodiment.

[0133] It should be understood that the specific embodiments described here are only used to explain this application, rather than to limit it. According to the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0134] Obviously, the accompanying drawings are only some examples or embodiments of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations based on these drawings without creative efforts. Additionally, it can be understood that although the work done during this development process may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in the present application are only conventional technical means and should not be regarded as insufficient disclosure of the present application.

Claims

1. An image encryption method, characterized in that: include: The original plaintext image is compressed by a first deep learning network and the compression result is quantified to obtain a compressed plaintext image; wherein the original plaintext image is input into the first deep learning model in blocks; Based on the hash value of the compressed plaintext image, the first chaotic sequence and the second chaotic sequence are obtained through the target chaotic mapping. The target chaotic mapping is: Among them, a and b represent the first parameter and the second parameter respectively, x n and x n+1 Respectively represent the first sequence values ​​before and after the nth iteration. Multiple generations of first sequence values ​​constitute the first chaotic sequence. n and n+1 They represent the second sequence values ​​before and after the nth iteration respectively. Multiple generations of second sequence values ​​constitute the second chaotic sequence. a, b, x0 and y0 are determined according to the hash value of the compressed plaintext image and the external key. Perform Arnold scrambling on the compressed plaintext image to obtain the initial encrypted image; Based on the first chaotic sequence and the second chaotic sequence, the initial encrypted image is subjected to chaotic circular shift processing to obtain a target encrypted image.

2. The image encryption method according to claim 1, characterized in that: The steps to calculate the hash value of a compressed plaintext image include: Add random noise to the compressed plaintext image and use the SHA-256 hash function to calculate the 256-bit binary hash value of the compressed plaintext image; Convert the 256-bit binary hash value to a 32-bit decimal hash value.

3. The image encryption method according to claim 2, characterized in that: The formulas for determining a, b, x0, and y0 include: in, Indicates bitwise XOR calculation, h i Represents the ith decimal hash value, where t1, t2, t3, and t4 are all external keys.

4. The image encryption method according to claim 1, characterized in that: Arnold scrambling is sliding Arnold scrambling. Sliding Arnold scrambling uses different scrambling parameters in each generation of scrambling. The formula for determining the scrambling parameters of each generation is: A i =floor(l 2i-1 ×2 16 mod16) B i =floor(l 2i ×2 16 mod16) Among them, A i and B i denote the scrambling parameters of the i-th generation, l 2i-1 ×2 16 mod16 means the 2i-1th sequence value in the chaotic sequence is equal to 2 16 The remainder of the product divided by 16 is l 2i ×2 16 mod16 means the 2ith sequence value in the chaotic sequence is equal to 2 16 The remainder when the product of is divided by 16. Floor represents the floor function.

5. The image encryption method according to claim 1, characterized in that: The first chaotic sequence determines the step length of the chaotic circular cyclic shift, and the second chaotic sequence determines the direction of the chaotic circular cyclic shift.

6. The image encryption method according to claim 5, characterized in that: Based on the first chaotic sequence and the second chaotic sequence, a chaotic circular shift process is performed on the initial encrypted image to obtain a target encrypted image, including: Generate a shift matrix that matches the number of pixels of the initial encrypted image. The value and direction of each element in the shift matrix are determined by the first chaotic sequence and the second chaotic sequence respectively: According to each element in the shift matrix, the binary representation of the corresponding pixel in the initial encrypted image is subjected to circular cyclic shift processing to obtain the target encrypted image.

7. An image decryption method, characterized in that: include: Obtaining a target encrypted image obtained by processing the image encryption method according to any one of claims 1 to 6 and a hash value and an external key of a corresponding compressed plaintext image; Based on the hash value of the compressed plaintext image and the external key, a first chaotic sequence and a second chaotic sequence are obtained through a target chaotic mapping; Based on the first chaotic sequence and the second chaotic sequence, the target encrypted image is subjected to inverse chaotic circular shift processing to obtain an initial decrypted image; Perform inverse Arnold scrambling on the initial decrypted image to obtain a compressed plaintext image; The compressed plaintext image after inverse quantization is decompressed through the second deep learning network, and the decompression result is denoised through the third deep learning network to obtain the original plaintext image.

8. An image encryption and decryption method, characterized in that: comprising an encryption step performed by a first terminal and a decryption step performed by a second terminal; The encryption steps include: The original plaintext image is compressed by a first deep learning network and the compression result is quantified to obtain a compressed plaintext image; wherein the original plaintext image is input into the first deep learning model in blocks; Based on the hash value of the compressed plaintext image, the first chaotic sequence and the second chaotic sequence are obtained through the target chaotic mapping. The target chaotic mapping is: Among them, a and b represent the first parameter and the second parameter respectively, x n and x n+1 Respectively represent the first sequence values ​​before and after the nth iteration. Multiple generations of first sequence values ​​constitute the first chaotic sequence. n and n+1 They represent the second sequence values ​​before and after the nth iteration respectively. Multiple generations of second sequence values ​​constitute the second chaotic sequence. a, b, x0 and y0 are determined according to the hash value of the compressed plaintext image and the external key. Perform Arnold scrambling on the compressed plaintext image to obtain the initial encrypted image; Based on the first chaotic sequence and the second chaotic sequence, a chaotic circular shift process is performed on the initial encrypted image to obtain a target encrypted image; The decryption steps include: Based on the hash value of the compressed plaintext image and the external key, a first chaotic sequence and a second chaotic sequence are obtained through a target chaotic mapping; Based on the first chaotic sequence and the second chaotic sequence, the target encrypted image is subjected to inverse chaotic circular shift processing to obtain an initial decrypted image; Perform inverse Arnold scrambling on the initial decrypted image to obtain a compressed plaintext image; The compressed plaintext image after inverse quantization is decompressed by the second deep learning network, and the decompression result is denoised by the third deep learning network to obtain the original plaintext image; The first deep learning network and the second deep learning network are trained end-to-end jointly.

9. An image encryption device, characterized in that: include: An image compression module, used to compress the original plaintext image through the first deep learning network and quantize the compression result to obtain a compressed plaintext image; wherein the original plaintext image is input into the first deep learning model in blocks; The chaotic mapping module is used to obtain the first chaotic sequence and the second chaotic sequence through the target chaotic mapping based on the hash value of the compressed plaintext image. The target chaotic mapping is: Among them, a and b represent the first parameter and the second parameter respectively, x n and x n+1 Respectively represent the first sequence values ​​before and after the nth iteration. Multiple generations of first sequence values ​​constitute the first chaotic sequence. n and n+1 They represent the second sequence values ​​before and after the nth iteration respectively. Multiple generations of second sequence values ​​constitute the second chaotic sequence. a, b, x0 and y0 are determined according to the hash value of the compressed plaintext image and the external key. An image scrambling module is used to perform Arnold scrambling on the compressed plaintext image to obtain an initial encrypted image; The image shift module is used to perform chaotic circular shift processing on the initial encrypted image based on the first chaotic sequence and the second chaotic sequence to obtain the target encrypted image.

10. An encryption device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the image encryption method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image encryption method and device based on novel two-dimensional composite chaotic mapping and SHA-256

    CN113538203A

  • Video stream parallel chaotic encryption method based on key frame and image compression

    CN116488792A

  • Image encryption method and device, terminal and storage medium

    CN117527182A

  • Image encryption and decryption method based on dynamic compressed sensing

    CN119835372A