Image encryption method and device based on spatiotemporal chaotic system, equipment and medium

Through the image encryption method based on the spatiotemporal chaotic system, the image is disorganized locally and globally, solving the problem of no association between keys and plaintext and low security in the prior art, and achieving efficient and secure image encryption.

CN120408668APending Publication Date: 2025-08-01WUXI WINGTECH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510498752.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the existing image encryption algorithm, the key and plaintext images are not related, they are easily deciphered by attacks, and the overall encryption method is relatively low in security.

Method used

The image encryption method based on the space-time chaos system is adopted, and the key array is generated through the hash algorithm, and the space-time chaos system is input to generate chaotic and diffusion parameters. The face and background images are partially chaotic and diffusion processing are performed, and the encrypted images are generated by combining local and global chaotics.

Benefits of technology

It improves the security and efficiency of image encryption, ensures that the key is closely connected to plain text, and enhances the security and encryption efficiency of facial information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408668A_ABST
    Figure CN120408668A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image encryption based on a spatiotemporal chaotic system, and provides an image encryption method and device based on the spatiotemporal chaotic system, equipment and a medium, and the method comprises the steps: generating a key array based on a to-be-processed image, inputting the key array into the spatiotemporal chaotic system, and obtaining a scrambling parameter and a diffusion parameter, performing local scrambling processing on the face image and the background image based on the scrambling parameter, and performing diffusion processing on the image pixel matrix after local scrambling based on the diffusion parameter; and performing fusion processing on the image pixel matrix after diffusion processing to obtain a fused image pixel matrix, and performing global scrambling to obtain an encrypted image. The technical problem that existing image encryption is low in safety and efficiency is solved, a secret key is generated based on a to-be-processed image and input into a spatio-temporal chaotic system to generate disturbance and confusion factors for image encryption, tight connection of the secret key and a plaintext and uniqueness of the secret key are guaranteed, and the image encryption efficiency is improved by combining local scrambling and global scrambling modes. And the security of the face information and the encryption efficiency are further ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image processing, and in particular to an image encryption method, device, equipment and medium based on a spatio-temporal chaotic system. Background Technique

[0002] With the booming development of big data processing technology, the amount of information transmitted on the Internet is constantly expanding, and the forms of transmitted information are becoming more and more diverse. As one of the most commonly used carriers of personal information data, users expect to be able to protect sensitive and critical personal information. However, the high degree of sharing and openness of network platforms pose a certain threat to the security of personal information. Therefore, the research on image security and confidentiality has attracted the attention of many scholars. The research of cryptography is particularly important in the field of information security, especially in the case of the high degree of sharing and openness of personal information on the Internet. By strengthening the research of technical means such as cryptography, it helps to improve the security of personal information during transmission and storage to cope with potential risks in cyberspace.

[0003] In related technologies, the key in the encryption algorithm has nothing to do with the plaintext image, so that a special image can be used, and then the encrypted image can be damaged by using a plaintext attack to break the encryption algorithm; in addition, in image encryption, the image is usually encrypted without distinction as a whole, and the security is relatively low. Summary of the Invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an image encryption method, device, equipment and medium based on a spatio-temporal chaotic system.

[0005] The present application provides an image encryption method based on a spatio-temporal chaotic system, the method includes: obtaining an image to be processed, and inputting the image to be processed into a preset hash algorithm for processing to generate a key array; inputting the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; performing a separation process on the image to be processed to obtain a face image and a background image, and respectively performing local scrambling processing on the face image and the background image based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; respectively performing diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background image to be fused; performing a fusion process on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a fused image pixel matrix, and performing global scrambling on the fused image pixel matrix to obtain an encrypted image.

[0006] In one embodiment, inputting the image to be processed into a preset hash algorithm for processing to generate a key array includes: calculating the image to be processed based on the SHA-256 hash algorithm to generate a first number of hexadecimal numbers; forming each group by two hexadecimal numbers, and converting a second number of groups of hexadecimal numbers into decimal numbers and storing them in the key array.

[0007] In one embodiment, the scrambling parameters include a scrambling row sequence, a scrambling row direction sequence, a scrambling column sequence, and a scrambling column direction sequence. Based on the scrambling parameters, performing local scrambling processing on the face image to obtain a pixel matrix of the face image to be diffused, including: obtaining the pixel matrix of the face image, and adding the scrambling row sequence to the first row of the pixel matrix of the face image to obtain a first pixel matrix of the face image; sorting each column of the first pixel matrix of the face image based on the value of the scrambling row sequence to obtain a second pixel matrix of the face image; adding the scrambling row direction sequence to the first row of the second pixel matrix of the face image to obtain a third pixel matrix of the face image; cyclically shifting the pixel values of the third pixel matrix of the face image downward based on the value of the scrambling row direction sequence to obtain a fourth pixel matrix of the face image; adding the scrambling column sequence to the first column of the fourth pixel matrix of the face image to obtain a fifth pixel matrix of the face image; sorting each row of the fifth pixel matrix of the face image based on the value of the scrambling column sequence to obtain a sixth pixel matrix of the face image; adding the scrambling column direction sequence to the first row of the sixth pixel matrix of the face image to obtain a seventh pixel matrix of the face image; cyclically shifting the pixel values of the seventh pixel matrix of the face image to the right based on the value of the scrambling column direction sequence to obtain an eighth pixel matrix of the face image as the pixel matrix of the face image to be diffused.

[0008] In one embodiment, the scrambling parameters include a scrambled row sequence, a scrambled row direction sequence, a scrambled column sequence, and a scrambled column direction sequence. The local scrambling process of the background image based on the scrambling parameters to obtain the pixel matrix of the background image to be diffused includes: obtaining the pixel matrix of the background image, and adding the scrambled row sequence to the first row of the pixel matrix of the background image to obtain a first pixel matrix of the background image; sorting each column of the first pixel matrix of the background image based on the values of the scrambled row sequence to obtain a second pixel matrix of the background image; adding the scrambled row direction sequence to the first row of the second pixel matrix of the background image to obtain a third pixel matrix of the background image; cyclically shifting the pixel values of the third pixel matrix of the background image downward based on the values of the scrambled row direction sequence to obtain a fourth pixel matrix of the background image; adding the scrambled column sequence to the first column of the fourth pixel matrix of the background image to obtain a fifth pixel matrix of the background image; sorting each row of the fifth pixel matrix of the background image based on the values of the scrambled column sequence to obtain a sixth pixel matrix of the background image; adding the scrambled column direction sequence to the first row of the sixth pixel matrix of the background image to obtain a seventh pixel matrix of the background image; cyclically shifting the pixel values of the seventh pixel matrix of the background image to the right based on the values of the scrambled column direction sequence to obtain an eighth pixel matrix of the background image as the pixel matrix of the background image to be diffused.

[0009] In one embodiment, the diffusion process of the pixel matrix of the face image to be diffused based on the diffusion parameters to obtain the pixel matrix of the face image to be fused includes: calculating based on a preset first diffusion formula and the diffusion parameters to obtain a first diffusion parameter matrix; calculating based on a preset second diffusion formula and the diffusion parameters to obtain a second diffusion parameter matrix; calculating based on a preset third diffusion formula, the pixel matrix of the face image to be diffused, the first diffusion parameter matrix, and the second diffusion parameter matrix to obtain the pixel matrix of the face image to be fused.

[0010] In one embodiment, the diffusion process of the pixel matrix of the background image to be diffused based on the diffusion parameters to obtain the pixel matrix of the background pixel image to be fused includes: calculating based on a preset fourth diffusion formula and the pixel matrix of the background image to be diffused to obtain a fourth diffusion parameter matrix; calculating based on a preset fifth diffusion formula and the diffusion parameters to obtain a fifth diffusion parameter matrix; calculating based on a preset pixel bit formula, the pixel matrix of the background image to be diffused, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and a combination value formula to obtain a combination value; calculating based on a preset sixth diffusion formula, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and the combination value to obtain the pixel matrix of the background pixel image to be fused.

[0011] In one embodiment, globally scrambling the fused image pixel matrix to obtain an encrypted image includes: starting from the first column of the fused image pixel matrix, traversing the pixels of all odd rows until the traversal is completed, and executing obtaining the pixel value at the pixel position i = 1, j = 1 as the starting value and putting it into the matrix, updating the values of i and j, putting the pixel value at the new pixel position obtained after i = i + 1 into the matrix, putting the pixel value at another new pixel position obtained after increasing j by 1 into the matrix, until i > M; where M is the number of all rows of the fused image pixel matrix; starting from the even columns of the first row, traversing the fused image pixel matrix until all even columns are traversed, and executing obtaining the starting position of the current j column, setting i = 1, obtaining the pixel value at the pixel position of i, j and putting it into the matrix, keeping i unchanged, putting the pixel value at the new pixel position obtained after increasing the value of j by 1 into the matrix, keeping j unchanged, putting the pixel value at another new pixel position obtained after i = i + 1 into the matrix, until j > M, to obtain the encrypted image.

[0012] The present application provides an image encryption device based on a spatio-temporal chaotic system. The device includes: an acquisition module for acquiring an image to be processed; a generation module for inputting the image to be processed into a preset hash algorithm for processing to generate a key array; a processing module for inputting the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; a separation module for performing a separation process on the image to be processed to obtain a face image and a background image; a local scrambling module for locally scrambling the face image and the background image respectively based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; a diffusion module for diffusing the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused respectively based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background image to be fused; a fusion module for fusing the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a fused image pixel matrix; a global scrambling module for globally scrambling the fused image pixel matrix to obtain an encrypted image.

[0013] An embodiment of the present application provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the image encryption method based on a spatio-temporal chaotic system provided by any embodiment of the present application.

[0014] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the image encryption method based on a spatio-temporal chaotic system provided by any embodiment of the present application.

[0015] An embodiment of the present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the image encryption method based on a spatio-temporal chaotic system provided by the embodiment of the present disclosure.

[0016] The image encryption method, apparatus, device and medium based on a spatio-temporal chaotic system provided by the embodiments of the present application obtain an image to be processed, input the image to be processed into a preset hash algorithm for processing to generate a key array; input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; perform a separation process on the image to be processed to obtain a face image and a background image, and respectively perform local scrambling processing on the face image and the background image based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; respectively perform diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background pixel image to be fused; perform a fusion process on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a fused image pixel matrix, and perform global scrambling on the fused image pixel matrix to obtain an encrypted image. This solves the technical problems of low security and efficiency of existing image encryption. By generating a key based on the image to be processed and inputting it into a spatio-temporal chaotic system for iteration, perturbation and confusion factors for image encryption are generated, which not only ensures the close connection between the key and the plaintext, but also ensures the uniqueness of the key; separates the face information and the background information, encrypts the pixel values for the face information and encrypts the pixel bits for the background information, and combines local scrambling and global scrambling methods to further ensure the security of the face information and the efficiency of encryption. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0019] Figure 1a FIG. is an application scenario diagram of the image encryption method based on a spatio-temporal chaotic system in an embodiment;

[0020] Figure 1b FIG. is a schematic diagram of the KED of the SMDMCML spatio-temporal chaotic system in an embodiment;

[0021] Figure 1c Schematic diagram of KEB of the SMDMCML spatiotemporal chaotic system in one embodiment;

[0022] Figure 1d Schematic diagram of the bifurcation diagram in one embodiment;

[0023] Figure 2 Schematic flowchart of the image encryption method based on the spatiotemporal chaotic system in one embodiment;

[0024] Figure 3 Schematic flowchart of the image encryption method based on the spatiotemporal chaotic system in another embodiment;

[0025] Figure 4 Schematic flowchart of the image encryption method based on the spatiotemporal chaotic system in yet another embodiment;

[0026] Figure 5 Schematic diagram of extracting face information in one embodiment;

[0027] Figure 6 Schematic diagram of local scrambling in one embodiment;

[0028] Figure 7 Schematic flowchart of the image encryption method based on the spatiotemporal chaotic system in still another embodiment;

[0029] Figure 8 Schematic flowchart of the image encryption method based on the spatiotemporal chaotic system in still another embodiment;

[0030] Figure 9 Schematic diagram of global scrambling in one embodiment;

[0031] Figure 10 Example diagram of the image encryption method based on the spatiotemporal chaotic system in one embodiment;

[0032] Figure 11 Example diagram of pixel correlation in one embodiment;

[0033] Figure 12 Example diagram of decrypted images with different degrees of cropping in one embodiment;

[0034] Figure 13 Example diagram of decrypted images with different degrees of salt-and-pepper attacks in one embodiment;

[0035] Figure 14 Example diagram of the image encryption process in one embodiment;

[0036] Figure 15 Example diagram of the image decryption process in one embodiment;

[0037] Figure 16 The structural block diagram of an image encryption device based on a spatio-temporal chaotic system in an embodiment;

[0038] Figure 17 The internal structure diagram of an electronic device in an embodiment. Detailed implementation manners

[0039] In order to more clearly understand the above objects, features, and advantages of the present application, the solutions of the present application will be further described below. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.

[0040] Many specific details are set forth in the following description to facilitate a thorough understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present application, rather than all the embodiments.

[0041] The image encryption method based on a spatio-temporal chaotic system of the present application can be applied to an application environment as Figure 1a shown. The image encryption method based on a spatio-temporal chaotic system is applied to an image encryption system based on a spatio-temporal chaotic system. The image encryption system based on a spatio-temporal chaotic system includes a terminal device 102 and a terminal device 104. Among them, the terminal device 102 and the terminal device 104 communicate with each other through a network. The sender obtains the image to be processed ( Figure 1a the original image shown) through the terminal device 102, performs separation processing to obtain a face image and a background image, and performs an encryption operation according to an encryption program, that is, inputs the image to be processed into a preset hash algorithm for processing, generates a key array, inputs the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter, performs local scrambling processing on the face image and the background image respectively based on the scrambling parameter to obtain a face image pixel matrix to be diffused and a background image pixel matrix to be diffused, performs diffusion processing on the face image pixel matrix to be diffused and the background image pixel matrix to be diffused respectively based on the diffusion parameter to obtain a face image pixel matrix to be fused and a background pixel image matrix to be fused, performs fusion processing on the face image pixel matrix to be fused and the background image pixel matrix to be fused to obtain a fused image pixel matrix, and performs global scrambling on the fused image pixel matrix to obtain an encrypted image and sends it to the terminal device 104. The receiver performs decryption and other processing through the terminal device 104 to obtain the original image. Among them, the terminal device 102 and the terminal device 104 may be, but are not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices.

[0042] The image encryption system based on the spatio-temporal chaotic system in the embodiments of the present disclosure has many application scenarios, including privacy image protection: users can use the image encryption function to protect private photos in the mobile phone to ensure that only authorized users can view these photos; folder encryption: create an encrypted folder and encrypt and store the image files therein to increase the access security of sensitive images. The functional features include password protection: provide methods such as passwords or biometric recognition to protect the access to encrypted images; concealment: the image encryption application can provide a concealed method so that the encrypted images are not easily noticed in the file browser or photo album, increasing privacy; secure storage: provide secure local and cloud storage to ensure that even if the device is stolen or lost, the encrypted images are not easily threatened by leakage; user-friendliness: easy to operate, provide an intuitive user interface, enabling users to easily encrypt and decrypt images without having to deeply understand complex encryption algorithms. The operation methods include selective encryption: users can selectively encrypt certain images without having to encrypt all images; one-key encryption: provide the option to encrypt an entire folder or photo album with one key to facilitate users to batch protect image privacy; digital watermark configuration: users can choose whether to embed a digital watermark in the encrypted image to provide an additional security level; sharing control: users can set the sharing permissions of encrypted images to ensure that even if the images are shared, only authorized users can decrypt and view them.

[0043] Specifically, for the image encryption algorithm, usually the coordinate position or value of the image pixel points will be changed to achieve the protection of image information. The embodiments of the present disclosure introduce the chaotic system into the field of image encryption, and application points can be selected in different aspects according to the characteristics of the chaotic system itself. For example, in order to improve the key sensitivity of the encryption algorithm, the initial value and parameter value of the chaotic system can be used as the encryption key to enhance the security of the algorithm. In addition, in order to give full play to the application of the chaotic system in the image encryption algorithm, a matrix of the same size as the encrypted image can also be generated using the chaotic system to achieve the interaction of image information, thereby further strengthening the protection of image information. That is to say, for the image encryption algorithm, a series of means need to be taken to achieve the protection of image information, and the chaotic system needs to be reasonably utilized and introduced into the image encryption algorithm to improve the security and effect of the encryption algorithm.

[0044] Among them, the Li-Yorke theorem reflects this behavior of chaos and is defined as follows: (1) The period interval of the periodic points of f(x) has no upper bound; (2) There exists an uncountable subset S without periodic points on the closed interval I, satisfying: ① When ② ③ And for any periodic point y of f, there is

[0045] Specifically, the main characteristics of a chaotic system include: (1) Sensitivity to initial values: A slight change in the initial value of a chaotic system may lead to a huge deviation in the system's output; (2) Ergodicity: A chaotic system has its chaotic trajectory, and within a certain period of time, the movement trajectory of the chaotic system cannot repeat a certain state point; (3) Pseudo-randomness: When a chaotic system is disturbed by the outside world, a certain state inside the system sometimes appears and sometimes does not appear. This state is random, and essentially, it is the sensitivity to the initial value that creates this characteristic; (4) Unpredictability: When predicting the inside of a chaotic system, some information will be lost inside the system every time a prediction is made. Long-term prediction will cause the system to lose more information. Therefore, a chaotic system has unpredictability.

[0046] More specifically, chaotic systems are mainly divided into low-dimensional chaotic systems, high-dimensional chaotic systems, and spatio-temporal chaotic systems. Among them, the spatio-temporal chaotic system can be regarded as an L-dimensional chaotic system. It not only has the chaotic characteristics of a high-dimensional chaotic system but also exhibits chaotic iterative behavior under the condition that both time and space change simultaneously. Compared with other chaotic systems, the spatio-temporal chaotic system has more complex non-linear dynamic chaotic behavior, a larger key space, and higher key and plaintext sensitivity. However, relatively speaking, its complexity is also higher. The unique feature of the spatio-temporal chaotic system is that it can exhibit chaotic phenomena simultaneously in multiple dimensions of time and space, which provides richer and more complex application possibilities for it in the field of encryption.

[0047] The SMDMCML spatio-temporal chaotic system of the embodiments of the present disclosure, that is, the Sine Multiple Dynamic Multiple Coupling Mapping Lattice (SMDMCML), is defined as shown in formula (1).

[0048]

[0049] Among them, the subscript n is the iteration number of the time series; i is the lattice serial number, and L is the total number of lattices; i, p, and q are different lattices; the relationship between i, p, and q depends on the Arnold mapping and is between [1, L]; the coupling coefficient S(e) is defined as shown in formula (2) S(e n ) = φsin(πe n ) as shown. When φ ∈ [0.87, 1], the sine mapping has chaotic behavior.

[0050] Specifically, as Figure 1bAs shown, the Kolmogorov-Sinai entropy density (KED) indicates the existence of chaotic behavior in a spatio-temporal chaotic system when h > 0, and the larger h is, the stronger the chaos of the system; for example Figure 1c As shown, the Kolmogorov-Sinai entropy breadth (KEB) represents the percentage of the number of cells in a chaotic state to the total number of cells.

[0051] Specifically, a bifurcation diagram can describe the distribution of the chaotic state of a system as the parameter changes. As the parameter continuously changes, the chaotic system will also exhibit different states, and these states can be intuitively analyzed using a bifurcation diagram. For example Figure 1d As shown, from left to right are the bifurcation diagrams of e = 0.25, e = 0.65, and e = 0.95 respectively.

[0052] It can be understood that chaotic cryptography utilizes the characteristics of chaotic systems to provide an innovative method for data encryption through complex non-linear dynamic behaviors; the introduction of chaotic cryptography not only enhances the security of the cryptographic system, but also makes cryptography more flexible and adaptable to diverse application scenarios; as a part of the cryptographic theory, chaotic cryptography brings new ideas and technical means to the field of encryption, promoting the development of cryptography.

[0053] In related technologies, various image encryption schemes have been proposed, including Josephus traversal, substitution boxes, hash functions, Boolean networks, DNA sequence operations, and chaos. Chaotic systems have been successfully applied to cryptography due to their good characteristics and have become an effective means of encrypting important information data; introducing chaotic systems into image encryption is expected to more effectively address challenges in information security and provide a reliable solution for protecting important data.

[0054] Based on the foregoing description, in the existing encryption algorithms, the key has no relation with the plaintext image. It can be understood that if the algorithm does not reasonably and effectively combine the key with the pixel values of the plaintext, an attacker can use a special image and then use a plaintext attack to damage the encrypted image, thereby breaking the encryption algorithm; in image encryption, the image is usually encrypted without distinction as a whole. For example, for a face image, the important information in the image is the face information. Therefore, the embodiments of the present disclosure focus on encrypting the face image, thereby accelerating the efficiency of image encryption and increasing the security of the face image.

[0055] In one embodiment, as Figure 2 shown, an image encryption method based on a spatio-temporal chaotic system is provided. In this embodiment, the method is mainly applied toFigure 1a Take the terminal device 102 in

[0056] Step 202: Obtain the image to be processed, and input the image to be processed into a preset hash algorithm for processing to generate a key array.

[0057] In the embodiment of the present application, the image to be processed can be obtained by shooting any face-included scene through an image acquisition device (such as a camera) on the terminal device 102, or the image including a face stored on the terminal device 102 can be used as the image to be processed.

[0058] In the embodiment of the present application, after obtaining the image to be processed, the image to be processed is input into a preset hash algorithm for processing to generate a key array. Specifically, the image to be processed is hashed through the preset hash algorithm to obtain a hash value as the key array. More specifically, the image to be processed is calculated based on the SHA-256 hash algorithm to generate a first number of hexadecimal numbers. Every two hexadecimal numbers form a group, and the second number of groups of hexadecimal numbers is converted into decimal numbers and stored in the key array.

[0059] Step 204: Input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter.

[0060] In the embodiment of the present disclosure, a spatio-temporal chaotic system is preset, such as the formula (1) described in the foregoing embodiment. Specifically, the SMDMCML system is iterated. For example, the number of grids is set to 30, the first 30 are assigned to the initial values of the grids, and the last 2 are assigned to μ and e; after the SMDMCML system is iterated, the parameter H is obtained for changing the pixel values, KM is used to represent the size of the image pixel movement position, KN is used to represent the size of the image pixel movement position), movM is used to indicate the up and down movement direction, and movN is used to indicate the left and right movement direction.

[0061] Specifically, input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter. More specifically, the scrambling parameter includes a scrambling row sequence, a scrambling row direction sequence, a scrambling column sequence, a scrambling column direction sequence, etc., which are used to locally scramble the image pixel matrix; the diffusion parameter is used to change the pixel values of the image pixel matrix.

[0062] Step 206: Separate the image to be processed to obtain a face image and a background image, and respectively perform local scrambling processing on the face image and the background image based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused.

[0063] In an embodiment of the present disclosure, the image to be processed is separated to obtain a face image and a background image, including: converting the image to be processed into a binary image, calculating the range of face information and marking it on the binary image, and segmenting the binary image to obtain the face image and the background image.

[0064] Specifically, face information is extracted from the image to be processed; first, the image to be processed is converted into a binary image; then the range of face information is calculated and marked on the image to be processed; finally, the image to be processed is segmented to generate the face image and the background image, and their positions are recorded and marked as a status array.

[0065] In an embodiment of the present disclosure, after obtaining the scrambling parameter, the face image and the scrambling parameter can be input into a preset local scrambling algorithm for processing to obtain a pixel matrix of the face image to be diffused; similarly, the background image and the scrambling parameter can be input into a preset local scrambling algorithm for processing to obtain a pixel matrix of the background image to be diffused.

[0066] Step 208, based on the diffusion parameter, perform diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused respectively to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background image to be fused.

[0067] In an embodiment of the present disclosure, after obtaining the diffusion parameter, the pixel matrix of the face image to be diffused and the diffusion parameter can be input into a preset diffusion algorithm for processing to obtain a pixel matrix of the face image to be fused; similarly, the pixel matrix of the background image to be diffused and the diffusion parameter can be input into a preset diffusion algorithm for processing to obtain a pixel matrix of the background image to be fused.

[0068] Step 210, perform fusion processing on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a pixel matrix of the fused image, and perform global scrambling on the pixel matrix of the fused image to obtain an encrypted image.

[0069] In an embodiment of the present disclosure, the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused are combined to obtain a complete pixel matrix of the fused image, and the pixel matrix of the fused image is globally scrambled through a preset global scrambling algorithm such as a stepped scrambling algorithm to obtain a pixel matrix of the image as the pixel matrix corresponding to the encrypted image, that is, the encrypted image.

[0070] In the above image encryption method based on a spatio-temporal chaotic system, a key array is generated by obtaining the image to be processed and inputting the image to be processed into a preset hash algorithm for processing. The key array is input into a preset spatio-temporal chaotic system for processing to obtain scrambling parameters and diffusion parameters. The image to be processed is separated to obtain a face image and a background image, and local scrambling processing is respectively performed on the face image and the background image based on the scrambling parameters to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused. Diffusion processing is respectively performed on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused based on the diffusion parameters to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background image to be fused. The pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused are subjected to fusion processing to obtain a fused image pixel matrix, and global scrambling is performed on the fused image pixel matrix to obtain an encrypted image. This solves the technical problems of low security and efficiency of existing image encryption. By generating a key based on the image to be processed and inputting it into the spatio-temporal chaotic system for iteration, a perturbation and confusion factor for image encryption is generated, which not only ensures the close connection between the key and the plaintext, but also ensures the uniqueness of the key. The face information and the background information are separated, pixel value encryption is used for the face information, pixel bit encryption is used for the background information, and a method combining local scrambling and global scrambling is adopted to further ensure the security of the face information and the efficiency of encryption.

[0071] Figure 3 It is a flowchart of image encryption based on a spatio-temporal chaotic system in another embodiment. Figure 3 It is on the basis of the Figure 2 embodiment shown, and further, a description of a possible implementation manner of S202.

[0072] Step 202a, obtain the image to be processed, and calculate the image to be processed based on the SHA-256 hash algorithm to generate a first number of hexadecimal numbers.

[0073] Step 202b, combine every two hexadecimal numbers into a group, and convert the second number of groups of hexadecimal numbers into decimal numbers and store them in the key array.

[0074] Among them, the first number and the second number can be selected and set according to actual applications. Specifically, calculate the image to be processed using the SHA-256 hash algorithm to generate 64 hexadecimal numbers; combine every two hexadecimal numbers into a group; convert these 32 groups of hexadecimal numbers into decimal numbers and store the results in the key array.

[0075] Thus, a key is generated based on the image to be processed and input into the spatio-temporal chaotic system to generate a perturbation and confusion factor for image encryption, ensuring the close connection between the key and the plaintext and the uniqueness of the key.

[0076] Figure 4Flowchart of an image encryption method based on a spatio-temporal chaotic system in yet another embodiment Figure 4 is based on the embodiment shown in Figure 2 and further describes a possible implementation manner of S206, as shown in Figure 4 follows:

[0077] Step 206a: Convert the image to be processed into a binary image, calculate the range of face information and mark it on the binary image, and segment the binary image to obtain a face image and a background image.

[0078] Step 206b: Obtain the face image pixel matrix of the face image, add the scrambled row sequence to the first row of the face image pixel matrix to obtain the first face image pixel matrix, sort each column of the first face image pixel matrix based on the values of the scrambled row sequence to obtain the second face image pixel matrix, and add the scrambled row direction sequence to the first row of the second face image pixel matrix to obtain the third face image pixel matrix.

[0079] Step 206c: Cyclically shift the pixel values of the third face image pixel matrix downward based on the values of the scrambled row direction sequence to obtain the fourth face image pixel matrix, add the scrambled column sequence to the first column of the fourth face image pixel matrix to obtain the fifth face image pixel matrix, and sort each row of the fifth face image pixel matrix based on the values of the scrambled column sequence to obtain the sixth face image pixel matrix.

[0080] Step 206d: Add the scrambled column direction sequence to the first row of the sixth face image pixel matrix to obtain the seventh face image pixel matrix, and cyclically shift the pixel values of the seventh face image pixel matrix to the right based on the values of the scrambled column direction sequence to obtain the eighth face image pixel matrix as the face image pixel matrix to be diffused.

[0081] Step 206e: Obtain the background image pixel matrix of the background image, add the scrambled row sequence to the first row of the background image pixel matrix to obtain the first background image pixel matrix, sort each column of the first background image pixel matrix based on the values of the scrambled row sequence to obtain the second background image pixel matrix, and add the scrambled row direction sequence to the first row of the second background image pixel matrix to obtain the third background image pixel matrix.

[0082] Step 206f: Cyclically shift the pixel values of the third background image pixel matrix downward based on the values of the scrambled row direction sequence to obtain the fourth background image pixel matrix, add the scrambled column sequence to the first column of the fourth background image pixel matrix to obtain the fifth background image pixel matrix, and sort each row of the fifth background image pixel matrix based on the values of the scrambled column sequence to obtain the sixth background image pixel matrix.

[0083] Step 206g: Add the scrambled column direction sequence to the first row of the sixth background image pixel matrix to obtain the seventh background image pixel matrix. Based on the values of the scrambled column direction sequence, circularly shift the pixel values of the seventh background image pixel matrix to the right to obtain the eighth background image pixel matrix as the background image pixel matrix to be diffused.

[0084] In the embodiments of the present disclosure, the generated key value can be expressed as Key = (K1, K2). Among them, K2 contains the image recognition position [x, y, w, h]; (x, y) is the upper left coordinate of the image recognition, w is the width, and h is the height; the input image to be processed generates K1 through the SHA-256 algorithm. Divide K1 evenly into 8 groups, denoted as b i , where i ∈ [1, 8]. For example, set the number of grids to 5, and generate the parameters and initial grid values of the SMDMCML chaotic system through formula (3).

[0085]

[0086] Specifically, the segmentation of the background image and the privacy image. Through K2, the left vertex coordinates (x, y) of the provided recognition image, the width w, and the height h of the image recognition are used to segment the face image and the background image from the image to be processed, as Figure 5 shown. From left to right are the gray images corresponding to the images to be processed. Then, convert the gray images into binary images, calculate the face information range for the binary images, and draw the corresponding face ranges to determine the background information and important face information.

[0087] It can be understood that the iterative SMDMCML system generates the scrambling parameters and diffusion parameters required for image encryption. For example, set the number of iterations to M×N. After the system iterates, a pseudo-random number sequence is generated, including the parameters KH, KM, KN, movM, and movN; among them, KH is used as the diffusion parameter to change the pixel values, thereby realizing the encryption of the pixel values; KM and KN are used to control the number of times of pixel scrambling and movement, while movM and movN are responsible for adjusting the direction and amplitude of pixel movement. Specifically, movM and movN respectively represent the movement of image pixels in the vertical (up and down) and horizontal (left and right) directions, and KM and KN control the amplitude of pixel movement.

[0088] First, perform preliminary scrambling on the face image pixel matrix of the face image to enhance its anti-analysis ability. Taking an image P with a pixel size of 5×5 as an example, the preliminary scrambling process is as Figure 6As shown, the initial image A has a size of 5×5 pixels; P→P1: Add the sequence KM to the first row of P to obtain P1; P1→P2: Sort KM and sort P1 to obtain P2; P2→P3: Add movM to the first row of P2 to obtain P3; P3→P4: According to movM, shift P3 downward in a circular manner to obtain P4; P4→P5: Add KN to the first column of P4 to obtain P5; P5→P6: Sort KN and sort P4 to obtain P6; P6→P7: Add movN to the first column of P6 to obtain P7; P7→P8: According to movN, shift the rows of P7 to the right in a circular manner to obtain the locally permuted P8, which is the pixel matrix of the face image to be diffused. Similarly, the above processing can also be performed on the background image to obtain the pixel matrix of the background image to be diffused.

[0089] Thus, the face information and background information are separated, and local scrambling is performed on the face information and background information to further improve the image encryption efficiency and effect.

[0090] Figure 7 It is a flowchart of an image encryption method based on a spatio-temporal chaotic system in another embodiment. Figure 7 It is on the Figure 2 basis of the embodiment shown, and further, a possible implementation manner of S208 is described, as Figure 7 shown:

[0091] Step 208a, calculate based on a preset first diffusion formula and diffusion parameters to obtain a first diffusion parameter matrix, calculate based on a preset second diffusion formula and diffusion parameters to obtain a second diffusion parameter matrix, and calculate based on a preset third diffusion formula, the pixel matrix of the face image to be diffused, the first diffusion parameter matrix, and the second diffusion parameter matrix to obtain the pixel matrix of the face image to be fused.

[0092] Step 208b, calculate based on a preset fourth diffusion formula and the pixel matrix of the background image to be diffused to obtain a fourth diffusion parameter matrix, and calculate based on a preset fifth diffusion formula and diffusion parameters to obtain a fifth diffusion parameter matrix.

[0093] Step 208c, calculate based on a preset pixel bit formula, the pixel matrix of the background image to be diffused, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and a combination value formula to obtain a combination value, and calculate based on a preset sixth diffusion formula, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and the combination value to obtain the pixel matrix of the background pixel image to be fused.

[0094] Specifically, the pixel matrix of the face image is initially scrambled to enhance its anti-analysis ability, obtaining the pixel matrix of the face image to be diffused. Then, the pixel matrix of the face image to be diffused is diffused (changing the pixel values) to improve the security and randomness of the encrypted image. The calculation process is shown in the following formula (4), including the first diffusion formula, the second diffusion formula, and the third diffusion formula.

[0095]

[0096] Among them, in the diffusion stage, the pixel matrix of the face image to be diffused is calculated through formula (4) to obtain the first diffusion parameter matrix T. At the same time, the diffusion parameter KH related to the key is calculated through the same formula to obtain the second diffusion parameter matrix. Then, the parameter matrices T and D act on the pixel matrix of the face image to be diffused together to perform a non-linear diffusion transformation on it, further disrupting the pixel distribution and enhancing the resistance to statistical analysis attacks. Finally, after the diffusion process, the pixel matrix of the face image to be fused after encryption is generated, ensuring the security and robustness of information hiding.

[0097] Specifically, the pixel matrix of the background image is pre-scrambled to obtain the pixel matrix of the background image to be diffused, and a pixel bit diffusion operation is performed on the pixel matrix of the background image to be diffused to enhance the encryption intensity of the image. The diffusion process is calculated according to formulas (5) to (7). Among them, the pixel matrix of the background image to be diffused is calculated through formula (5) to obtain the fourth diffusion parameter matrix BT. At the same time, the diffusion parameter H related to the key is calculated through the same formula to obtain the fifth diffusion parameter matrix BD. Then, the parameter matrices BT and BD act on the pixel matrix of the background image to be diffused, and finally, after the diffusion process, the pixel image matrix FC of the background to be fused after encryption is generated.

[0098]

[0099] Specifically, in the pixel bit operation, according to formula (6), the hundreds digit data H, the tens digit data M, and the units digit data L of the pixel value BF(i) can be obtained. Similarly, the data of BT(i) is split into the hundreds digit data H1, the tens digit data M1, and the units digit data L1, and the data of BD(i) is split into the hundreds digit data H2, the tens digit data M2, and the units digit data L2. Subsequently, these data are substituted into formula (7) to calculate H3, M3, and L3, and further synthesize the combined value num. Then, with the help of the parameters BD and BT, a diffusion operation is performed on num. Using formula (8), its pixel value undergoes complex changes, and finally, the pixel image matrix BC of the background to be fused after encryption is generated. This process enhances the randomness of the pixel distribution and improves the security and anti-attack ability of image encryption.

[0100] BC(i) = (num(i) + floor(0.99×sin(π(1.65×BT(i) + 1.65×(1 - BD(i)))))×10 9 ))(mod 256) (8)

[0101] Thus, the face information and the background information are separated. Pixel value encryption is adopted for the face information, and pixel bit encryption is adopted for the background information, which further ensures the security of the face information and the encryption efficiency.

[0102] Figure 8 It is a flowchart of an image encryption method based on a spatio-temporal chaotic system in another embodiment. Figure 8 It is based on Figure 2 the embodiment shown, and further, a possible implementation manner of S210 is described, as Figure 8 shown:[[]]

[0103] Step 210a: The pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused are fused to obtain a fused image pixel matrix. Starting from the first column of the fused image pixel matrix, traverse the pixels of all odd rows until the traversal is completed, and perform pixel processing.

[0104] Step 210b: Traverse the fused image pixel matrix starting from the even columns of the first row until all even columns are traversed, and perform pixel processing to obtain the encrypted image.

[0105] Specifically, for the global scrambling of the entire image, the encrypted pixel matrix FC of the face image to be fused and the pixel matrix BC of the background to be fused are combined to obtain a complete image matrix, that is, the fused image pixel matrix G = combine(FC, BC). The image G is scrambled in a stepped manner, as Figure 9 shown, and finally the encrypted image C is obtained.

[0106] Specifically, as Figure 9As shown, starting from the first column of matrix P, traverse the pixels in all odd rows until the traversal is completed. The operations are as follows: (a) Obtain the pixel value at position i = 1, j = 1 as the starting value and put it into matrix Q; (b) Update the values of i and j. After i = i + 1, obtain the pixel value at the new position and put it into matrix Q; then, after j is incremented by 1, obtain the pixel value at another new position and put it into matrix Q; (c) Repeat step (b) until i > M. Starting from the even columns of the first row, traverse matrix P until all even columns are traversed. The specific description is as follows: (a) Obtain the starting position of the current j column, set i = 1; obtain the pixel value at position i, j and put it into matrix Q; (b) Keep i unchanged, increment the value of j by 1 to obtain the pixel value at the new position and put it into matrix Q; then, keep j unchanged, after i = i + 1, obtain the pixel value at another new position and put it into matrix Q; (c) Repeat step (b) until j > M.

[0107] As an example, as Figure 10 shown, step 10.1 obtains the plaintext image A; step 10.2 processes A through SHA-256 to obtain the key Key; step 10.3 inputs Key into the iterative SMDMCML system to obtain the parameters H, KM, KN, movM, and movN; step 10.4 separates the face and background information of image A to obtain images P and B, and simultaneously marks the state State; step 10.5 performs pre-scrambling processing on P and B respectively through the parameters H, KM, KN, movM, and movN; step 10.6 performs pixel value diffusion on the pre-scrambled face pixel matrix; step 10.7 performs pixel bit diffusion on the pre-scrambled background pixel matrix; step 10.8 fuses the diffused pixel matrices and performs global scrambling to output the ciphertext image C.

[0108] Specifically, in the simulation experiment, the results and analyses obtained from different images. The segmentation results can be obtained by segmenting different face images, and different face images can be encrypted through the image encryption method of the present application to obtain the simulation results. The histogram of the encrypted image is average, and the original image can be obtained through the correct key, preventing attackers from extracting any effective information. Specifically, convert the planar image into a binary image, calculate the range of important face information for the binary image, and draw the range of important face information, obtain the background information of the image and the important face information of the image, as well as obtain the encryption results of different images. Based on the simulation results, it can be obtained that the histogram of the ordinary image changes greatly, and the histogram of the encrypted image is relatively average.

[0109] Specifically, Figure 11The test results of the correlation images of the ordinary image and the ciphertext image in different directions are shown. From left to right, they are the horizontal correlation, the vertical correlation, and the diagonal correlation respectively. Through the comparison of the two images, the original image shows a strong correlation. However, the pixel correlation in the encrypted image is close to the ideal value of 0. This algorithm can effectively reduce the correlation of adjacent pixels, effectively hide the effective information of the image, and ensure the security of the information.

[0110] Specifically, for a robust image encryption algorithm, even if some data information is lost, the general image information can still be recognized. Among them, Figure 12 The comparison of the encrypted images and the decrypted images under different degrees of cropping attacks is shown. From left to right, they are the encrypted and decrypted images with 0% cropping, the encrypted and decrypted images with 6.25% cropping, the encrypted and decrypted images with 12.5% cropping, and the encrypted and decrypted images with 25% cropping respectively. Figure 13 They are the decrypted images under different degrees of noise attacks (0, 0.001, 0.01, and 0.1). After different degrees of cropping and noise attacks, most of the effective information can still be recognized in the decrypted images.

[0111] Specifically, in encryption, K2 is obtained by randomly changing one bit of the original key K1. Then, K1 and K2 are used to encrypt the same image, as Figure 14 shown. In decryption, K3 is obtained by randomly changing one bit of the original key K1. K1 and K3 are used to decrypt the image, as Figure 15 shown.

[0112] The method of the embodiments of the present disclosure can be applied to different fields. For example, in social media platforms: Social media applications can use image encryption to provide more fine-grained privacy control to ensure that the photos shared by users are only visible to authorized users. In enterprise communication applications: In enterprise-level communication tools, image encryption can be applied to the transmission of encrypted image files to ensure the security of business secrets. In medical imaging systems: In the medical industry, image encryption can be used to protect patients' medical images to ensure the protection of patients' privacy.

[0113] Thus, the entire image is brought into SHA-256 to generate the key Key, and Key is brought into the system for iteration to generate the perturbation confusion factor for image encryption. This method not only ensures the close connection between the key and the plaintext but also ensures the uniqueness of the key. Combining the characteristics of face images, that is, separating the face information and the background information, pixel value encryption is used for the face information and pixel bit encryption is used for the background information. And combining local and global scrambling further ensures the security of face information and the encryption efficiency. In addition, through the analysis of the encryption simulation performance, it can be easily determined that this algorithm has characteristics such as high security and high sensitivity.

[0114] It should be understood that although the steps in the flowcharts of the above embodiments are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts of the above embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0115] In one embodiment, as Figure 16 shown, an image encryption device based on a spatio-temporal chaotic system is provided, including: an acquisition module 1602, a generation module 1604, a processing module 1606, a separation module 1608, a local scrambling module 1610, a diffusion module 1612, a fusion module 1614, and a global scrambling module 1616, where:

[0116] The acquisition module 1602 is configured to acquire an image to be processed;

[0117] The generation module 1604 is configured to input the image to be processed into a preset hash algorithm for processing to generate a key array;

[0118] The processing module 1606 is configured to input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter;

[0119] The separation module 1608 is configured to perform separation processing on the image to be processed to obtain a face image and a background image;

[0120] The local scrambling module 1610 is configured to perform local scrambling processing on the face image and the background image respectively based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused;

[0121] The diffusion module 1612 is configured to perform diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused respectively based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background pixel image to be fused;

[0122] The fusion module 1614 is configured to perform fusion processing on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a fused image pixel matrix;

[0123] The global scrambling module 1616 is used to globally scramble the pixel matrix of the fused image to obtain an encrypted image.

[0124] In an implementation manner of Embodiment 1 of the present application, the generating module 1604 is specifically configured to: calculate the to-be-processed image based on the SHA-256 hash algorithm to generate a first number of hexadecimal numbers; form each group with every two hexadecimal numbers, and convert the second number of groups of hexadecimal numbers into decimal numbers and store them in the key array.

[0125] In an implementation manner of Embodiment 1 of the present application, the scrambling parameters include a scrambling row sequence, a scrambling row direction sequence, a scrambling column sequence, and a scrambling column direction sequence. The local scrambling module 1610 is specifically configured to: obtain the pixel matrix of the face image of the face image, and add the scrambling row sequence to the first row of the pixel matrix of the face image to obtain a first pixel matrix of the face image; sort each column of the first pixel matrix of the face image based on the value of the scrambling row sequence to obtain a second pixel matrix of the face image; add the scrambling row direction sequence to the first row of the second pixel matrix of the face image to obtain a third pixel matrix of the face image; cyclically shift the pixel values of the third pixel matrix of the face image downward based on the value of the scrambling row direction sequence to obtain a fourth pixel matrix of the face image; add the scrambling column sequence to the first column of the fourth pixel matrix of the face image to obtain a fifth pixel matrix of the face image; sort each row of the fifth pixel matrix of the face image based on the value of the scrambling column sequence to obtain a sixth pixel matrix of the face image; add the scrambling column direction sequence to the first row of the sixth pixel matrix of the face image to obtain a seventh pixel matrix of the face image; cyclically shift the pixel values of the seventh pixel matrix of the face image to the right based on the value of the scrambling column direction sequence to obtain an eighth pixel matrix of the face image as the pixel matrix of the face image to be diffused.

[0126] In an implementation manner of Embodiment 1 of the present application, the scrambling parameters include a scrambled row sequence, a scrambled row direction sequence, a scrambled column sequence, and a scrambled column direction sequence. The local scrambling module 1610 is specifically configured to: obtain the background image pixel matrix of the background image, and add the scrambled row sequence to the first row of the background image pixel matrix to obtain a first background image pixel matrix; sort each column of the first background image pixel matrix based on the values of the scrambled row sequence to obtain a second background image pixel matrix; add the scrambled row direction sequence to the first row of the second background image pixel matrix to obtain a third background image pixel matrix; circularly shift the pixel values of the third background image pixel matrix downward based on the values of the scrambled row direction sequence to obtain a fourth background image pixel matrix; add the scrambled column sequence to the first column of the fourth background image pixel matrix to obtain a fifth background image pixel matrix; sort each row of the fifth background image pixel matrix based on the values of the scrambled column sequence to obtain a sixth background image pixel matrix; add the scrambled column direction sequence to the first row of the sixth background image pixel matrix to obtain a seventh background image pixel matrix; circularly shift the pixel values of the seventh background image pixel matrix to the right based on the values of the scrambled column direction sequence to obtain an eighth background image pixel matrix as the background image pixel matrix to be diffused.

[0127] In an implementation manner of Embodiment 1 of the present application, the diffusion module 1612 is specifically configured to: calculate based on a preset first diffusion formula and the diffusion parameters to obtain a first diffusion parameter matrix; calculate based on a preset second diffusion formula and the diffusion parameters to obtain a second diffusion parameter matrix; calculate based on a preset third diffusion formula, the face image pixel matrix to be diffused, the first diffusion parameter matrix, and the second diffusion parameter matrix to obtain the face image pixel matrix to be fused.

[0128] In an implementation manner of Embodiment 1 of the present application, the diffusion module 1612 is specifically configured to: calculate based on a preset fourth diffusion formula and the background image pixel matrix to be diffused to obtain a fourth diffusion parameter matrix; calculate based on a preset fifth diffusion formula and the diffusion parameters to obtain a fifth diffusion parameter matrix; calculate based on a preset pixel bit formula, the background image pixel matrix to be diffused, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and a combination value formula to obtain a combination value; calculate based on a preset sixth diffusion formula, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and the combination value to obtain the background pixel image matrix to be fused.

[0129] In an implementation manner of Embodiment 1 of the present application, the global scrambling module 1616 is specifically configured to: start from the first column of the fused image pixel matrix, traverse the pixels of all odd rows until the traversal is completed, and execute obtaining the pixel value at the pixel position i = 1, j = 1 as the starting value and putting it into the matrix, updating the values of i and j, putting the pixel value at the new pixel position obtained after i = i + 1 into the matrix, putting the pixel value at another new pixel position obtained after increasing j by 1 into the matrix, until i > M; where M is the number of all rows of the fused image pixel matrix; traverse the fused image pixel matrix starting from the even columns of the first row until all even columns are traversed, and execute obtaining the starting position of the current j column, setting i = 1, obtaining the pixel value at the pixel position of i, j and putting it into the matrix, keeping i unchanged, putting the pixel value at the new pixel position obtained after increasing the value of j by 1 into the matrix, keeping j unchanged, putting the pixel value at another new pixel position obtained after i = i + 1 into the matrix, until j > M, to obtain the encrypted image.

[0130] The image encryption device based on a spatio-temporal chaotic system provided in the embodiments of the present application obtains a to-be-processed image, inputs the to-be-processed image into a preset hash algorithm for processing to generate a key array; inputs the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; performs a separation process on the to-be-processed image to obtain a face image and a background image, and respectively performs a local scrambling process on the face image and the background image based on the scrambling parameter to obtain a to-be-diffused face image pixel matrix and a to-be-diffused background image pixel matrix; respectively performs a diffusion process on the to-be-diffused face image pixel matrix and the to-be-diffused background image pixel matrix based on the diffusion parameter to obtain a to-be-fused face image pixel matrix and a to-be-fused background pixel image matrix; performs a fusion process on the to-be-fused face image pixel matrix and the to-be-fused background image pixel matrix to obtain a fused image pixel matrix, and performs a global scrambling on the fused image pixel matrix to obtain an encrypted image. It solves the technical problems of low security and efficiency of existing image encryption. By generating a key based on the to-be-processed image and inputting it into the spatio-temporal chaotic system for iteration, a perturbation and confusion factor for image encryption is generated, which not only ensures the close connection between the key and the plaintext, but also ensures the uniqueness of the key; separates the face information and the background information, encrypts the pixel values for the face information, encrypts the pixel bits for the background information, and combines the local scrambling and the global scrambling methods to further ensure the security of the face information and the efficiency of encryption.

[0131] For the specific limitations of the image encryption device based on the spatio-temporal chaotic system, reference can be made to the limitations of the image encryption method based on the spatio-temporal chaotic system in the foregoing text, which will not be elaborated here. Each module in the above-mentioned image encryption device based on the spatio-temporal chaotic system can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in the processor in the electronic device in hardware form or independent of the processor, or stored in the memory in the electronic device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above-mentioned modules.

[0132] In one embodiment, an electronic device is provided. The electronic device can be a terminal, and its internal structure diagram can be as Figure 17 shown. The electronic device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a carrier network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it realizes an image encryption method based on the spatio-temporal chaotic system. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, a touchpad, or a mouse, etc.

[0133] Those skilled in the art can understand that Figure 17 the structure shown in

[0134] In one embodiment, the image encryption device based on the spatio-temporal chaotic system provided by the present application can be implemented in the form of a computer program, and the computer program can run on an electronic device as Figure 17 shown. Each program module constituting the image encryption device based on the spatio-temporal chaotic system can be stored in the memory of the electronic device. For example, Figure 16The computer program composed of the program modules 1602, 1604, 1606, 1608, 1610, 1612, 1614, and 1616 enables the processor to execute the steps of the image encryption method based on the spatiotemporal chaotic system according to the various embodiments of the present application described in this specification.

[0135] For example, Figure 17 The electronic device shown can be Figure 16 The acquisition module 1602 and the generation module 1604 in the image encryption device based on the spatiotemporal chaotic system shown in the figure perform step 202. The electronic device can perform step 204 through the processing module 1606. The electronic device can perform step 206 through the separation module 1608 and the local scrambling module 1610. The electronic device can perform step 208 through the diffusion module 1612. The electronic device can perform step 210 through the fusion module 1614 and the global scrambling module 1616.

[0136] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: Step 202, obtaining an image to be processed, and inputting the image to be processed into a preset hash algorithm for processing to generate a key array; Step 204, inputting the key array into a preset spatiotemporal chaotic system for processing to obtain scrambling parameters and diffusion parameters; Step 206, separating the image to be processed to obtain a face image and a background image, and locally scrambling the face image and the background image based on the scrambling parameters to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; Step 208, diffusion processing is performed on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused based on the diffusion parameters to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background image to be fused; Step 210, fusing the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a pixel matrix of a fused image, and globally scrambling the pixel matrix of the fused image to obtain an encrypted image.

[0137] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: Step 202, obtain an image to be processed, and input the image to be processed into a preset hash algorithm for processing to generate a key array; Step 204, input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; Step 206, perform a separation process on the image to be processed to obtain a face image and a background image, and perform local scrambling on the face image and the background image respectively based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; Step 208, perform diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused respectively based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background image to be fused; Step 210, perform a fusion process on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a pixel matrix of the fused image, and perform global scrambling on the pixel matrix of the fused image to obtain an encrypted image.

[0138] In one embodiment, the step of inputting the image to be processed into a preset hash algorithm for processing to generate a key array includes: calculating the image to be processed based on the SHA-256 hash algorithm to generate a first number of hexadecimal numbers; forming a group for every two hexadecimal numbers, and converting a second number of groups of hexadecimal numbers into decimal numbers and storing them in the key array.

[0139] In one embodiment, the scrambling parameters include a scrambled row sequence, a scrambled row direction sequence, a scrambled column sequence, and a scrambled column direction sequence. The local scrambling process of the face image based on the scrambling parameters to obtain a pixel matrix of the face image to be diffused includes: obtaining the pixel matrix of the face image, and adding the scrambled row sequence to the first row of the pixel matrix of the face image to obtain a first pixel matrix of the face image; sorting each column of the first pixel matrix of the face image based on the values of the scrambled row sequence to obtain a second pixel matrix of the face image; adding the scrambled row direction sequence to the first row of the second pixel matrix of the face image to obtain a third pixel matrix of the face image; cyclically shifting the pixel values of the third pixel matrix of the face image downward based on the values of the scrambled row direction sequence to obtain a fourth pixel matrix of the face image; adding the scrambled column sequence to the first column of the fourth pixel matrix of the face image to obtain a fifth pixel matrix of the face image; sorting each row of the fifth pixel matrix of the face image based on the values of the scrambled column sequence to obtain a sixth pixel matrix of the face image; adding the scrambled column direction sequence to the first row of the sixth pixel matrix of the face image to obtain a seventh pixel matrix of the face image; cyclically shifting the pixel values of the seventh pixel matrix of the face image to the right based on the values of the scrambled column direction sequence to obtain an eighth pixel matrix of the face image as the pixel matrix of the face image to be diffused.

[0140] In one embodiment, the scrambling parameters include a scrambled row sequence, a scrambled row direction sequence, a scrambled column sequence, and a scrambled column direction sequence. The local scrambling process of the background image based on the scrambling parameters to obtain a pixel matrix of the background image to be diffused includes: obtaining the pixel matrix of the background image, and adding the scrambled row sequence to the first row of the pixel matrix of the background image to obtain a first pixel matrix of the background image; sorting each column of the first pixel matrix of the background image based on the values of the scrambled row sequence to obtain a second pixel matrix of the background image; adding the scrambled row direction sequence to the first row of the second pixel matrix of the background image to obtain a third pixel matrix of the background image; cyclically shifting the pixel values of the third pixel matrix of the background image downward based on the values of the scrambled row direction sequence to obtain a fourth pixel matrix of the background image; adding the scrambled column sequence to the first column of the fourth pixel matrix of the background image to obtain a fifth pixel matrix of the background image; sorting each row of the fifth pixel matrix of the background image based on the values of the scrambled column sequence to obtain a sixth pixel matrix of the background image; adding the scrambled column direction sequence to the first row of the sixth pixel matrix of the background image to obtain a seventh pixel matrix of the background image; cyclically shifting the pixel values of the seventh pixel matrix of the background image to the right based on the values of the scrambled column direction sequence to obtain an eighth pixel matrix of the background image as the pixel matrix of the background image to be diffused.

[0141] In one embodiment, performing diffusion processing on the pixel matrix of the face image to be diffused based on the diffusion parameter to obtain a pixel matrix of the face image to be fused includes: calculating based on a preset first diffusion formula and the diffusion parameter to obtain a first diffusion parameter matrix; calculating based on a preset second diffusion formula and the diffusion parameter to obtain a second diffusion parameter matrix; calculating based on a preset third diffusion formula, the pixel matrix of the face image to be diffused, the first diffusion parameter matrix, and the second diffusion parameter matrix to obtain the pixel matrix of the face image to be fused.

[0142] In one embodiment, performing diffusion processing on the pixel matrix of the background image to be diffused based on the diffusion parameter to obtain a pixel matrix of the fused background image includes: calculating based on a preset fourth diffusion formula and the pixel matrix of the background image to be diffused to obtain a fourth diffusion parameter matrix; calculating based on a preset fifth diffusion formula and the diffusion parameter to obtain a fifth diffusion parameter matrix; calculating based on a preset pixel bit formula, the pixel matrix of the background image to be diffused, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and a combination value formula to obtain a combination value; calculating based on a preset sixth diffusion formula, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and the combination value to obtain the pixel matrix of the fused background image.

[0143] In one embodiment, globally scrambling the pixel matrix of the fused image to obtain an encrypted image includes: starting from the first column of the pixel matrix of the fused image, traversing the pixels of all odd rows until the traversal is completed, and executing obtaining the pixel value at the pixel position i = 1, j = 1 as the starting value and putting it into the matrix, updating the values of i and j, putting the pixel value at the new pixel position after i = i + 1 into the matrix, putting the pixel value at another new pixel position after j is increased by 1 into the matrix until i > M; where M is the total number of rows of the pixel matrix of the fused image; starting from the even columns of the first row, traversing the pixel matrix of the fused image until all even columns are traversed, and executing obtaining the starting position of the current j column, setting i = 1, obtaining the pixel value at the pixel position i, j and putting it into the matrix, keeping i unchanged, putting the pixel value at the new pixel position after j is increased by 1 into the matrix, keeping j unchanged, putting the pixel value at another new pixel position after i = i + 1 into the matrix until j > M to obtain the encrypted image.

[0144] By obtaining the image to be processed and inputting the image to be processed into a preset hash algorithm for processing to generate a key array; inputting the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; separating the image to be processed to obtain a face image and a background image, and respectively performing local scrambling processing on the face image and the background image based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; respectively performing diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background pixel image to be fused; performing fusion processing on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a fused image pixel matrix, and performing global scrambling on the fused image pixel matrix to obtain an encrypted image. It solves the technical problems of low security and efficiency of existing image encryption. By generating a key based on the image to be processed and inputting it into a spatio-temporal chaotic system for iteration, a perturbation and confusion factor for image encryption is generated, which not only ensures the close connection between the key and the plaintext, but also ensures the uniqueness of the key; separating the face information and the background information, encrypting the pixel values for the face information and encrypting the pixel bits for the background information, and combining the local scrambling and global scrambling methods further ensures the security of the face information and the encryption efficiency.

[0145] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, a database or other media provided in the various embodiments of the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static random access memory (SRAM) and dynamic random access memory (DRAM).

[0146] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0147] The embodiments described above merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. An image encryption method based on a spatio-temporal chaotic system, characterized in that, Including: Obtain an image to be processed, and input the image to be processed into a preset hash algorithm for processing to generate a key array; Input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; Perform a separation process on the image to be processed to obtain a face image and a background image, and perform local scrambling processing on the face image and the background image respectively based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused and a pixel matrix of the background image to be diffused; Perform diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused respectively based on the diffusion parameter to obtain a pixel matrix of the face image to be fused and a pixel matrix of the background pixel image to be fused; Perform a fusion process on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a pixel matrix of the fused image, and perform global scrambling on the pixel matrix of the fused image to obtain an encrypted image.

2. The image encryption method based on a spatio-temporal chaotic system according to claim 1, characterized in that The step of inputting the image to be processed into a preset hash algorithm for processing to generate a key array includes: Perform a calculation on the image to be processed based on the SHA-256 hash algorithm to generate a first number of hexadecimal numbers; Group every two hexadecimal numbers, and convert a second number of groups of hexadecimal numbers into decimal numbers and store them in the key array.

3. The image encryption method based on a spatio-temporal chaotic system according to claim 1, characterized in that, The scrambling parameter includes a scrambling row sequence, a scrambling row direction sequence, a scrambling column sequence, and a scrambling column direction sequence. The step of performing local scrambling processing on the face image based on the scrambling parameter to obtain a pixel matrix of the face image to be diffused includes: Obtain a pixel matrix of the face image, and add the scrambling row sequence to the first row of the pixel matrix of the face image to obtain a first pixel matrix of the face image; Sort each column of the first pixel matrix of the face image based on the value of the scrambling row sequence to obtain a second pixel matrix of the face image; Add the scrambling row direction sequence to the first row of the second pixel matrix of the face image to obtain a third pixel matrix of the face image; Circularly shift the pixel values of the third pixel matrix of the face image downward based on the value of the scrambling row direction sequence to obtain a fourth pixel matrix of the face image; Add the scrambling column sequence to the first column of the fourth pixel matrix of the face image to obtain a fifth pixel matrix of the face image; Sort each row of the fifth pixel matrix of the face image based on the value of the scrambling column sequence to obtain a sixth pixel matrix of the face image; Add the scrambling column direction sequence to the first row of the sixth pixel matrix of the face image to obtain a seventh pixel matrix of the face image; Circularly shift the pixel values of the seventh pixel matrix of the face image to the right based on the value of the scrambling column direction sequence to obtain an eighth pixel matrix of the face image as the pixel matrix of the face image to be diffused.

4. The image encryption method based on a spatio-temporal chaotic system according to claim 1, wherein The scrambling parameter includes a scrambling row sequence, a scrambling row direction sequence, a scrambling column sequence, and a scrambling column direction sequence. The step of performing local scrambling processing on the background image based on the scrambling parameter to obtain a pixel matrix of the background image to be diffused includes: Obtain the background image pixel matrix of the background image, and add the scrambled row sequence to the first row of the background image pixel matrix to obtain the first background image pixel matrix; Sort each column of the first background image pixel matrix based on the values of the scrambled row sequence to obtain the second background image pixel matrix; Add the scrambled row direction sequence to the first row of the second background image pixel matrix to obtain the third background image pixel matrix; Circularly shift the pixel values of the third background image pixel matrix downward based on the values of the scrambled row direction sequence to obtain the fourth background image pixel matrix; Add the scrambled column sequence to the first column of the fourth background image pixel matrix to obtain the fifth background image pixel matrix; Sort each row of the fifth background image pixel matrix based on the values of the scrambled column sequence to obtain the sixth background image pixel matrix; Add the scrambled column direction sequence to the first row of the sixth background image pixel matrix to obtain the seventh background image pixel matrix; Circularly shift the pixel values of the seventh background image pixel matrix to the right based on the values of the scrambled column direction sequence to obtain the eighth background image pixel matrix as the background image pixel matrix to be diffused.

5. The image encryption method based on a spatio-temporal chaotic system according to claim 1, characterized in that, The diffusion process of the face image pixel matrix to be diffused based on the diffusion parameter to obtain the face image pixel matrix to be fused includes: Calculate based on a preset first diffusion formula and the diffusion parameter to obtain a first diffusion parameter matrix; Calculate based on a preset second diffusion formula and the diffusion parameter to obtain a second diffusion parameter matrix; Calculate based on a preset third diffusion formula, the face image pixel matrix to be diffused, the first diffusion parameter matrix, and the second diffusion parameter matrix to obtain the face image pixel matrix to be fused.

6. The image encryption method based on a spatiotemporal chaotic system according to claim 1, wherein The diffusion process of the background image pixel matrix to be diffused based on the diffusion parameter to obtain the background pixel image matrix to be fused includes: Calculate based on a preset fourth diffusion formula and the background image pixel matrix to be diffused to obtain a fourth diffusion parameter matrix; Calculate based on a preset fifth diffusion formula and the diffusion parameter to obtain a fifth diffusion parameter matrix; Calculate based on a preset pixel bit formula, the background image pixel matrix to be diffused, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and a combination value formula to obtain a combination value; Calculate based on a preset sixth diffusion formula, the fourth diffusion parameter matrix, the fifth diffusion parameter matrix, and the combination value to obtain the background pixel image matrix to be fused.

7. The image encryption method based on a spatio-temporal chaotic system according to claim 1, characterized in that, The global scrambling of the fused image pixel matrix to obtain the encrypted image includes: Starting from the first column of the fused image pixel matrix, traverse the pixels of all odd rows until the traversal is completed. Execute to obtain the pixel value at the pixel position i = 1, j = 1 as the starting value and put it into the matrix, update the values of i and j, put the pixel value at the new pixel position obtained after i = i + 1 into the matrix, put the pixel value at another new pixel position obtained after increasing j by 1 into the matrix until i > M; where M is the total number of rows of the fused image pixel matrix. Traverse the fused image pixel matrix starting from the even columns of the first row until all even columns are traversed. Execute to obtain the starting position of the current j column, set i = 1, obtain the pixel value at the pixel position i, j and put it into the matrix, keep i unchanged, put the pixel value at the new pixel position obtained after increasing the value of j by 1 into the matrix, keep j unchanged, put the pixel value at another new pixel position obtained after i = i + 1 into the matrix until j > M to obtain the encrypted image.

8. An image encryption device based on a spatio-temporal chaotic system, characterized in that, The device includes: An acquisition module, configured to acquire an image to be processed; A generation module, configured to input the image to be processed into a preset hash algorithm for processing to generate a key array; A processing module, configured to input the key array into a preset spatio-temporal chaotic system for processing to obtain a scrambling parameter and a diffusion parameter; A separation module, configured to perform a separation process on the image to be processed to obtain a face image and a background image; A local scrambling module, configured to perform local scrambling processing on the face image and the background image respectively based on the scrambling parameter to obtain a pixel matrix of a face image to be diffused and a pixel matrix of a background image to be diffused; A diffusion module, configured to perform diffusion processing on the pixel matrix of the face image to be diffused and the pixel matrix of the background image to be diffused respectively based on the diffusion parameter to obtain a pixel matrix of a face image to be fused and a pixel matrix of a background pixel image to be fused; A fusion module, configured to perform a fusion process on the pixel matrix of the face image to be fused and the pixel matrix of the background image to be fused to obtain a fused image pixel matrix; A global scrambling module, configured to perform global scrambling on the fused image pixel matrix to obtain an encrypted image.

9. An electronic device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7.