Image encryption method, device and equipment, image decryption method

This image encryption method, which combines deep learning network compression and two-dimensional chaotic mapping, solves the problem that existing technologies fail to simultaneously achieve image compression and encryption, enabling efficient image encryption and decryption processes and improving security performance.

CN120050366BActive Publication Date: 2026-05-29ANHUI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI UNIV
Filing Date
2025-02-21
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing image encryption methods fail to simultaneously consider image compression and encryption, resulting in insufficient chaotic performance, small control key space, and narrow and discontinuous parameter range.

Method used

The original plaintext image is compressed using a deep learning network. The first and second chaotic sequences of the two-dimensional chaotic map are generated by hash value. Encryption is performed by combining Arnold scrambling and chaotic circular shift processing. Decryption is performed using an end-to-end trained deep learning network.

Benefits of technology

It improves the chaos performance and security of image encryption, increases the key space, making it difficult to crack, and achieves a high-efficiency combination of image compression and encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050366B_ABST
    Figure CN120050366B_ABST
Patent Text Reader

Abstract

The application relates to an image encryption method, device and equipment, and an image decryption method, wherein the image encryption method comprises the following steps: compressing an original plaintext image through a first deep learning network to obtain a compressed plaintext image; obtaining a first chaotic sequence and a second chaotic sequence through a target chaotic mapping based on a hash value of the compressed plaintext image; performing Arnold scrambling processing on the compressed plaintext image to obtain an initial encrypted image; and performing chaotic circular cyclic shift processing on the initial encrypted image based on the first chaotic sequence and the second chaotic sequence to obtain a target encrypted image. The image encryption method in the application efficiently combines deep learning compression and image encryption, the chaotic system adopted by the image encryption method has higher chaotic performance, and the image encryption method has higher security performance and is more difficult to be cracked, thereby solving the problem that current image encryption methods cannot simultaneously consider image compression and encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data encryption and decryption, and in particular to an image encryption method, apparatus and device, and an image decryption method. Background Technology

[0002] Digital images, as an important information carrier, play an irreplaceable role in data transmission. However, with the widespread use of the internet and the rapid development of network technology, the use and transmission of digital images are increasing, posing significant challenges to image security and confidentiality, and creating a growing demand for efficient image transmission and storage. Therefore, it is essential to consider both image compression and encryption during information transmission.

[0003] Furthermore, current image encryption methods typically employ one-dimensional discrete chaotic mapping. However, due to the limited number of parameters in one-dimensional discrete chaotic mapping, the generated control key space is small, and the parameter range of chaotic behavior is narrow and discontinuous, thereby reducing the chaotic performance of image encryption.

[0004] There is currently no effective solution to the problem that current image encryption methods fail to simultaneously address image compression and encryption. Summary of the Invention

[0005] This invention provides an image encryption method, apparatus, and device, as well as an image decryption method, to solve the problem that current image encryption methods fail to simultaneously consider image compression and encryption.

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

[0007] The original plaintext image is compressed using 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 as follows:

[0009]

[0010] Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 These 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 based on the hash value of the compressed plaintext image and the external key.

[0011] The compressed plaintext image is scrambled using Arnold to obtain the initial encrypted image.

[0012] Based on the first and second chaotic sequences, the initial encrypted image is subjected to chaotic circular cyclic shifting to obtain the target encrypted image.

[0013] Secondly, this invention provides an image decryption method, comprising:

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

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

[0016] Based on the first and second chaotic sequences, the target encrypted image is subjected to inverse chaotic circular shifting to obtain the initial decrypted image.

[0017] The initial decrypted image is subjected to inverse Arnold scrambling to obtain a compressed plaintext image;

[0018] The compressed plaintext image is decompressed using a second deep learning network, and the original plaintext image is obtained by denoising the decompression result using a third deep learning network.

[0019] Thirdly, the present invention provides an image encryption / decryption method, including an encryption step performed by a first terminal and a decryption step performed by a second terminal;

[0020] The encryption steps include:

[0021] The original plaintext image is compressed using a first deep learning network, and the compression result is quantized 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, the first chaotic sequence and the second chaotic sequence are obtained through the target chaotic mapping. The target chaotic mapping is as follows:

[0023]

[0024] Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1These 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 based on the hash value of the compressed plaintext image and the external key.

[0025] The compressed plaintext image is scrambled using Arnold to obtain the initial encrypted image.

[0026] Based on the first and second chaotic sequences, the initial encrypted image is subjected to chaotic circular cyclic shifting 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, the first chaotic sequence and the second chaotic sequence are obtained through target chaotic mapping;

[0029] Based on the first and second chaotic sequences, the target encrypted image is subjected to inverse chaotic circular shifting to obtain the initial decrypted image.

[0030] The initial decrypted image is subjected to inverse Arnold scrambling to obtain a compressed plaintext image;

[0031] The decompressed plaintext image after inverse quantization is decompressed using a second deep learning network, and the original plaintext image is obtained by denoising the decompression result using a third deep learning network.

[0032] The first deep learning network and the second deep learning network are jointly trained end-to-end.

[0033] Fourthly, this invention provides an image encryption device, comprising:

[0034] 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;

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

[0036]

[0037] Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1These 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 based on the hash value of the compressed plaintext image and the external key.

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

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

[0040] Fifthly, the present invention provides an encryption device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the image encryption method described in the first aspect.

[0041] Compared with related technologies, this invention provides an image encryption method, the main process of which includes: firstly, compressing the original plaintext image through a first deep learning network to obtain a compressed plaintext image, specifically by inputting the original plaintext image into the first deep learning network in blocks, and quantizing the compression result to better connect to subsequent image encryption; then calculating the hash value of the compressed plaintext image, and obtaining a first chaotic sequence and a second chaotic sequence based on the hash value through a two-dimensional target chaotic mapping; then, performing sliding Arnold scrambling and chaotic circular shift processing on the compressed plaintext image based on the two chaotic sequences, finally obtaining the target encrypted image. Therefore, the image encryption method in this invention efficiently combines deep learning compression and image encryption, and the chaotic system used in this image encryption method has higher chaotic performance, thus possessing higher security performance and being more difficult to crack, solving the problem that current image encryption methods fail to simultaneously consider image compression and encryption.

[0042] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

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

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

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

[0046] Figure 4This is a diagram showing the Lyapunov exponent variation of the target chaotic mapping provided in this embodiment as parameter a changes continuously;

[0047] Figure 5 This is a graph showing the Lyapunov exponent variation of the target chaotic mapping provided in this embodiment as parameter b changes continuously;

[0048] Figure 6 This is a schematic diagram of the chaotic circular cyclic shift provided in this embodiment;

[0049] Figure 7 This is a schematic diagram illustrating the effect of the image encryption / decryption method provided in this embodiment. Detailed Implementation

[0050] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0051] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.

[0052] This embodiment provides an image encryption method. (Refer to...) Figure 1 and Figure 2 The process includes steps S110, S120, S130 and S110.

[0053] Step S110: The original plaintext image is compressed using a first deep learning network, and the compression result is quantized 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 neural network with no bias term. It receives 32×32 image patches as input and outputs a 1×(SR×1024) one-dimensional CS measurement, 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 the fully connected 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 input features. The second fully connected layer has an input dimension of 1×1024 and an output dimension of 1×(SR×1024). The role of this fully connected layer is to further compress the input one-dimensional vector, reducing the dimension to a factor of SR.

[0055] As can be seen from the above example, the image compression process mainly utilizes compressed sensing theory to perform CS sampling on an initial plaintext image of size M×M. Specifically, it includes steps S111, S112, and S113.

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

[0057] Step S112, Image Blocking: Divide the n1 original plaintext images into n2 image blocks of size BS×BS; where n2=n1×(M / BS) 2 .

[0058] Step S113, image compression. The compression process can be represented as:

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

[0060] Among them, A i This represents the i-th image patch of size BS×BS, where B i A represents i The size is (BS) 2 The compressed value of (×SR)×1. To perform the compression function, this embodiment uses a fully connected layer without bias terms as the image compression network (first deep learning network), which has the same function as the compression matrix.

[0061] Step S114, Quantization. To ensure the integrity and reliability of the compressed data during processing and to 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:

[0062]

[0063] Where B represents the compressed value matrix of all image patches output by the first deep learning network, min and max represent the minimum and maximum compressed values ​​in B, floor and reshape represent the floor function and reshape function, respectively, and C represents the quantized B, i.e. 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 mapping. The target chaotic mapping is as follows:

[0065]

[0066] Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 These 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 based on the hash value of the compressed plaintext image and the external key.

[0067] The aforementioned target chaotic mapping is a two-dimensional chaotic mapping, which exhibits strong chaotic properties. (Refer to...) Figure 4 This indicates that there are two positive Lyapunov exponents when the parameter 'a' changes continuously in the target chaotic mapping. (Refer to...) Figure 5 This indicates that the target chaotic map has two positive Lyapunov exponents when the parameter b changes continuously. Both show that the target chaotic map has obvious hyperchaotic properties, that is, it is hyperchaotic over a continuous large range, which can provide more complex chaotic sequences and a larger key space, thereby increasing the security of encryption algorithms or schemes.

[0068] In this step, the hash value of the compressed plaintext image needs to be calculated first. In this embodiment, the calculation steps for the hash value of the compressed plaintext image include: adding random noise to the compressed plaintext image, 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, converting every 8 bits into a decimal number between 0 and 255, and representing the 32 decimal numbers as h1, h2, ..., h 31 and h 32 After obtaining the 32 decimal hash values, the parameters and initial values ​​of the sequence in the target chaotic map can be calculated using the external key. In this embodiment, the formulas for determining a, b, x0, and y0 include:

[0069]

[0070] in, h represents bitwise XOR calculation. i t1 represents the i-th decimal hash value, where t1, t2, t3, and t4 are all external keys.

[0071] Step S130: Perform Arnold scrambling on the compressed plaintext image to obtain the initial encrypted image. Arnold scrambling involves randomly shuffling the positions of each pixel in the image through multiple iterations, using two scrambling parameters. In traditional Arnold scrambling, the scrambling parameters are the same in each round. In this embodiment, to further improve encryption strength, the scrambling parameters used in each round are updated. Specifically, Arnold scrambling is a sliding Arnold scrambling method, which uses different scrambling parameters in each iteration. The formula for determining the scrambling parameters for each iteration is as follows:

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

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

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

[0075] The unpredictability and high randomness of chaotic sequences give them excellent encryption performance. Using chaotic sequences to generate parameters in the Arnold transform iteration can improve the security of encryption algorithms and make it more difficult for attackers to crack 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 is obtained, which is a 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 shifting on the initial encrypted image to obtain the target encrypted image.

[0078] This step involves re-encrypting the initially encrypted image. Circular cyclic shifting is a process of circularly shifting the binary representation of each pixel's value in the image. Two key parameters are the shift step size and the shift direction. For example, if the binary representation of a pixel value is 100101, shifting it two steps to the left results in 010110. This means all values ​​are shifted two bits to the left, with the leftmost two bits filling the rightmost two bits, creating a continuous shift effect, hence the name circular cyclic shift.

[0079] In this embodiment, step S140 specifically includes: generating a shift matrix that matches the number of pixels in the initial encrypted image, wherein the value and direction of each element in the shift matrix are determined by a first chaotic sequence and a second chaotic sequence, respectively; and performing circular cyclic shift processing on the binary representation of the corresponding pixel in the initial encrypted image according to each element in the shift matrix 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 size of the corresponding pixel by its numerical value and the shift direction of the corresponding pixel by its 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 example will provide a detailed explanation of steps S120, S130, and S140.

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

[0082] Chaotic sequence generation: Using the calculated keys a, b, x0, and y0, 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). The first 2000 numbers of the completed sequence are discarded to counteract the transient effects of the chaotic system.

[0083] Sliding Arnold Scrambling: A sliding Arnold scrambling process is performed on the compressed plaintext image. The number of encryption rounds is set to L, and the scrambling parameters for each sliding Arnold scrambling are controlled by a chaotic sequence of length L. It should be noted that in this example, two chaotic sequences, one of length M×M and the other of length L, are used for chaotic circular shifting and sliding Arnold scrambling, respectively. Of course, this distinction can also be ignored, and the same chaotic sequence can be used for both parts.

[0084] Chaotic Circular Cyclic Shift: This involves performing a pixel-level random left-right cyclic shift on an 8-bit image (in this example, pixels are represented by 8 bits in binary; however, pixel representation can also use more or fewer bits). The length and direction of the shift are determined by an M×M matrix CONT (shift matrix), which 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 y represents the local sequence formed by the (L+1)th to (M×M+L+1)th sequence values ​​in the first chaotic sequence. L+1:M×M+L+1 Let represent the local sequence consisting of the (L+1)th to (M×M+L+1)th sequence values ​​in the second chaotic sequence. Let abs represent the absolute value function, mod represent the modulo function, floor represent the floor function, and mean represent the average value function. The first formula above shows the process of determining the values ​​of each element in CONT, which is based on the corresponding sequence values ​​in the first chaotic sequence. The second formula above shows the process of determining the sign of each element in CONT, which is based on the corresponding sequence values ​​in the second chaotic sequence. When a sequence value in the second chaotic sequence is greater than y... L+1:M×M+L+1 If the average value is found, the corresponding element in CONT is positive; otherwise, it is negative.

[0088] Using the above formula, each element of CONT falls within the range of [-7, 7], resulting in a total of 15 possible circular shifts. For example, refer to... Figure 6When the second element of a row in CONT is 1, the binary representation of the second pixel value 140 in the corresponding row of the initial encrypted image is shifted one bit to the right to become 70; when the ninth element of a row in CONT is -2, the binary representation of the ninth pixel value 98 in the corresponding row of the initial encrypted image is shifted two bits to the left to become 137.

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

[0090] As described above, this embodiment provides an image encryption method, the main process of which includes: firstly, compressing the original plaintext image through a first deep learning network to obtain a compressed plaintext image (existing technologies do not incorporate deep learning compression into image encryption), and inputting the original plaintext image into the first deep learning network in blocks, and quantizing the compression result to obtain the compressed plaintext image in order to better connect with subsequent image encryption; then calculating the hash value of the compressed plaintext image, and obtaining a first chaotic sequence and a second chaotic sequence based on the hash value through a two-dimensional target chaotic mapping (existing technologies usually use a one-dimensional chaotic mapping), and then performing sliding Arnold scrambling processing (existing technologies use fixed scrambling parameters) and chaotic circular cyclic shift processing (existing technologies use only one set of chaotic sequences to generate the shift step size) on the compressed plaintext image based on the two chaotic sequences, finally obtaining the target encrypted image. Therefore, the image encryption method in this embodiment efficiently combines deep learning compression and image encryption. Moreover, the chaotic system used in this image encryption method has higher chaotic performance, thus possessing higher security performance and being more difficult to crack, solving the problem that current image encryption methods fail to simultaneously consider image compression and encryption.

[0091] Based on the above image encryption method, this embodiment also provides a corresponding image decryption method, which is essentially the reverse of the image encryption process. (Refer to...) Figure 3 The image decryption method provided in this embodiment includes steps S210, S220, S230, S240, S250 and S260.

[0092] Step S210: Obtain the hash value and external key of the target encrypted image and the corresponding compressed plaintext image obtained by the image encryption method in this embodiment.

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

[0094] Step S220: 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. The target chaotic mapping used is the same as the image encryption method.

[0095] Specifically, the target chaos mapping is as follows:

[0096]

[0097] Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 and represent the second sequence values ​​before and after the nth iteration, respectively. Multiple generations of second sequence values ​​constitute the second chaotic sequence.

[0098] After obtaining 32 decimal hash values, the parameters and initial values ​​of the sequence in the target chaotic mapping can be calculated using the external key. In this embodiment, the formulas for determining a, b, x0, and y0 include:

[0099]

[0100] in, h represents bitwise XOR calculation. i t1 represents the i-th decimal hash value, where t1, t2, t3, and t4 are all external keys.

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

[0102] By using two chaotic sequences, the shift matrix used in the image encryption process can be calculated. Then, the corresponding pixels can be reset based on each element in the shift matrix. For example, if the element in the first row and first column of the shift matrix is ​​-5, it means that in the chaotic circular shift process, the binary representation of the first row and first column of the initial encrypted image is shifted left by 5 bits. Therefore, in the inverse chaotic circular shift process, the binary representation of the first row and first column of the initial decrypted image needs to be shifted right by 5 bits.

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

[0104] By using two chaotic sequences, the Arnold scrambling parameters used in the image encryption process can be calculated simultaneously. Once these scrambling parameters are obtained, the inverse process of Arnold scrambling can be executed to restore the compressed plaintext image.

[0105] Step S250: Decompress the inverse-quantized compressed plaintext image using a second deep learning network, and denoise the decompression result using a third deep learning network to obtain the original plaintext image.

[0106] Inverse quantization refers to the reverse process of quantization during image encryption.

[0107] Through the aforementioned inverse chaotic circular shifting and inverse Arnold scrambling processes, a compressed plaintext image can be obtained from the target encrypted image. Since the compressed plaintext image is obtained through compression using a first deep learning network, this embodiment employs a corresponding second deep learning network to decompress the compressed plaintext image.

[0108] The structure of the second deep learning network is symmetrical to that of the first deep learning network. The number of neurons in the first layer is determined by the SR (Synchronous Reduction) function, and the number of neurons in the second layer is 1024. A compressed vector can be extracted through a linear mapping between the two layers of neurons. At output, the output of the 1024-length one-dimensional vector is converted into 32×32 image patches. It is worth noting that neither network in this embodiment uses activation functions or bias terms.

[0109] Furthermore, to improve the quality of image decompression, in this embodiment, the third deep learning network employs a convolutional neural network for recovering nonlinear signals. Exemplarily, the third deep learning network consists of two convolutional blocks, each with three convolutional layers. In each block, the first convolutional layer uses a 5×5 kernel to generate 32 feature maps. The second layer generates 64 feature maps with a 3×3 kernel. The third layer generates one feature map using an 11×11 kernel. To accelerate convergence and improve stability and generalization, the first two convolutional layers are batch normalized and use the ReLU activation function. 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. For details, please refer to the description of the image encryption method in this embodiment.

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

[0112] The encryption steps are those of the image encryption method provided in this embodiment; the decryption steps are those of the image decryption method provided in this embodiment. Specifically, please refer to the above descriptions of the image encryption and decryption methods, which will not be repeated here.

[0113] In the process of image encryption and decryption, a first deep learning network, a second deep learning network, and a third deep learning network are required. This embodiment employs end-to-end joint training of the first and second deep learning networks. The compression and decompression processes are integrated into a single network for training. In this case, the network optimizes the entire compression and decompression process through backpropagation, enabling it to learn how to preserve key features and details of the original image at high compression rates. This end-to-end training method allows the network to automatically learn optimal compression and decompression strategies, exhibiting high flexibility and adaptability. The first and second deep learning networks combine the principles of structured sampling and optimization algorithms in compressed sensing with the learning of effective features from massive amounts of data in deep learning, training the networks to learn efficient image compression and decompression techniques to achieve higher compression rates and better reconstruction quality. The training process is illustrated below with an example.

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

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

[0116] The network was trained using the Deep Learning Toolbox provided in MATLAB 2021b. All experiments were conducted on a desktop computer with an i5-12400F CPU and 32GB of memory, and training was accelerated using an NVIDIA RTX 2060s.

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

[0118] 1. Fusion: This innovative approach integrates deep learning and chaos theory into a single information encryption scheme. Leveraging the powerful feature learning capabilities of neural networks, it preserves the original features of the compressed image to the greatest extent possible, and uses chaotic sequences to encrypt the compressed information. This not only significantly improves the efficiency of the encryption process but also reduces the required transmission bandwidth.

[0119] 2. Developed Novel Chaotic System 2D-CSHM: The newly proposed two-dimensional hyperchaotic system 2D-CSHM is simple to construct, has a large chaotic range, and is easy to implement. The Lyapunov exponent, as an indicator of the degree of chaos in a system, signifies that the chaotic sequences generated by the system are more complex, exhibit higher unpredictability and sensitivity, and can provide a larger key space and more complex chaotic sequences. Applying it to image encryption processes would result in higher security.

[0120] 3. Using deep learning principles for image compression: In the image compression process, traditional compression algorithms are usually based on fixed transformation and encoding methods, which often results in image quality loss and mediocre performance. Deep learning algorithms, on the other hand, can adaptively adjust the compression strategy according to the image content, learning the details and texture information of the image, thereby maintaining high restoration quality while better removing redundant information.

[0121] A novel encryption algorithm is proposed: The encryption key is derived from the hash value obtained from the image and used to control the generation of a high-performance chaotic pseudo-random sequence by 2D-CSHM. The key generation is associated with information in the compressed image, and this image-associated key effectively resists chosen-plaintext attacks. A new sliding Arnold scrambling algorithm is designed, where the parameters for each round of scrambling are no longer fixed but directly controlled by the chaotic sequence generated by 2D-CSHM. Furthermore, the diffusion process uses a pre-processed chaotic sequence to perform random bit cyclic shifts on pixel values, significantly improving the permutation and distribution of pixel values ​​in the compressed image. Experimental simulation results show that the encryption mechanism designed by combining 2D-CSHM with the encryption algorithm is more secure and effectively prevents unauthorized access and tampering of image data during transmission and storage.

[0122] Reference Figure 5 This is an example illustration of the image encryption / decryption method provided in this embodiment. Figure 7 Images (a), (b), (c), and (d) are different original plaintext images. Figure 7 The middle (e) section contains the corresponding compressed plaintext image. Figure 7 The middle (f) section contains the corresponding target encrypted image. Figure 7 The middle (g) part is the decrypted compressed plaintext image. Figure 7 The middle (h) section contains the original plaintext image after decompression. Figure 7 The middle (i) part is the original plaintext image after noise reduction.

[0123] Based on the image encryption method in this embodiment, this embodiment also provides an image encryption device 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 based on the hash value of the compressed plaintext image through a target chaotic mapping. The target chaotic mapping is as follows:

[0127]

[0128] Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 These 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 based on the hash value of the compressed plaintext image and the external key.

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

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

[0131] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0132] This embodiment also provides an encryption device, including a memory and a processor. The memory stores a computer program, 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 herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0134] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

Claims

1. An image encryption method, characterized in that, include: The original plaintext image is compressed using a first deep learning network, and the compression result is quantized to obtain a compressed plaintext image; wherein, the original plaintext image is input into the first deep learning network 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 as follows: Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 These 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 based on the hash value of the compressed plaintext image and the external key. The compressed plaintext image is scrambled using Arnold to obtain the initial encrypted image. Based on the first and second chaotic sequences, the initial encrypted image is subjected to chaotic circular cyclic shifting to obtain the target encrypted image.

2. The image encryption method according to claim 1, characterized in that, The steps for calculating the hash value of a compressed plaintext image include: Random noise is added to the compressed plaintext image, and the SHA-256 hash function is used to calculate the 256-bit binary hash value of the compressed plaintext image; Convert the 256-bit binary hash value into 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, h represents bitwise XOR calculation. i t1 represents the i-th 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 a sliding Arnold scrambling method. Sliding Arnold scrambling uses different scrambling parameters in each generation of scrambling. The formula for determining the scrambling parameters in each generation is as follows: A i =floor(l 2i-1 ×2 16 mod16) B i =floor(l 2i ×2 16 mod16) Among them, A i and B i Let l represent the scrambling parameters of the i-th generation, respectively. 2i-1 ×2 16 mod16 represents the sequence value of the (2i-1)th element in the chaotic sequence and 2. 16 The remainder when the product is divided by 16, l 2i ×2 16 mod16 represents the relationship between the 2i-th sequence value and 2 in the chaotic sequence. 16 The remainder when the product 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 size of the chaotic circular shift, and the second chaotic sequence determines the direction of the chaotic circular shift.

6. The image encryption method according to claim 5, characterized in that, Based on the first and second chaotic sequences, the initial encrypted image is subjected to chaotic circular cyclic shifting to obtain the target encrypted image, including: A shift matrix is ​​generated that matches the number of pixels in 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. The target encrypted image is obtained by performing circular cyclic shifting on the binary representation of the corresponding pixel in the initial encrypted image based on each element in the shift matrix.

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

8. An image encryption / decryption method, characterized in that, This includes encryption steps performed by the first terminal and decryption steps performed by the second terminal; The encryption steps include: The original plaintext image is compressed using a first deep learning network, and the compression result is quantized to obtain a compressed plaintext image; wherein, the original plaintext image is input into the first deep learning network 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 as follows: Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 These 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 based on the hash value of the compressed plaintext image and the external key. The compressed plaintext image is scrambled using Arnold to obtain the initial encrypted image. Based on the first and second chaotic sequences, the initial encrypted image is subjected to chaotic circular cyclic shifting to obtain the target encrypted image. The decryption steps include: Based on the hash value of the compressed plaintext image and the external key, the first chaotic sequence and the second chaotic sequence are obtained through target chaotic mapping; Based on the first and second chaotic sequences, the target encrypted image is subjected to inverse chaotic circular shifting to obtain the initial decrypted image. The initial decrypted image is subjected to inverse Arnold scrambling to obtain a compressed plaintext image; The decompressed plaintext image after inverse quantization is decompressed using a second deep learning network, and the original plaintext image is obtained by denoising the decompression result using a third deep learning network. The first deep learning network and the second deep learning network are jointly trained end-to-end.

9. An image encryption device, characterized in that, include: 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 network in blocks; The chaotic mapping module is used to obtain a first chaotic sequence and a second chaotic sequence based on the hash value of the compressed plaintext image through a target chaotic mapping. The target chaotic mapping is as follows: Where a and b represent the first and second parameters, respectively, x n and x n+1 These represent the first sequence values ​​before and after the nth iteration, respectively. Multiple iterations of these first sequence values ​​constitute the first chaotic sequence. n and y n+1 These 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 based on the hash value of the compressed plaintext image and the external key. The image scrambling module is used to perform Arnold scrambling on compressed plaintext images to obtain an initial encrypted image. The image shifting module is used to perform chaotic circular cyclic shifting 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, The memory stores a computer program, and the processor is configured to run the computer program to perform the image encryption method according to any one of claims 1 to 6.