Image encryption method and device and terminal equipment
By performing color space conversion, position coding and semantic analysis processing on image information, combined with iterative calculation of multi-dimensional encryption mapping functions, the problem that existing image encryption technology is easily cracked is solved, achieving higher security and robustness.
Patent Information
- Application Number
- CN202510771968.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-11
AI Technical Summary
Existing image encryption technology is easy to crack and cannot withstand a variety of attacks, resulting in poor encryption effects and reducing network communication security.
By performing color space conversion, position encoding and semantic analysis processing on the encrypted image information, multiple initial encrypted image information are generated, and iterative mapping calculation is performed using multi-dimensional encryption mapping functions to increase the complexity and confusion of image encryption.
It improves the robustness and security of image encryption, enhances the ability of image information to resist attacks during the Internet transmission process, and ensures information security.
Smart Images

Figure CN120281854A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of image processing, and particularly relates to an image encryption method, apparatus, and terminal device. Background Art
[0002] With the development of the Internet and image technology, pictures have become important information carriers and play a key role in many fields such as medical, military, and finance. However, when images are transmitted in plain text over the public network, information security is threatened. Therefore, there is an urgent need to design a highly secure encryption algorithm.
[0003] In the prior art, usually the discrete cosine transform method is adopted to transform the image from the spatial domain to the frequency domain for processing the frequency domain coefficients to achieve image encryption; or the discrete wavelet transform method is used to decompose the image into multiple sub-bands with different frequencies and resolutions, and then different operations are performed on the multiple sub-bands respectively to achieve the encryption processing of the image.
[0004] However, the encryption using the discrete cosine transform is simple, making it extremely easy for attackers to crack the encryption method and steal image information easily; the discrete wavelet transform cannot resist various attack means and has strong limitations in terms of security and encryption effect. Summary of the Invention
[0005] In view of this, embodiments of this application provide an image encryption method, apparatus, and terminal device, aiming to solve the problems in the existing image encryption technology that it is extremely easy to be cracked, cannot resist various attacks, resulting in poor encryption effect and reducing the security of users for network communication.
[0006] The first aspect of the embodiments of this application provides an image encryption method, including: Obtain the image information to be encrypted; Perform color space conversion, position encoding processing, and semantic parsing processing on the image information to be encrypted to generate multiple initial encrypted image information; According to the preset multi-dimensional encryption mapping iteration times and multiple preset multi-dimensional encryption mapping functions, perform iterative mapping calculations on the multiple initial encrypted image information to generate multiple intermediate encrypted image information; Perform weighted calculation on the multiple intermediate encrypted image information to generate the target encrypted image information.
[0007] The second aspect of the embodiments of this application provides an image decryption method, including: Obtain the encrypted image information; Perform decomposition calculation on the encrypted image information to obtain multiple initial decrypted image information; Perform back-mapping iterative calculations on the multiple pieces of initial decryption image information according to a preset number of multi-dimensional encryption mapping iteration times and multiple preset multi-dimensional encryption mapping functions to generate multiple pieces of intermediate decryption image information; Perform semantic reconstruction processing, position decoding processing, and inverse color space conversion on the intermediate decryption image information to generate target decryption image information.
[0008] A third aspect of the embodiments of the present application provides an image encryption device, including: An encrypted image information acquisition module, configured to acquire encrypted image information; An initial encrypted image information generation module, configured to perform color space conversion, position encoding processing, and semantic parsing processing on the encrypted image information to generate multiple pieces of initial encrypted image information; An intermediate encrypted image information generation module, configured to perform iterative mapping calculations on the multiple pieces of initial encrypted image information according to a preset number of multi-dimensional encryption mapping iteration times and multiple preset multi-dimensional encryption mapping functions to generate multiple pieces of intermediate encrypted image information; A target encrypted image information generation module, configured to perform weighted calculations on the multiple pieces of intermediate encrypted image information to generate target encrypted image information.
[0009] A fourth aspect of the embodiments of the present application provides an image decryption device, including: A decrypted image information acquisition module, configured to acquire decrypted image information; An initial decryption image information determination module, configured to perform decomposition calculations on the decrypted image information to obtain multiple pieces of initial decryption image information; An intermediate decryption image information generation module, configured to perform back-mapping iterative calculations on the multiple pieces of initial decryption image information according to a preset number of multi-dimensional encryption mapping iteration times and multiple preset multi-dimensional encryption mapping functions to generate multiple pieces of intermediate decryption image information; A target decryption image information generation module, configured to perform semantic reconstruction processing, position decoding processing, and inverse color space conversion on the intermediate decryption image information to generate target decryption image information.
[0010] A fifth aspect of the embodiments of the present application provides a terminal device, the terminal device includes a memory and a processor, and a computer program that can run on the processor is stored on the memory. When the processor executes the computer program, the steps of the image encryption method described in the first aspect above are implemented.
[0011] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: performing color space conversion, position encoding, and semantic parsing processing on the image information to be encrypted, which is used to decompose and hide the original information of the image from multiple dimensions, increasing the complexity of image encryption. Then, iterative mapping calculations are performed through multiple multi-dimensional encryption mapping functions to further confuse the image features, making it difficult to crack the image information after multiple transformations, thereby improving the robustness of image encryption, enhancing the ability of the image information to resist attacks during the Internet transmission process, and effectively ensuring the security of the encrypted image information. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0013] Figure 1 It is a schematic flowchart of the implementation of the image encryption method provided in the first embodiment of the present application; Figure 2 It is a schematic flowchart of the implementation of the image encryption method provided in the second embodiment of the present application; Figure 3 It is a schematic flowchart of the implementation of the image encryption method provided in the third embodiment of the present application; Figure 4 It is a schematic flowchart of the implementation of the image encryption method provided in the fourth embodiment of the present application; Figure 5 It is a schematic flowchart of the implementation of the image decryption method provided in the fifth embodiment of the present application; Figure 6 It is a schematic flowchart of the implementation of the image decryption method provided in the sixth embodiment of the present application; Figure 7 It is a schematic flowchart of the implementation of the image decryption method provided in the seventh embodiment of the present application; Figure 8 It is a schematic structural diagram of the image encryption device provided in the embodiments of the present application; Figure 9 It is a schematic structural diagram of the image decryption device provided in the embodiments of the present application; Figure 10 It is a schematic diagram of the terminal device provided in the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0014] In the following description, specific details such as specific system architectures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0015] In order to illustrate the technical solutions described in the present application, the following will be described through specific embodiments.
[0016] Figure 1 The implementation flowchart of the image encryption method provided in the first embodiment of the present application is shown and described in detail as follows: Step S101, obtain the image information to be encrypted.
[0017] In this embodiment, the image information to be encrypted can be various medical images of patients in the medical field, such as X-ray films, CT scan images, magnetic resonance imaging images, etc., which can be generated by medical devices and transmitted to a computer through the medical devices for acquisition; the image information to be encrypted can be satellite reconnaissance images or drone captured images in the military and national defense fields. Among them, satellite reconnaissance images can be obtained by high-resolution imaging devices carried by satellites orbiting the earth, and drones can collect images in a military environment with the imaging devices they carry; the image to be encrypted can be user bank card photos, ID card scan copies, transaction bill images, etc. in the financial industry. When users conduct online payment, account opening and other financial operations, they are required to upload relevant certificate photos or bill images as required, and these image information are obtained by financial institutions, which may include user identity information, account information, and transaction details, etc. To ensure the security of financial transactions and user privacy, encryption processing is required.
[0018] Step S102, perform color space conversion, position encoding processing, and semantic parsing processing on the image information to be encrypted to generate multiple initial encrypted image information.
[0019] In this embodiment, the color space conversion of the image information to be encrypted can be performed through the YCrCb model, or the RBG model, or the HSV model. The image information to be encrypted can be decomposed into multiple luminance component information and color component information. Then, position encoding processing is performed on the multiple luminance component information and color component information obtained by decomposition. Specifically, the position encoding processing can be performed in the form of one-hot encoding, or in the form of absolute position encoding, or in the form of relative encoding, so as to reflect and characterize the features of the image information to be encrypted, facilitating the subsequent calculation in the encryption process. The semantic parsing processing can be implemented through scale-invariant feature transform or histogram of oriented gradients, which helps the computer deeply understand the image content and identify the areas containing sensitive information in the image, so as to implement multiple encryptions for the sensitive information part in the subsequent process, improving the encryption security and avoiding over-encryption of unimportant areas, reducing the waste of computing resources. Therefore, in this embodiment, the image to be encrypted is decomposed into multiple color component information through color space conversion, and then position encoding processing is performed on these color component information to quantify each feature in the color component information. Then, semantic parsing processing is performed on the quantified image features. It can be to generate initial encrypted image information for the part containing sensitive information recognized by semantics, or to use the semantic information of all image features as the initial encrypted image information.
[0020] Step S103: According to the preset number of multi-dimensional encryption mapping iterations and multiple preset multi-dimensional encryption mapping functions, perform iterative mapping calculations on the multiple initial encrypted image information to generate multiple intermediate encrypted image information.
[0021] In this embodiment, the multiple preset multi-dimensional encryption mapping functions can be Logistic mapping functions, or Tent mapping functions, or Henon mapping functions, or Lorenz mapping functions, or hyperbolic tangent functions, or Sigmoid functions, or ReLU functions. The multiple preset multi-dimensional encryption mapping functions can be the same or different. The preset number of multi-dimensional encryption mapping iterations can be set manually, which can be 5 times or 10 times.
[0022] In this embodiment, optionally, multiple initial encrypted image information can be used as the independent variables of the preset multi-dimensional encryption mapping functions first. Through multiple iterative calculations of the multi-dimensional encryption mapping functions, the calculation results are used as multiple intermediate encrypted image information, where the number of iterative calculations is determined by the number of multi-dimensional encryption mapping iterations.
[0023] In this embodiment, optionally, the parameters of the multi-dimensional encryption mapping function may be set first, then the solutions of the equations formed by the multi-dimensional encryption mapping function are solved, and then the obtained solutions are XOR-operated with the initial encrypted image information, or the obtained solutions are used to generate a matrix, and then the matrix is convolved with the matrix generated by the initial encrypted image information to obtain the intermediate encrypted image information. It can be understood that one initial encrypted image information corresponds to one intermediate encrypted image information.
[0024] Step S104: Perform weighted calculation on the multiple pieces of intermediate encrypted image information to generate target encrypted image information.
[0025] In this embodiment, it may be to calculate the Euclidean distance between each piece of intermediate encrypted image information and the initial encrypted image information, use the Euclidean distance as the weight of each piece of intermediate encrypted image information, and then perform weighted summation on each piece of intermediate encrypted image information, and the calculation result is used as the target encrypted image information. It may also be to perform weighted summation calculation on each piece of intermediate encrypted image information through preset weight information, and the calculation result is used as each piece of target encrypted image information, where the preset weight information may be set manually. It may also be to manually set the weights for each color component information, classify each intermediate encrypted image according to the color component information first, then sum the intermediate encrypted image information corresponding to different color component information respectively, and then perform weighted summation processing on the sum of the intermediate encrypted image information corresponding to each color component information according to the preset weights of each color component information, and the calculation result is used as the target encrypted image information.
[0026] The image encryption method provided by the embodiment of the present application performs color space conversion, position coding, and semantic parsing processing on the image information to be encrypted, is used to decompose and hide the original information of the image from multiple dimensions, increases the complexity of image encryption, and then performs iterative mapping calculations through multiple multi-dimensional encryption mapping functions to further confuse the image features, making it difficult to crack the image information after multiple transformations, thereby improving the robustness of image encryption, enhancing the ability of the image information to resist attacks during Internet transmission, and effectively ensuring the security of the encrypted image information.
[0027] Figure 2 The flowchart showing the implementation of the image encryption method provided by the second embodiment of the present application is different from the first embodiment above in that: step S102 specifically includes: Step S201: Perform color space conversion on the image information to be encrypted to obtain multiple pieces of color component information of the image to be encrypted.
[0028] In this embodiment, the color space conversion of the image information to be encrypted can be implemented through the RGB model, the YCrCb model, or the HSV model. The image information after color space conversion is the color component information of the image to be encrypted.
[0029] Step S202: Generate multiple color component matrix information of the images to be encrypted according to the multiple color component information of the images to be encrypted.
[0030] In this embodiment, the gray values of each pixel in the color component information of the image to be encrypted can be used to generate a matrix as the color component matrix information of the image to be encrypted, or the color component information of the image to be encrypted can be converted into a matrix through OpenCV as the color component matrix information of the image to be encrypted.
[0031] Step S203: Extract elements from the multiple color component matrix information of the images to be encrypted to obtain the number of rows of the color component matrix of the image to be encrypted, the number of columns of the color component matrix of the image to be encrypted, multiple elements of the color component matrix of the image to be encrypted, the number of rows of multiple elements of the color component matrix of the image to be encrypted, and the number of columns of multiple elements of the color component matrix of the image to be encrypted; where the elements of the color component matrix of the image to be encrypted correspond one-to-one to the number of rows of the elements of the color component matrix of the image to be encrypted and the number of columns of the elements of the color component matrix of the image to be encrypted.
[0032] In this embodiment, each value in each color component matrix information of the image to be encrypted is extracted. Each value is an element of the matrix. It is necessary to extract the corresponding numerical information of the element, the number of rows in the matrix, and the number of columns in the matrix. Then, the elements of the color component matrix of the image to be encrypted, the number of rows of the elements of the color component matrix of the image to be encrypted, and the number of columns of the elements of the color component matrix of the image to be encrypted are extracted. At the same time, the number of rows of the color component matrix of the image to be encrypted and the number of columns of the color component matrix of the image to be encrypted can be obtained according to the color component matrix information of the image to be encrypted.
[0033] Step S204: Determine whether both the number of rows of the elements of the color component matrix of the image to be encrypted and the number of columns of the elements of the color component matrix of the image to be encrypted are not equal to 1; if so, when the number of rows of the elements of the color component matrix of the image to be encrypted is not equal to the number of rows of the color component matrix of the image to be encrypted, and the number of rows of the elements of the color component matrix of the image to be encrypted is not equal to the number of columns of the color component matrix of the image to be encrypted, then calculate the sum of the number of rows and the number of columns of each element of the color component matrix of the image to be encrypted; if not, skip the elements of the color component matrix of the image to be encrypted.
[0034] In this embodiment, when both the row information of the elements of the color component matrix of the image to be encrypted and the column information of the elements of the color component matrix of the image to be encrypted are equal to 1, the element of the color component matrix of the image to be encrypted is skipped, and the recognition of other elements of the color component matrix of the image to be encrypted is performed until all elements of the color component matrix of the image to be encrypted are traversed; when both the row information of the elements of the color component matrix of the image to be encrypted and the column information of the elements of the color component matrix of the image to be encrypted are not equal to 1, it is determined whether the condition that the row information of the element of the color component matrix of the image to be encrypted is not equal to the row information of the color component matrix of the image to be encrypted and the row information of the element of the color component matrix of the image to be encrypted is not equal to the column information of the color component matrix of the image to be encrypted holds. If it holds, the sum of the row information and the column information of each element of the color component matrix of the image to be encrypted is calculated, that is, the sum of the row and column of the same element of the color component matrix of the image to be encrypted is calculated, and subsequent calculations are then performed; if it does not hold, the element of the color component matrix of the image to be encrypted is skipped, and the recognition of other elements of the color component matrix of the image to be encrypted is performed until all elements of the color component matrix of the image to be encrypted are traversed.
[0035] Step S205, determine whether the sum of the row information and the column information of the first element of the color component matrix of the image to be encrypted is equal to the sum of the row information and the column information of the second element of the color component matrix of the image to be encrypted. If so, an array of elements of the color component matrix of the image to be encrypted is generated according to the first element and the second element of the color component matrix of the image to be encrypted; if not, the first element and the second element of the color component matrix of the image to be encrypted are skipped.
[0036] In this embodiment, taking the elements of the color component matrix of the first image to be encrypted and the elements of the color component matrix of the second image to be encrypted as examples, the elements of the color component matrix of the first image to be encrypted and the elements of the color component matrix of the second image to be encrypted can be any two elements among all the elements of the color component matrix of the images to be encrypted. When the sum of the row information and the column information of the element of the color component matrix of the first image to be encrypted is equal to the sum of the row information and the column information of the element of the color component matrix of the second image to be encrypted, then the element of the color component matrix of the first image to be encrypted and the element of the color component matrix of the second image to be encrypted are extracted to generate an array. It can be understood that in this embodiment, only the two elements of the element of the color component matrix of the first image to be encrypted and the element of the color component matrix of the second image to be encrypted are taken as examples. If the sum of the row information and the column information of other elements of the color component matrix of the third image to be encrypted or the fourth image to be encrypted is the same as the sum of the row information and the column information of the element of the color component matrix of the first image to be encrypted, then the elements of the color component matrix of the third image to be encrypted or the fourth image to be encrypted can be extracted and used together with the element of the color component matrix of the first image to be encrypted and the element of the color component matrix of the second image to be encrypted as the elements in the array, so that the generated array is used as the array of elements of the color component matrix of the image to be encrypted; when the sum of the row information and the column information of the element of the color component matrix of the first image to be encrypted is not equal to the sum of the row information and the column information of the element of the color component matrix of the second image to be encrypted, then the matching of the element of the first image to be encrypted and the element of the second image to be encrypted is skipped, and then the matching of the element of the first image to be encrypted and the element of the third image to be encrypted is performed, that is, to judge whether the sum of the row information and the column information of the element of the first image to be encrypted is equal to the sum of the row information and the column information of the element of the third image to be encrypted, until all the elements of the color component matrix of the images to be encrypted find other elements of the color component matrix of the images to be encrypted with the same sum of the row information and the column information. One-dimensional arrays are generated from all the elements of the color component matrix of the images to be encrypted with the same sum of the row information and the column information. Different sums of the row information and the column information correspond to different one-dimensional arrays. The sum of the row information and the column information of all the elements of the color component matrix of the images to be encrypted in the same one-dimensional array is the same, and these one-dimensional arrays are output as the array of elements of the color component matrix of the image to be encrypted.
[0037] Step S206: According to the preset splicing rule of the encrypted image coding array, splice the array of elements of the color component matrix of the image to be encrypted, the elements with the row information and column information of the elements of the color component matrix of the image to be encrypted both equal to 1, and the elements with the row information of the elements of the color component matrix of the image to be encrypted equal to the row information of the color component matrix of the image to be encrypted and the row information of the elements of the color component matrix of the image to be encrypted equal to the column information of the color component matrix of the image to be encrypted, to obtain the coding information of the color component matrix of the image to be encrypted.
[0038] In this embodiment, the preset splicing rule of the encrypted image coding array can be set artificially. First, the elements with the row information and column information of the elements of the color component matrix of the image to be encrypted both equal to 1 are used as the first element in the first row and first column of the coding information of the color component matrix of the image to be encrypted. Then, the elements with the row information of the elements of the color component matrix of the image to be encrypted equal to the row information of the color component matrix of the image to be encrypted and the row information of the elements of the color component matrix of the image to be encrypted equal to the column information of the color component matrix of the image to be encrypted are used as the last element in the last row and last column of the coding information of the color component matrix of the image to be encrypted. Then, according to the generation order of the array of elements of the color component matrix of the image to be encrypted, the array of elements of the color component matrix of the image to be encrypted is arranged to form the middle elements of the coding information of the color component matrix of the image to be encrypted except for the first element in the first row and first column and the last element in the last row and last column, so as to generate the coding information of the color component matrix of the image to be encrypted.
[0039] Step S207: Based on the preset image semantic parsing model, perform semantic parsing processing on the coding information of the color component matrix of the image to be encrypted to generate multiple initial encrypted image information.
[0040] In this embodiment, the preset image semantic parsing model can be set artificially and can be defaulted to a model that has been trained. It can be a convolutional neural network model, an LLM model, or other Transformer-based models, that is, a model composed of multiple Transformers. It can be used to assign semantic labels to the encoded information of the color component matrix of the image to be encrypted, so as to perform segmentation processing on the semantic information of the encoded information of the color component matrix of the image to be encrypted. The pixel information of the private part can be used as the initial encrypted image information, or it can be used to capture the connections between the various features of the encoded information of the color component matrix of the image to be encrypted, so as to further confuse these connections in the subsequent process to achieve deep encryption processing. It can be to use the encoded information of the color component matrix of the image to be encrypted as the input information of the image semantic parsing model. After the calculation of the image semantic parsing model, the output result is used as multiple initial encrypted image information. It can be understood that after the semantic parsing process of the encoded information of the color component matrix of the image to be encrypted, the output semantic information is incoherent semantic information, and one initial encrypted image information corresponds to one semantic information. Multiple initial encrypted image information is required to represent the semantic parsing transformation result of the encoded information of the color component matrix of the image to be encrypted.
[0041] The image encryption method provided by the embodiments of the present application converts the image information to be encrypted into multiple different color component information through color space conversion to generate a matrix, and then extracts the elements, that is, pixel information, in the encoded information of the color component matrix of the image to be encrypted for rearrangement, increasing the complexity and confusion of the encryption process to improve the security of image encryption. Then, through the image semantic parsing model, the encoded information of the color component matrix of the image to be encrypted after rearrangement is subjected to image semantic mining and decomposition processing, further improving the level and depth of image encryption to increase the cracking difficulty and reduce the probability of the image information being cracked, ensuring that the user's private information and important data are not leaked.
[0042] Figure 3 The flowchart of the implementation of the image encryption method provided by the third embodiment of the present application is shown. The difference from the second embodiment above is that: The preset image semantic parsing model includes multiple preset image semantic parsing sub-models and multiple preset image semantic parsing sub-model fitness functions; among them, the preset image semantic parsing sub-models and the preset image semantic parsing sub-model fitness functions correspond one by one; The step S207 specifically includes: Step S301, according to the encoded information of the color component matrix of the image to be encrypted and the multiple preset image semantic parsing sub-model fitness functions, calculate multiple encrypted image semantic parsing fitness degrees.
[0043] In this embodiment, when the preset image semantic parsing model is a Transformer-based model, the image semantic parsing sub-model can be a Transformer model; when the preset image semantic parsing model is an LLM model, the image semantic parsing sub-model can be an expert model within the LLM model. The preset adaptation function of the image semantic parsing sub-model can be set manually or automatically generated during the training of the Transformer-based model or the LLM model. The preset image semantic parsing sub-model and the preset adaptation function of the image semantic parsing sub-model correspond one by one. By calculating the adaptation function of the image semantic parsing sub-model, the adaptation degree of the input information to the encrypted image semantic parsing of each image semantic parsing sub-model is measured, and an image semantic parsing sub-model for further encryption is selected for the encoded information of the color component matrix of the image to be encrypted. It can be understood that by dynamically calculating the adaptation degree of the encoded information of different color component matrices of the image to be encrypted to the encrypted image semantic parsing of each image semantic parsing sub-model, different image semantic parsing sub-models are selected for semantic parsing processing for different encoded information of the color component matrices of the image to be encrypted, so as to improve the security of image information encryption and reduce the probability of being cracked. It can be understood that different image semantic parsing sub-models can parse different semantic information from different dimensions for the encoded information of the same color component matrix of the image to be encrypted. Therefore, different combinations of image semantic parsing sub-models can parse multiple different-dimensional semantic information for the encoded information of the color component matrix of the image to be encrypted. Even if criminals steal the encrypted image information, it is difficult to determine from which dimension the semantic recovery process should be performed, thus increasing the cracking difficulty of the encrypted image information. The encoded information of the color component matrix of the image to be encrypted can be used as the independent variable of the adaptation function of the image semantic parsing sub-model, and the function value calculated is used as the adaptation degree of the encrypted image semantic parsing.
[0044] Step S302: Determine whether the adaptation degree of the encrypted image semantic parsing is greater than or equal to the preset threshold of the adaptation degree of the encrypted image semantic parsing; if so, use the image semantic parsing sub-model corresponding to the adaptation degree of the encrypted image semantic parsing as the processing sub-model for the encrypted image semantic parsing; if not, do not use the image semantic parsing sub-model corresponding to the adaptation degree of the encrypted image semantic parsing as the processing sub-model for the encrypted image semantic parsing.
[0045] In this embodiment, the preset semantic parsing adaptability threshold of the image to be encrypted can be set manually. When the semantic parsing adaptability of the image to be encrypted is greater than or equal to the preset semantic parsing adaptability threshold of the image to be encrypted, the image semantic parsing sub-model corresponding to the encrypted image semantic parsing adaptability is used as the semantic parsing processing sub-model for the image to be encrypted to perform semantic parsing on the color component matrix coding information of the image to be encrypted; when the semantic parsing adaptability of the image to be encrypted is less than the preset semantic parsing adaptability threshold of the image to be encrypted, the image semantic parsing sub-model corresponding to the semantic parsing adaptability of the image to be encrypted is not used as the semantic parsing processing sub-model for the image to be encrypted, and then the size relationship between the semantic parsing adaptability of the next image to be encrypted and the preset semantic parsing adaptability threshold of the image to be encrypted is judged to determine whether the next image semantic parsing sub-model can be used as the semantic parsing processing sub-model for the image to be encrypted.
[0046] Step S303: Generate a plurality of initial encrypted image information according to the color component matrix coding information of the image to be encrypted and the semantic parsing processing sub-model for the image to be encrypted.
[0047] In this embodiment, the color component matrix coding information of the image to be encrypted can be used as the input information of the semantic parsing processing sub-model for the image to be encrypted. After being calculated by the semantic parsing processing sub-model for the image to be encrypted, the calculation result is used as the initial encrypted image information. Taking the color component matrix coding information of an image to be encrypted as an example, it can be calculated layer by layer through different semantic parsing processing sub-models for the image to be encrypted according to the generation order of the semantic parsing processing sub-model for the image to be encrypted, that is, the input information of the first semantic parsing processing sub-model for the image to be encrypted is the color component matrix coding information of the image to be encrypted, and the output information is used as the input information of the second semantic parsing processing sub-model for the image to be encrypted, so as to be calculated by all the semantic parsing processing sub-models for the image to be encrypted to generate the initial encrypted image information; it can also be that the color component matrix coding information of the image to be encrypted is respectively used as the input information of different semantic parsing processing sub-models for the image to be encrypted, and the semantic parsing information of different dimensions is obtained through the calculation of different semantic parsing processing sub-models for the image to be encrypted, and then the semantic parsing information of different dimensions is fused to generate a plurality of initial encrypted image information. It can be understood that each time the color component matrix coding information of the image to be encrypted passes through the calculation of a semantic parsing processing sub-model for the image to be encrypted, semantic parsing information in one dimension is generated, and a plurality of semantic parsing processing sub-models for the image to be encrypted generate semantic parsing information in a plurality of dimensions. Therefore, after the color component matrix coding information of an image to be encrypted passes through the processing of a plurality of semantic parsing processing sub-models for the image to be encrypted, a plurality of initial encrypted image information will be generated.
[0048] The image encryption method provided by the embodiments of the present application screens out multiple semantic analysis processing sub-models for the image to be encrypted from multiple image semantic analysis sub-models by calculating the semantic parsing adaptability of the image to be encrypted, so as to perform semantic analysis processing on the information of the image to be encrypted, realize different-dimensional semantic analysis for the information of the image to be encrypted with different semantic features, improve the flexibility and adaptability of image encryption, and increase the cracking difficulty. Even if lawbreakers intercept the parsed image semantic information, they cannot know from which dimensions to perform semantic reconstruction, thereby improving the image encryption effect and the security of communication based on image information. The multiple initial encrypted image information generated by multiple semantic analysis processing sub-models for the image to be encrypted improves the flexibility and scalability for subsequent further encryption processing, can meet the image encryption requirements for different application scenarios, and thus improves the security and robustness of image encryption.
[0049] Figure 4 The flowchart of the implementation of the image encryption method provided by the fourth embodiment of the present application is shown, and its difference from the first embodiment above is that: The multiple preset multi-dimensional encryption mapping functions include multiple preset multi-dimensional encryption mapping space trajectory calculation functions, multiple preset multi-dimensional encryption space feature mapping functions, and a preset multi-dimensional encryption space feature fusion mapping function; The step S103 specifically includes: Step S401: Solve the multiple preset multi-dimensional encryption mapping functions according to the multiple preset multi-dimensional encryption mapping space trajectory calculation functions to obtain multiple multi-dimensional encryption mapping space trajectory information.
[0050] In this embodiment, the multiple preset multi-dimensional encryption mapping functions can be set artificially, can be multiple functions designed based on non-linear differential equations, or can be multiple functions designed based on ordinary differential equations, and are used to map the initial encrypted image information to a new multi-dimensional space; the multiple preset multi-dimensional encryption mapping space trajectory calculation functions can be set artificially, can be functions designed based on the Runge-Kutta method, or can be functions designed based on the Newton-Raphson method, and are used to solve the multiple preset multi-dimensional encryption mapping functions, that is, to discretize the multiple preset multi-dimensional encryption mapping functions to gradually approximate the true trajectory of the multiple preset multi-dimensional encryption mapping functions, and the obtained result is used as the multiple multi-dimensional encryption mapping space trajectory information for performing re-encryption processing on the initial encrypted image information.
[0051] Step S402: Perform iterative mapping calculation on the multiple initial encrypted image information according to the multiple multi-dimensional encryption mapping space trajectory information and the preset multi-dimensional encryption mapping iteration times to generate non-linearly mapped encrypted image information.
[0052] In this embodiment, the preset number of iterations of multi-dimensional encryption mapping can be set manually, which can be 5 times or 10 times. First, the multi-dimensional encryption mapping space trajectory information and the initial encrypted image information can be converted into matrix forms to obtain the multi-dimensional encryption mapping space trajectory matrix information and the initial encrypted image matrix information. Then, the multi-dimensional encryption mapping space trajectory matrix information and the initial encrypted image matrix information can be subjected to multiple convolution calculations, multiple multiplication operations, or multiple exclusive OR operations. The number of calculations is determined by the preset number of iterations of multi-dimensional encryption mapping, and the calculated result is output as the non-linear mapping encrypted image information.
[0053] Step S403: Obtain the first multi-dimensional encryption space mapping image feature information, the second multi-dimensional encryption space mapping image feature information, and the third multi-dimensional encryption space mapping image feature information according to the preset first multi-dimensional encryption space feature mapping function, the preset second multi-dimensional encryption space feature mapping function, the preset third multi-dimensional encryption space feature mapping function, and the non-linear mapping encrypted image information.
[0054] In this embodiment, the preset multi-dimensional encryption space feature fusion mapping function includes the preset first multi-dimensional encryption space feature mapping function, the preset second multi-dimensional encryption space feature mapping function, and the preset third multi-dimensional encryption space feature mapping function, all of which can be designed manually and can have a certain logical space structure for mapping the non-linear mapping encrypted image information into a new non-linear space. Among them, the first multi-dimensional encryption space feature mapping function, the second multi-dimensional encryption space feature mapping function, and the third multi-dimensional encryption space feature mapping function respectively represent mapping processing from different dimensions. It can be such that the first multi-dimensional encryption space feature mapping function, the second multi-dimensional encryption space feature mapping function, and the third multi-dimensional encryption space feature mapping function are respectively multiplied by the non-linear mapping encrypted image information, and the multiplication results are used as the first multi-dimensional encryption space mapping image feature information, the second multi-dimensional encryption space mapping image feature information, and the third multi-dimensional encryption space mapping image feature information.
[0055] Step S404: Obtain the multi-dimensional encryption space mapping image feature fusion weight information according to the first multi-dimensional encryption space mapping image feature information, the second multi-dimensional encryption space mapping image feature information, and the third multi-dimensional encryption space mapping image feature information.
[0056] In this embodiment, the Euclidean distances between the first multi-dimensional encryption space mapping image feature information and the third multi-dimensional encryption space mapping image feature information, and between the second multi-dimensional encryption space mapping image feature information and the third multi-dimensional encryption space mapping image feature information can be calculated respectively, and the values of these two Euclidean distances are used as the multi-dimensional encryption space mapping image feature fusion weight information.
[0057] Step S405: Perform weighted summation based on the multi-dimensional encrypted space mapping image feature fusion weight information and the third multi-dimensional encrypted space mapping image feature information to obtain multi-dimensional encrypted space mapping image feature fusion information.
[0058] In this embodiment, it may be to perform weighted summation on the third multi-dimensional encrypted space mapping image feature information based on the multi-dimensional encrypted space mapping image feature fusion weight information, and the result of the weighted summation is used as the multi-dimensional encrypted space mapping image feature fusion information.
[0059] Step S406: Generate multiple intermediate encrypted image information according to the multi-dimensional encrypted space mapping image feature fusion information and a preset multi-dimensional encrypted space feature fusion mapping function.
[0060] In this embodiment, the preset multi-dimensional encrypted space feature fusion mapping function can be set artificially. It can be a linear weighted fusion function, and the weights therein can be set artificially, or it can be a Sigmoid function or a ReLU function or a softmax function, or it can be a convolution function, and the convolution kernel therein can be designed artificially. It can be to use the multi-dimensional encrypted space mapping image feature fusion information as the independent variable of the multi-dimensional encrypted space feature fusion mapping function, and the function value calculated through the multi-dimensional encrypted space feature fusion mapping function is used as the intermediate encrypted image information. It can be understood that the multi-dimensional encrypted space mapping image feature fusion information can be decomposed into multiple matrices, so multiple intermediate encrypted image information can be calculated.
[0061] In this embodiment, when performing image decryption processing, it is necessary to perform back-mapping processing on the intermediate encrypted image information according to the multi-dimensional encrypted space feature fusion mapping function, and then decompose the image information after the back-mapping processing according to the multi-dimensional encrypted space mapping image feature fusion weight information to obtain the decomposed image semantic information. Then, the decomposed image semantic information is respectively subjected to back-mapping processing through a preset first multi-dimensional encrypted space feature mapping function, a preset second multi-dimensional encrypted space feature mapping function, and a preset third multi-dimensional encrypted space feature mapping function to restore the non-linearly mapped encrypted image information. Furthermore, it can be to perform iterative calculation of back-mapping on the restored non-linearly mapped encrypted image information based on a preset multi-dimensional encrypted mapping iteration number and multi-dimensional encrypted mapping space trajectory information, so as to generate multiple initial encrypted image information.
[0062] The image encryption method provided by the embodiments of the present application dynamically calculates the trajectory information of multiple multi-dimensional encryption mapping spaces, guiding the encryption process to calculate along different dimensional trajectories, so that the image information shows extremely complex dynamics in the encryption transformation, greatly enhancing the diversity and unpredictability of encryption, effectively increasing the difficulty for attackers to crack. By performing multiple iterative mapping calculations on the initial encrypted image information, the image features are confused and recombined multiple times to continuously strengthen the encryption effect, and it can effectively resist various common cryptographic analysis attack means, strongly guaranteeing the security of encryption. Through multi-dimensional encryption space feature mapping and fusion processing, the key information of the encrypted image at different levels is mined, and then these key information are further confused and hidden, so that attackers need to break through the encryption defenses of multiple feature dimensions simultaneously to obtain the original image information, greatly increasing the cracking difficulty, thus providing a strong guarantee for image encryption.
[0063] Figure 5 The implementation flowchart of the image decryption method provided by the fifth embodiment of the present application is shown as follows and is described in detail below: Step S501, obtain encrypted image information.
[0064] In this embodiment, the encrypted image information is the image information after specific encryption processing, which can be the information obtained after a series of encryption processes to hide the true content of the original image to protect its security and privacy. Specifically, it refers to the information generated after sequentially performing multiple steps of processing on the original image information, such as color space conversion, position encoding, semantic parsing, multi-dimensional encryption mapping iterative calculation, etc. These processing processes disrupt and recombine the pixel distribution, feature information, and semantic content of the original image, and only through a specific decryption process can the original image information be restored.
[0065] Step S502, perform decomposition calculation on the encrypted image information to obtain multiple initial decrypted image information.
[0066] In this embodiment, for the image encryption method of performing weighted summation calculation on each intermediate encrypted image information according to the preset weight information, the calculation result can be to perform decomposition calculation on the encrypted image information based on the preset weight information to obtain multiple initial decrypted image information.
[0067] Step S503, according to the preset number of multi-dimensional encryption mapping iterations and multiple preset multi-dimensional encryption mapping functions, perform backtracking mapping iterative calculation on the multiple initial decrypted image information to generate multiple intermediate decrypted image information.
[0068] In this embodiment, it may be based on multiple preset multi-dimensional encryption mapping functions to perform back-mapping iterative calculation on the initial decrypted image information, and the back-mapping iterative calculation result is used as multiple intermediate decrypted image information, and the number of iterations is determined by the preset multi-dimensional encryption mapping iteration times. Among them, the preset multi-dimensional encryption mapping iteration times can be set artificially, which can be 5 times or 10 times. The multiple preset multi-dimensional encryption mapping functions can be Logistic mapping function, Tent mapping function, Henon mapping function, Lorenz mapping function, hyperbolic tangent function, Sigmoid function, ReLU function, etc., and the multiple preset multi-dimensional encryption mapping functions can be the same or different from each other.
[0069] Step S504: Perform semantic reconstruction processing, position decoding processing, and color space inverse conversion on the intermediate decrypted image information to generate target decrypted image information.
[0070] In this embodiment, the semantic reconstruction processing is used to restore the semantic information in the encrypted image. It may be to extract features by using the same feature extraction methods as those in semantic parsing during encryption, such as scale-invariant feature transform, histogram of oriented gradients, etc. Then, the extracted features are matched with the semantic feature templates used in the encryption stage, so as to match the position of the area where the sensitive information in the image is located. For the area position of the sensitive information in the image, reverse decryption operations can be performed on the multiple encryption information recorded during the encryption process. For example, if the sensitive area is encrypted by multiple iterative encryption processes during encryption, then corresponding back-mapping iterative calculations are performed during decryption. For non-sensitive areas, since no excessive encryption is performed, only simple feature restoration operations are required. Finally, the semantic information of all areas is integrated to complete the semantic reconstruction processing. During the image encryption process, position encoding processing is performed on the decomposed luminance component information and color component information, such as one-hot encoding, absolute position encoding, or relative encoding. The position decoding processing is used to restore the encoded information to the original position information. During the image encryption process, the color space of the image information to be encrypted is converted through the YCrCb model, RGB model, or HSV model, and the image information to be encrypted is decomposed into multiple luminance component information and color component information. Then, the color space inverse conversion is performed during the decryption process to restore the multiple luminance component information and color component information to the original color space. Through semantic reconstruction processing, position decoding processing, and color space inverse conversion, target decrypted image information is generated from the intermediate decrypted image information, and the image decryption process is completed.
[0071] The image decryption method provided by the embodiment of the present application decomposes the encrypted image information to reduce the complexity of subsequent decryption operations, providing technical support for accurate decryption. Through the number of multi-dimensional encryption mapping iterations and the multi-dimensional encryption mapping function, a backtracking mapping iterative calculation is performed on the initial decrypted image information. Relying on the corresponding multi-dimensional encryption mapping mechanism during image encryption, the encryption trajectory of the image is reversely restored, enabling the decryption process to flexibly handle encrypted image information with different encryption mapping mechanisms, enhancing the generality of the image decryption method. The number of multi-dimensional encryption mapping iterations ensures the rationality of the computational complexity, enabling effective decryption processing while avoiding excessive calculation or insufficient decryption. Through semantic reconstruction processing of the intermediate decrypted image, the semantic content of the encrypted image is restored to the semantic content of the original image information. Through position decoding processing, the spatial distribution of each image feature can be accurately restored. Through inverse color space conversion, the image color is restored to the original state, presenting a visual effect consistent with that before image encryption. Thus, image information is gradually restored from different dimensions, greatly improving the accuracy of image decryption and ensuring the integrity of image information.
[0072] Figure 6 The flowchart showing the implementation of the image decryption method provided in Embodiment 6 of the present application is different from that of Embodiment 5 above: Step S504 specifically includes: Step S601: Based on a preset image semantic reconstruction model, perform semantic reconstruction processing on the intermediate decrypted image information to obtain intermediate decrypted image coding matrix information and dimension information of the intermediate decrypted image coding matrix information.
[0073] In this embodiment, the preset image semantic reconstruction model can be a convolutional neural network model or a Transformer-based model. The intermediate decrypted image information can be used as the input information of the image semantic reconstruction model. Through each calculation layer inside the image semantic reconstruction model, feature extraction and reconstruction processing are performed on the intermediate decrypted image information to automatically restore the semantic information that was confused or hidden during the image encryption process. The image information after the semantic information is restored is used as the output information of the image semantic reconstruction model, that is, the intermediate decrypted image coding matrix information. The dimension information of the intermediate decrypted image coding matrix information can be determined from the intermediate decrypted image coding matrix information for subsequent further image decryption calculations.
[0074] Step S602: Perform dimension conversion processing on the intermediate decrypted image coding matrix information to obtain intermediate decrypted image coding dimensionality reduction matrix information; the intermediate decrypted image coding dimensionality reduction matrix information includes multiple intermediate decrypted image coding dimensionality reduction matrix elements.
[0075] In this embodiment, the dimensionality conversion process may be a dimensionality reduction process, which may reduce the high-dimensional intermediate decrypted image coding matrix information to a one-dimensional matrix through matrix compression or matrix transformation operations, and the one-dimensional matrix may be used as the intermediate decrypted image coding dimensionality reduction matrix information. All the numerical values in the intermediate decrypted image coding dimensionality reduction matrix information are the intermediate decrypted image coding dimensionality reduction matrix elements.
[0076] Step S603: According to the preset rule for intercepting the decrypted image coding matrix elements, using the dimensionality information of the intermediate decrypted image coding matrix information as the element number interception threshold, perform non-uniform interception on the multiple intermediate decrypted image coding dimensionality reduction matrix elements to obtain multiple intermediate decrypted image coding array information.
[0077] In this embodiment, the preset rule for intercepting the decrypted image coding matrix elements may be set artificially. Taking the intermediate decrypted image coding matrix information as a four-dimensional matrix as an example, the dimensionality information of the intermediate decrypted image coding matrix information is 4, and there are 16 intermediate decrypted image coding dimensionality reduction matrix elements. Taking [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] as the intermediate decrypted image coding dimensionality reduction matrix information as an example, the number of elements intercepted each time does not exceed the dimensionality information of the intermediate decrypted image coding matrix information, that is, does not exceed 4, and can be intercepted as [1][2, 3][4, 5, 6][7, 8, 9, 10][11, 12, 13][14, 15]
[16] , so as to achieve non-uniform interception of the multiple intermediate decrypted image coding dimensionality reduction matrix elements. In the above example, the intercepted [1][2, 3][4, 5, 6][7, 8, 9, 10][11, 12, 13][14, 15]
[16] can be used as the multiple intermediate decrypted image coding array information.
[0078] Step S604: According to the preset order for splicing the decrypted image coding arrays, perform splicing processing and dimensionality increase processing on the multiple intermediate decrypted image coding array information to generate intermediate decrypted image decoding matrix information.
[0079] In this embodiment, the preset order for splicing the decrypted image coding arrays may be set artificially, and it may be to perform interleaved splicing processing on the intermediate decrypted image coding array information. Taking [1][2, 3][4, 5, 6][7, 8, 9, 10][11, 12, 13][14, 15]
[16] as the multiple intermediate decrypted image coding array information as an example, the one-dimensional matrix obtained after performing interleaved splicing processing may be [1, 2, 4, 7, 3, 5, 8, 11, 6, 9, 12, 14, 10, 13, 15, 16], and then perform dimensionality increase processing on this one-dimensional matrix, that is, restore it to a four-dimensional matrix as the intermediate decrypted image decoding matrix information.
[0080] Step S605: Perform an inverse color space transformation on the intermediate decrypted image decoding matrix information to generate target decrypted image information.
[0081] In this embodiment, an inverse color space transformation can be performed using the RGB model, the YCrCb model, or the HSV model to convert the color component information in the intermediate decrypted image decoding matrix information back to the original color space, thereby restoring the color and content of the original image information. The image information obtained after the inverse color space transformation is used as the target decrypted image information.
[0082] The image decryption method provided in the embodiments of the present application re-mines the connections between image semantics through an image semantic reconstruction model to accurately restore the image semantic information that was deeply confused and split during encryption, so as to improve the accuracy and integrity of the image decryption result. Furthermore, a dimensionality reduction matrix is obtained by performing a dimensionality transformation on the intermediate decrypted image encoding matrix information, reducing the computational complexity. By intercepting the elements of the dimensionality reduction matrix, it can dynamically adapt to the image encryption method, enhancing the adaptability and flexibility of image decryption. The intercepted elements of the dimensionality reduction matrix are spliced and dimensionally increased to accurately restore the matrix structure of the intermediate decrypted image information, ensuring that the decrypted matrix is consistent with the original image structure. Through the inverse color space transformation process, the intermediate decrypted image decoding matrix information is restored to the original color space, accurately restoring the image color information. Thus, while ensuring the accuracy and integrity of image decryption, the computational efficiency, flexibility, and robustness are improved, providing a reliable guarantee for the secure decryption of image information.
[0083] Figure 7 The flowchart of the implementation of the image decryption method provided in the seventh embodiment of the present application is shown. The difference from the sixth embodiment above is as follows: The preset image semantic reconstruction model includes a plurality of preset image semantic reconstruction sub-models and a plurality of preset sub-model semantic backtracking adaptability functions; among them, the preset image semantic reconstruction sub-models and the preset sub-model semantic backtracking adaptability functions are in one-to-one correspondence. The step S601 specifically includes: Step S701: Calculate a plurality of image semantic reconstruction adaptabilities to be decrypted based on the intermediate decrypted image information and a plurality of preset sub-model semantic backtracking adaptability functions.
[0084] In this embodiment, the preset image semantic reconstruction model can be artificially set, can be defaulted to a model that has been trained, and can be a model composed of Transformers. Then, the preset sub-model semantic backtracking fitness function can be multiple Transformer models; if the preset image semantic reconstruction model is an LLM model, the preset sub-model semantic backtracking fitness function can be multiple expert models. The preset sub-model semantic backtracking fitness function can be artificially set. It can use the intermediate decrypted image information as the independent variable of the sub-model semantic backtracking fitness function, and the calculated function value as the fitness for the semantic reconstruction of the image to be decrypted.
[0085] Step S702: Determine whether the fitness for the semantic reconstruction of the image to be decrypted is greater than the preset fitness threshold for the semantic reconstruction of the image to be decrypted; if so, use the image semantic reconstruction sub-model corresponding to the fitness for the semantic reconstruction of the image to be decrypted as the semantic reconstruction sub-model for the decrypted image coding information; if not, do not use the image semantic reconstruction sub-model corresponding to the fitness for the semantic reconstruction of the image to be decrypted as the semantic reconstruction sub-model for the decrypted image coding information.
[0086] In this embodiment, the preset fitness threshold for the semantic reconstruction of the image to be decrypted can be artificially set and is used to compare with the fitness for the semantic reconstruction of the image to be decrypted to determine which image semantic reconstruction sub-models are suitable for the current image decryption process. When the fitness for the semantic reconstruction of the image to be decrypted is greater than the fitness threshold for the semantic reconstruction of the image to be decrypted, it indicates that the intermediate decrypted image information has a high matching degree with the corresponding image semantic reconstruction sub-model, and this image semantic reconstruction sub-model can effectively perform semantic reconstruction on the intermediate decrypted image information. Therefore, this image semantic reconstruction sub-model is selected as the semantic reconstruction sub-model for the decrypted image coding information. Conversely, if the fitness for the semantic reconstruction of the image to be decrypted is less than the fitness threshold for the semantic reconstruction of the image to be decrypted, the corresponding image semantic reconstruction sub-model is not adopted.
[0087] Step S703: Based on multiple semantic reconstruction sub-models for the decrypted image coding information, perform semantic reconstruction processing on the intermediate decrypted image coding matrix information to obtain the intermediate decrypted image coding matrix information and the dimension information of the intermediate decrypted image coding matrix information.
[0088] In this embodiment, layer-by-layer calculation can be performed in the order of decrypting the semantic reconstruction sub-model of the image coding information, that is, the input of the first decrypting semantic reconstruction sub-model of the image coding information is the intermediate decrypting image coding matrix information, and the output information of the first decrypting semantic reconstruction sub-model of the image coding information is used as the input information of the second decrypting semantic reconstruction sub-model of the image coding information, and so on. After calculation by all selected decrypting semantic reconstruction sub-models of the image coding information, the semantic reconstruction result, that is, the intermediate decrypting image coding matrix information, is obtained. The dimension information of the intermediate decrypting image coding matrix information can be determined through the intermediate decrypting image coding matrix information.
[0089] The image decryption method provided by the embodiment of the present application can quantitatively evaluate the matching degree between each image semantic reconstruction sub-model and the intermediate decrypted image information by dynamically calculating the semantic reconstruction adaptability of the image to be decrypted, avoiding the limitations brought by blindly using a fixed model, improving the accuracy of semantic reconstruction, and then screening out the decrypting semantic reconstruction sub-model of the image coding information through the semantic reconstruction adaptability threshold of the image to be decrypted, enhancing the adaptability of the image semantic reconstruction model to different semantic features to be reconstructed, enabling the image decryption process to be flexibly adjusted according to the specific situation of the image, improving the flexibility and robustness of image decryption. By using different decrypting semantic reconstruction sub-models of the image coding information to analyze and reconstruct the intermediate decrypting image coding matrix information from multiple dimensions, even if the semantic information is deeply confused and split during the image encryption process, the collaborative work of multiple decrypting semantic reconstruction sub-models of the image coding information can comprehensively and accurately restore the original image semantic information, improving the security and reliability of image decryption.
[0090] Corresponding to the method in the above embodiment, Figure 8 The structural block diagram of the image encryption device provided by the embodiment of the present application is shown. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown. Figure 8 The exemplary image encryption device may be the execution subject of the image encryption method provided in the foregoing Embodiment 1.
[0091] Referring to Figure 8 , the image encryption device includes: A to-be-encrypted image information acquisition module 810, configured to acquire to-be-encrypted image information; An initial encrypted image information generation module 820, configured to perform color space conversion, position coding processing, and semantic parsing processing on the to-be-encrypted image information to generate a plurality of initial encrypted image information; An intermediate encrypted image information generation module 830, configured to perform iterative mapping calculation on the plurality of initial encrypted image information according to a preset multi-dimensional encryption mapping iteration number and a plurality of preset multi-dimensional encryption mapping functions to generate a plurality of intermediate encrypted image information; A target encrypted image information generation module 840 is configured to perform weighted calculation on the multiple pieces of intermediate encrypted image information to generate target encrypted image information.
[0092] For the processes of each module in the image encryption device provided in the embodiments of the present application to implement their respective functions, reference may be specifically made to the description of Embodiment 1 above, and details are not described herein again. Figure 1 shown in the above embodiment, and details are not described herein again.
[0093] Corresponding to the method in the above embodiment, Figure 9 The block diagram of the image decryption device provided in the embodiments of the present application is shown. For ease of description, only the parts related to the embodiments of the present application are shown. Figure 9 The exemplary image decryption device may be the execution subject of the image decryption method provided in Embodiment 5 above.
[0094] Referring to Figure 9 , the image decryption device includes: An encrypted image information acquisition module 910 is configured to acquire encrypted image information; An initial decrypted image information determination module 920 is configured to perform decomposition calculation on the encrypted image information to obtain multiple pieces of initial decrypted image information; An intermediate decrypted image information generation module 930 is configured to perform backtracking mapping iteration calculation on the multiple pieces of initial decrypted image information according to a preset multi-dimensional encryption mapping iteration number and multiple preset multi-dimensional encryption mapping functions to generate multiple pieces of intermediate decrypted image information; A target decrypted image information generation module 940 is configured to perform semantic reconstruction processing, position decoding processing, and color space inverse conversion on the intermediate decrypted image information to generate target decrypted image information.
[0095] For the processes of each module in the image decryption device provided in the embodiments of the present application to implement their respective functions, reference may be specifically made to the description of Embodiment 5 above, and details are not described herein again. Figure 5 shown in the above embodiment, and details are not described herein again.
[0096] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0097] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0098] It should also be understood that the term "and / or" as used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0099] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "once" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if [the described condition or event] is detected" can be interpreted as meaning "once determined" or "in response to determining" or "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]" depending on the context.
[0100] In addition, in the description of the specification and appended claims of this application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and should not be construed as indicating or implying relative importance. It should also be understood that although the terms "first", "second", etc. are used in the text in some embodiments of this application to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, the first table can be named the second table, and similarly, the second table can be named the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.
[0101] Reference to "an embodiment" or "some embodiments" or the like described in the specification of this application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0102] The image encryption method provided by the embodiments of this application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of this application do not impose any restrictions on the specific types of terminal devices.
[0103] For example, the terminal device can be a station (STAION, ST) in a WLAN, a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device, or other processing devices connected to a wireless modem, an in-vehicle device, an Internet of Vehicles terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite wireless device, a wireless modem card, a set top box (STB), a customer premise equipment (CPE), and / or other devices for communicating on a wireless system, as well as next-generation communication systems, such as mobile terminals in a 5G network or mobile terminals in a future evolved Public Land Mobile Network (PLMN) network.
[0104] By way of example and not limitation, when the terminal device is a wearable device, the wearable device can also be a general term for devices that apply wearable technology to the intelligent design of daily wear and develop wearable devices, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is either directly worn on the body or integrated into the user's clothing or accessories. A wearable device is not just a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable intelligent devices include those with complete functions and large sizes that can achieve complete or partial functions without relying on a smart phone, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to cooperate with other devices such as smart phones, such as various smart bracelets and smart jewelry for physical sign monitoring.
[0105] Figure 10It is a schematic structural diagram of a terminal device provided by an embodiment of the present application. As Figure 10 shown, the terminal device 100 of this embodiment includes: at least one processor 1000 ( Figure 10 only one is shown in the figure), and a memory 1001. A computer program 1002 that can run on the processor 1000 is stored in the memory 1001. When the processor 1000 executes the computer program 1002, the steps in the above-mentioned embodiments of various image encryption methods are implemented, such as Figure 1 the steps S101 to S104 shown in the figure, and the steps in the above-mentioned embodiments of various image decryption methods are implemented, such as Figure 5 the steps S501 to S504 shown in the figure. Alternatively, when the processor 1000 executes the computer program 1002, the functions of each module / unit in the above-mentioned device embodiments are implemented, such as Figure 8 the functions of the modules 810 to 840 shown in the figure and Figure 9 the functions of the modules 910 to 940 shown in the figure.
[0106] The terminal device 100 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device may include, but is not limited to, a processor 1000 and a memory 1001. Those skilled in the art can understand that Figure 10 this is only an example of the terminal device 100, and does not constitute a limitation on the terminal device 100. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the terminal device may further include an input and sending device, a network access device, a bus, etc.
[0107] The so-called processor 1000 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0108] In some embodiments, the memory 1001 may be an internal storage unit of the terminal device 100, such as the hard disk or memory of the terminal device 100. The memory 1001 may also be an external storage device of the terminal device 100, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the terminal device 100. Further, the memory 1001 may also include both the internal storage unit and the external storage device of the terminal device 100. The memory 1001 is used to store an operating system, application programs, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 1001 may also be used to temporarily store data that has been sent or will be sent.
[0109] In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0110] The embodiment of the present application also provides a terminal device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the terminal device implements the steps in any of the above method embodiments.
[0111] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it can implement the steps in the above method embodiments.
[0112] The embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, it enables the terminal device to implement the steps in the above method embodiments when executed.
[0113] When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above-described embodiment methods of this application, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0114] In the above embodiments, the descriptions of the various embodiments each have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0115] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An image encryption method, characterized in that, Including: Obtain the image information to be encrypted; Perform color space conversion, position encoding processing, and semantic parsing processing on the image information to be encrypted to generate multiple initial encrypted image information; According to the preset multi-dimensional encryption mapping iteration times and multiple preset multi-dimensional encryption mapping functions, perform iterative mapping calculations on the multiple initial encrypted image information to generate multiple intermediate encrypted image information; Perform weighted calculation on the multiple intermediate encrypted image information to generate the target encrypted image information.
2. The image encryption method according to claim 1, wherein The step of performing color space conversion, position encoding processing, and semantic parsing processing on the image information to be encrypted to generate multiple initial encrypted image information specifically includes: Perform color space conversion on the image information to be encrypted to obtain multiple color component information of the image to be encrypted; Generate multiple color component matrix information of the image to be encrypted according to the multiple color component information of the image to be encrypted; Extract elements from the multiple color component matrix information of the image to be encrypted to obtain the number of rows of the color component matrix of the image to be encrypted, the number of columns of the color component matrix of the image to be encrypted, multiple elements of the color component matrix of the image to be encrypted, the number of rows of multiple elements of the color component matrix of the image to be encrypted, and the number of columns of multiple elements of the color component matrix of the image to be encrypted; wherein, the elements of the color component matrix of the image to be encrypted correspond one-to-one with the number of rows of the elements of the color component matrix of the image to be encrypted and the number of columns of the elements of the color component matrix of the image to be encrypted; When both the number of rows of the elements of the color component matrix of the image to be encrypted and the number of columns of the elements of the color component matrix of the image to be encrypted are not equal to 1, and the number of rows of the elements of the color component matrix of the image to be encrypted is not equal to the number of rows of the color component matrix of the image to be encrypted, and the number of rows of the elements of the color component matrix of the image to be encrypted is not equal to the number of columns of the color component matrix of the image to be encrypted, then calculate the sum of the number of rows and columns of each element of the color component matrix of the image to be encrypted; When the sum of the number of rows and columns of the elements of the first color component matrix of the image to be encrypted is equal to the sum of the number of rows and columns of the elements of the second color component matrix of the image to be encrypted, generate an element array of the color component matrix of the image to be encrypted according to the elements of the first color component matrix of the image to be encrypted and the elements of the second color component matrix of the image to be encrypted; According to the preset splicing rule of the encoding array of the image to be encrypted, splice the element array of the color component matrix of the image to be encrypted, the elements whose number of rows and columns of the elements of the color component matrix of the image to be encrypted are both equal to 1, and the elements whose number of rows of the elements of the color component matrix of the image to be encrypted is equal to the number of rows of the color component matrix of the image to be encrypted and the number of rows of the elements of the color component matrix of the image to be encrypted is equal to the number of columns of the color component matrix of the image to be encrypted to obtain the encoding information of the color component matrix of the image to be encrypted; Based on the preset image semantic parsing model, perform semantic parsing processing on the encoding information of the color component matrix of the image to be encrypted to generate multiple initial encrypted image information.
3. The image encryption method according to claim 2, wherein The preset image semantic parsing model includes multiple preset image semantic parsing sub - models and multiple preset image semantic parsing sub - model fitness functions; among them, the preset image semantic parsing sub - models and the preset image semantic parsing sub - model fitness functions are in one - to - one correspondence; The step of performing semantic parsing processing on the encoded information of the color component matrix of the image to be encrypted based on the preset image semantic parsing model to generate multiple initial encrypted image information specifically includes: According to the encoded information of the color component matrix of the image to be encrypted and multiple preset image semantic parsing sub - model fitness functions, calculate multiple semantic parsing fitnesses of the image to be encrypted; When the semantic parsing fitness of the image to be encrypted is greater than or equal to the preset semantic parsing fitness threshold of the image to be encrypted, use the image semantic parsing sub - model corresponding to the semantic parsing fitness of the image to be encrypted as the semantic parsing processing sub - model for the image to be encrypted; According to the encoded information of the color component matrix of the image to be encrypted and the semantic parsing processing sub - model for the image to be encrypted, generate multiple initial encrypted image information.
4. The image encryption method according to claim 1, wherein: The multiple preset multi - dimensional encryption mapping functions include multiple preset multi - dimensional encryption mapping space trajectory calculation functions, multiple preset multi - dimensional encryption space feature mapping functions, and a preset multi - dimensional encryption space feature fusion mapping function; The step of performing iterative mapping calculation on the multiple initial encrypted image information according to the preset number of multi - dimensional encryption mapping iterations and multiple preset multi - dimensional encryption mapping functions to generate multiple intermediate encrypted image information specifically includes: According to multiple preset multi - dimensional encryption mapping space trajectory calculation functions, solve the multiple preset multi - dimensional encryption mapping functions to obtain multiple multi - dimensional encryption mapping space trajectory information; According to the multiple multi - dimensional encryption mapping space trajectory information and the preset number of multi - dimensional encryption mapping iterations, perform iterative mapping calculation on the multiple initial encrypted image information to generate non - linear mapping encrypted image information; According to the preset first multi - dimensional encryption space feature mapping function, the preset second multi - dimensional encryption space feature mapping function, the preset third multi - dimensional encryption space feature mapping function, and the non - linear mapping encrypted image information, obtain the first multi - dimensional encryption space mapping image feature information, the second multi - dimensional encryption space mapping image feature information, and the third multi - dimensional encryption space mapping image feature information; According to the first multi - dimensional encryption space mapping image feature information, the second multi - dimensional encryption space mapping image feature information, and the third multi - dimensional encryption space mapping image feature information, obtain the multi - dimensional encryption space mapping image feature fusion weight information; Perform weighted summation according to the multi - dimensional encryption space mapping image feature fusion weight information and the third multi - dimensional encryption space mapping image feature information to obtain the multi - dimensional encryption space mapping image feature fusion information; According to the multi - dimensional encryption space mapping image feature fusion information and the preset multi - dimensional encryption space feature fusion mapping function, generate multiple intermediate encrypted image information.
5. An image decryption method, characterized in that, Including: Obtain encrypted image information; Decompose and calculate the encrypted image information to obtain multiple initial decrypted image information; According to the preset multi-dimensional encryption mapping iteration times and multiple preset multi-dimensional encryption mapping functions, perform backtracking mapping iteration calculation on the multiple initial decrypted image information to generate multiple intermediate decrypted image information; Perform semantic reconstruction processing, position decoding processing, and color space inverse conversion on the intermediate decrypted image information to generate target decrypted image information.
6. The image decryption method according to claim 5, wherein The step of performing semantic reconstruction processing, position decoding processing, and color space inverse conversion on the intermediate decrypted image information to generate target decrypted image information specifically includes: Based on a preset image semantic reconstruction model, perform semantic reconstruction processing on the intermediate decrypted image information to obtain intermediate decrypted image coding matrix information and the dimension information of the intermediate decrypted image coding matrix information; Perform dimension conversion processing on the intermediate decrypted image coding matrix information to obtain intermediate decrypted image coding dimensionality reduction matrix information; the intermediate decrypted image coding dimensionality reduction matrix information includes multiple intermediate decrypted image coding dimensionality reduction matrix elements; According to the preset decrypted image coding matrix element truncation rule, use the dimension information of the intermediate decrypted image coding matrix information as the element number truncation threshold, and perform non-uniform truncation on the multiple intermediate decrypted image coding dimensionality reduction matrix elements to obtain multiple intermediate decrypted image coding array information; According to the preset decrypted image coding array splicing order, splice and perform dimensionality increase processing on the multiple intermediate decrypted image coding array information to generate intermediate decrypted image decoding matrix information; Perform color space inverse conversion on the intermediate decrypted image decoding matrix information to generate target decrypted image information.
7. The image decryption method according to claim 6, wherein The preset image semantic reconstruction model includes multiple preset image semantic reconstruction sub-models and multiple preset sub-model semantic backtracking adaptation degree functions; among them, the preset image semantic reconstruction sub-models and the preset sub-model semantic backtracking adaptation degree functions are in one-to-one correspondence; The step of performing semantic reconstruction processing on the intermediate decrypted image information based on the preset image semantic reconstruction model to obtain intermediate decrypted image coding matrix information specifically includes: Calculate multiple to-be-decrypted image semantic reconstruction adaptation degrees according to the intermediate decrypted image information and the multiple preset sub-model semantic backtracking adaptation degree functions; When the to-be-decrypted image semantic reconstruction adaptation degree is greater than the preset to-be-decrypted image semantic reconstruction adaptation degree threshold, use the image semantic reconstruction sub-model corresponding to the to-be-decrypted image semantic reconstruction adaptation degree as the decrypted image coding information semantic reconstruction sub-model; Based on the multiple decrypted image coding information semantic reconstruction sub-models, perform semantic reconstruction processing on the intermediate decrypted image coding matrix information to obtain intermediate decrypted image coding matrix information.
8. An image encryption device, characterized in that, Including: A to-be-encrypted image information acquisition module, configured to acquire to-be-encrypted image information; An initial encrypted image information generation module, configured to perform color space conversion, position coding processing, and semantic parsing processing on the to-be-encrypted image information to generate multiple initial encrypted image information; An intermediate encrypted image information generation module, configured to perform iterative mapping calculations on the multiple initial encrypted image information according to a preset number of multi-dimensional encryption mapping iterations and multiple preset multi-dimensional encryption mapping functions, to generate multiple intermediate encrypted image information; A target encrypted image information generation module, configured to perform weighted calculations on the multiple intermediate encrypted image information to generate target encrypted image information.
9. An image decryption device, characterized in that, Including: An encrypted image information acquisition module, configured to acquire encrypted image information; An initial decrypted image information determination module, configured to perform decomposition calculations on the encrypted image information to obtain multiple initial decrypted image information; An intermediate decrypted image information generation module, configured to perform backtracking mapping iterative calculations on the multiple initial decrypted image information according to a preset number of multi-dimensional encryption mapping iterations and multiple preset multi-dimensional encryption mapping functions, to generate multiple intermediate decrypted image information; A target decrypted image information generation module, configured to perform semantic reconstruction processing, position decoding processing, and color space inverse conversion on the intermediate decrypted image information to generate target decrypted image information.
10. A terminal device, characterized in that, The terminal device includes a memory and a processor, and a computer program capable of running on the processor is stored on the memory. When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Image encryption method synchronously realized by fractional order complex system based on mixed time lag
CN112199690A
Low-illumination image enhancement method based on multi-semantic feature fusion network
CN117408924A
Image encryption algorithm based on multi-chaotic system and cyclic DNA operation and electronic equipment
CN117440101A
Image encryption method and device, electronic equipment and storage medium
CN117714613A
Printing cartridge with barcode identification
WO2003013866A1