Image encryption methods, image encryption devices, and electronic devices

CN117939030BActive Publication Date: 2026-08-11中国邮政储蓄银行股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-26
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种图像加密方法、图像加密装置以及电子装置,以至少解决现有技术中图像加密方法被解密的风险高的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117939030B_ABST
    Figure CN117939030B_ABST
Patent Text Reader

Abstract

This application provides an image encryption method, an image encryption device, and an electronic device. The method includes: acquiring an original image; segmenting the original image to obtain multiple original image patches, wherein the original image includes at least user identity information; acquiring historical image patches and their corresponding classification results; inputting the multiple original image patches into a classification network to obtain classification results corresponding to the original image patches, wherein the classification results characterize the importance of the original image patches in the original image, and the historical image patches are obtained by segmenting historical images, where the historical images are original images acquired before the current time; determining a corresponding predetermined chaotic encryption method based on the classification results, wherein any two predetermined chaotic encryption methods have different scrambling times; and encrypting the original image patches using the predetermined chaotic encryption method to obtain encrypted image patches. The above method solves the problem of high decryption risk in image encryption methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image encryption, and more specifically, to an image encryption method, an image encryption device, and an electronic device. Background Technology

[0002] With the development of the internet and the diversification of banking services, the frequency of mobile device and mobile business platform use by business personnel when working in the field is gradually increasing. There is a risk of information leakage during the storage and transmission of customer data obtained using mobile devices; therefore, image encryption is necessary. Existing encryption methods typically involve: scrambling the entire image, generating a key, and encrypting. Because these methods operate on the entire image dimension, all image regions use the same calculation method, and the encryption parameters are consistent across the entire image. Once the key matches successfully, all original information can be obtained.

[0003] Therefore, there is an urgent need for a method to address the high risk of decryption in existing image encryption methods. Summary of the Invention

[0004] The main objective of this application is to provide an image encryption method, an image encryption device, and an electronic device to at least solve the problem of high risk of decryption in existing image encryption methods.

[0005] According to one aspect of this application, an image encryption method is provided, the method comprising: acquiring an original image; segmenting the original image to obtain multiple original image patches, the original image including at least user identity information; acquiring historical image patches and classification results corresponding to the historical image patches; inputting the multiple original image patches into a classification network to obtain classification results corresponding to the original image patches, wherein the classification network is trained using multiple sets of historical data through machine learning, each set of the multiple sets of historical data includes: the historical image patch and the classification result corresponding to the historical image patch, the classification result being used to characterize the importance of the original image patch in the original image, the historical image patch being obtained by segmenting a historical image, the historical image being the original image acquired before the current time; determining a corresponding predetermined chaotic encryption method based on the classification result, wherein any two predetermined chaotic encryption methods have different scrambling times; encrypting the original image patches using the predetermined chaotic encryption method to obtain encrypted image patches.

[0006] Optionally, the classification result includes a first category and a second category, wherein the historical tile corresponding to the first category is more important in the historical image than the historical tile corresponding to the second category. Obtaining the classification result corresponding to the historical tile includes: determining the classification result corresponding to the historical tile as the first category when the historical tile includes at least the user's identity information; and determining the classification result corresponding to the historical tile as the second category when the historical tile does not include the user's identity information.

[0007] Optionally, the identity information includes biometric information, identification information, and text information. When the historical map patch includes at least the user's identity information, determining the classification result corresponding to the historical map patch as the first category includes: determining the classification result corresponding to the historical map patch as a first subcategory when the historical map patch includes at least the biometric information, wherein the biometric information is information used by the user for biometric identification; determining the classification result corresponding to the historical map patch as a second subcategory when the historical map patch includes at least the identification information, wherein the identification information is used to uniquely identify the user's identity; determining the classification result corresponding to the historical map patch as a third subcategory when the historical map patch includes at least the text information, wherein the text information includes at least the user's text information; and performing clustering processing on the first subcategory, the second subcategory, and the third subcategory to obtain the first category.

[0008] Optionally, encrypting the original image patch using the predetermined chaotic encryption method to obtain an encrypted image patch includes: establishing a coordinate system with the midpoint of the original image patch as the origin, determining the original coordinates of each first pixel point within the original image patch; generating a key based on the original coordinates of each first pixel point; scrambling the original image patch to obtain a scrambled image patch; and encrypting the scrambled image patch using the key to obtain the encrypted image patch.

[0009] Optionally, a key is generated based on the original coordinates of each of the first pixels, including: according to the formula Calculate the mapped coordinates of the first pixel, where x i Let y be the original x-coordinate of the i-th first pixel. i Let x be the original ordinate of the i-th first pixel. i+1 Let y be the mapped x-coordinate of the i-th first pixel. i+1 Let α be the ordinate of the first pixel at the i-th position, α∈[0,1], β∈[0,3]; according to the formula K=mod(round(S i )×10 6),256), calculate the key K, where mod() is the modulo operation and round() is the remainder operation.

[0010] Optionally, the scrambled image block includes multiple second pixels. The original image block is scrambled to obtain the scrambled image block, including: according to the formula... The original image is scrambled, where x i Let y be the original x-coordinate of the i-th first pixel. i Let x be the original ordinate of the i-th first pixel. ′ Let y be the x-coordinate of the i-th second pixel. ′ Let be the ordinate of the i-th second pixel.

[0011] Optionally, the encrypted image block includes multiple encrypted pixels, and the scrambled image block includes multiple second pixels. Encrypting the scrambled image block using the key to obtain the encrypted image block includes: determining whether the pixel to be encrypted is the first second pixel in the scrambled image block, wherein the pixel to be encrypted is any one of the multiple second pixels; if the pixel to be encrypted is the first second pixel in the scrambled image block, then according to the formula... The pixel to be encrypted is encrypted to obtain the encrypted pixel. in, The key. For the pixel to be encrypted, For XOR operation; if the pixel to be encrypted is not the first second pixel in the scrambled image block, according to the formula The pixel to be encrypted is encrypted to obtain the encrypted pixel. in, The second pixel is the one preceding the pixel to be encrypted.

[0012] Optionally, after obtaining the encrypted tile, the method further includes: according to the formula The encrypted text P corresponding to the encrypted image patch is calculated, where R is the position of the encrypted image patch in the original image, N is the number of times the encrypted image patch is scrambled, K is the key of the encrypted image patch, and γ is used to characterize the classification result of the encrypted image patch. Based on predetermined encryption rules, the encrypted image blocks and the encrypted text are encapsulated to obtain encapsulated data {X}. ( ′ i,j) ,P (i,j)}, where X ( ′ i,j)For the encrypted block, P (i,j) The encrypted text is obtained by encrypting all the original tiles in the original image to obtain a data set, wherein the data set includes multiple randomly arranged encapsulated data.

[0013] According to another aspect of this application, an image encryption device is provided, comprising: an acquisition unit, configured to acquire an original image, segment the original image to obtain multiple original image tiles, wherein the original image includes at least user identity information; an input unit, configured to acquire historical image tiles and classification results corresponding to the historical image tiles, input the multiple original image tiles into a classification network to obtain classification results corresponding to the original image tiles, wherein the classification network is trained using multiple sets of historical data through machine learning, each set of the multiple sets of historical data includes: the historical image tile and the classification result corresponding to the historical image tile, the classification result being used to characterize the importance of the original image tile in the original image, the historical image tile being obtained by segmenting a historical image, and the historical image being the original image acquired before the current time; a determination unit, configured to determine a corresponding predetermined chaotic encryption method based on the classification results, wherein any two predetermined chaotic encryption methods have different scrambling times; and an encryption unit, configured to encrypt the original image tiles using the predetermined chaotic encryption method to obtain encrypted image tiles.

[0014] According to another aspect of this application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute any of the methods described by the computer program.

[0015] Applying the technical solution of this application, firstly, an original image is acquired and segmented to obtain multiple original image patches. The original image includes at least the user's identity information. Next, historical image patches and their corresponding classification results are acquired. These multiple original image patches are input into a classification network to obtain classification results corresponding to the original image patches. The classification results characterize the importance of the original image patch within the original image. Historical image patches are obtained by segmenting historical images, which are original images acquired before the current time. Then, based on the classification results, a predetermined chaotic encryption method is determined, wherein any two predetermined chaotic encryption methods have different scrambling times. Finally, the predetermined chaotic encryption method is used to encrypt the original image patches, resulting in encrypted image patches. By segmenting the acquired original image data to obtain original image patches, which are then fed into a classification network and classified according to their importance within the original image, different encryption methods are used for original image patches of different importance. Furthermore, the encryption parameters for patches of the same category also have a certain degree of randomness, thus solving the technical problem of high risk of decryption of encrypted images in existing technologies. Attached Figure Description

[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal performing an image encryption method according to an embodiment of this application is shown;

[0018] Figure 2 A schematic flowchart of an image encryption method according to an embodiment of this application is shown;

[0019] Figure 3 A detailed flowchart of an image sharing method according to an embodiment of this application is shown;

[0020] Figure 4 A schematic flowchart of an image segmentation and classification method provided in an embodiment of this application is shown.

[0021] Figure 5 A detailed flowchart of an encrypted information storage and transmission method according to an embodiment of this application is shown.

[0022] Figure 6 A schematic flowchart of an image decryption method according to an embodiment of this application is shown;

[0023] Figure 7 A structural block diagram of an image encryption device provided according to an embodiment of this application is shown.

[0024] The above figures include the following reference numerals:

[0025] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation

[0026] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] As described in the background section, the process of encryption methods in the prior art is usually as follows: scrambling the entire image, generating a key, and encrypting. Since the above method is performed on the dimension of the entire image, it will result in all image areas having the same calculation method and the encryption parameters of the entire image being consistent. Once the key is successfully matched, all the original information can be obtained. In order to solve the above problems, the embodiments of this application provide an image encryption method, an image encryption device, and an electronic device.

[0030] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0031] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for an image encryption method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0032] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the image encryption method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] This embodiment provides an image encryption method that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0034] Figure 2 This is a flowchart of an image encryption method according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0035] Step S201: Obtain the original image, segment the original image to obtain multiple original image patches, wherein the original image includes at least the user's identity information;

[0036] Specifically, during the segmentation process, the dimensions of the multiple original image tiles can be the same or different. For example, the collected customer image data can be segmented into m image tiles X, each with a length and width of 128px. (i,j) .

[0037] Step S202: Obtain historical image patches and their corresponding classification results. Input multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification network is trained using multiple sets of historical data through machine learning. Each set of historical data includes: the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time.

[0038] Specifically, the aforementioned classification network can be a multilayer perceptron, convolutional neural network, recurrent neural network, support vector machine, decision tree, ensemble learning, or Bayesian classifier, etc. The importance level can be interpreted as the sensitivity of the data, for example, sensitive information such as faces, official seals, and textual information (e.g., amount, time, name) in images obtained by business personnel during fieldwork (e.g., pre-loan investigation, marketing, collection of documents). Considering both speed and accuracy, MobileNet V3 can be selected as the classification network. MobileNet is a lightweight network structure, and its backbone has already demonstrated excellent performance in areas such as object detection and semantic segmentation. Its input layer and final output layer can be specifically adjusted to meet the input and classification result requirements of this invention.

[0039] Step S203: Based on the above classification results, determine the corresponding predetermined chaotic encryption method, wherein the number of scrambling steps of any two of the above predetermined chaotic encryption methods is different;

[0040] Specifically, chaotic encryption primarily utilizes sequences generated iteratively by chaotic systems as a factor sequence for encryption transformation. The theoretical basis of chaotic encryption is the self-similarity of chaos, ensuring that locally selected chaotic key sets are similar in distribution to the overall system. Chaotic systems are highly sensitive to initial states, exhibit complex dynamics, and their distribution does not conform to probabilistic statistical principles; they are quasi-random sequences with complex structures that can provide quasi-random sequences with good randomness, correlation, and complexity, making chaotic systems difficult to reconstruct, analyze, and predict. In fact, a crucial aspect of the decryption protection provided by chaotic sequences is that even if the decryptor knows the equations that generate the chaotic sequence, it is difficult to guess the coefficient parameters and initial values ​​that determine the chaotic sequence. This is because these key values ​​originate from the rational number field (although these key values ​​are defined in the real number field, due to computer rounding errors, the actual processing of chaotic encryption sequences occurs in the rational number field). Rational numbers are dense in any region. Simple guessing is almost impossible to obtain the coefficient parameters.

[0041] Step S204: The original map block is encrypted using the predetermined chaotic encryption method described above to obtain an encrypted map block.

[0042] Specifically, Fridrich pioneered chaotic image encryption by introducing chaos into the field for the first time. Typical chaotic encryption systems involve scrambling the entire image, generating a key, and then encrypting. This process operates along the entire image dimension, resulting in identical computational costs across all image regions and consistent encryption parameters for the entire image. Once a key match is successful, all original information can be obtained. In this invention, the parameters corresponding to each image patch must first be decrypted before the patch itself can be decrypted. After obtaining all the original image patches, they are stitched together to restore the original image. This process can be approximated as scrambling the entire image along the patch dimension. Compared to typical chaotic encryption systems, this patch-based encryption method improves both encryption speed and overall security.

[0043] In this embodiment, firstly, an original image is acquired and segmented to obtain multiple original image tiles. The original image includes at least the user's identity information. Next, historical image tiles and their corresponding classification results are acquired. These multiple original image tiles are input into a classification network to obtain classification results corresponding to the original image tiles. The classification results characterize the importance of the original image tiles within the original image. Historical image tiles are obtained by segmenting historical images, which are original images acquired up to the current time. Then, based on the classification results, a predetermined chaotic encryption method is determined, where any two predetermined chaotic encryption methods have different scrambling times. Finally, the predetermined chaotic encryption method is used to encrypt the original image tiles, resulting in encrypted image tiles. By segmenting the acquired original image data to obtain original image tiles, which are then fed into a classification network and classified according to their importance within the original image, different encryption methods are used for original image tiles of different importance. Furthermore, the encryption parameters for tiles of the same category also have a certain degree of randomness, thus solving the technical problem of high risk of decryption of encrypted images in existing technologies.

[0044] In the specific implementation process, the above classification results include a first category and a second category. The historical patch corresponding to the first category is more important than the historical patch corresponding to the second category in the historical image. Step S202 can be implemented through the following steps: Step S2021, if the historical patch includes at least the user's identity information, determine the classification result corresponding to the historical patch as the first category; Step S2022, if the historical patch does not include the user's identity information, determine the classification result corresponding to the historical patch as the second category. This method further refines the specific classification categories of the above classification network.

[0045] Specifically, the aforementioned user identity information can be a face, an official seal, or text information (such as amount, time, name), etc.

[0046] To further refine the specific content of the first category, the aforementioned identity information includes biometric information, identification information, and text information. Step S2021 of this application can be implemented through the following steps: Step S20211, if the historical map includes at least the aforementioned biometric information, determine the classification result corresponding to the historical map as a first subcategory, wherein the aforementioned biometric information is the information used by the user for biometric identification; Step S20212, if the historical map includes at least the aforementioned identification information, determine the classification result corresponding to the historical map as a second subcategory, wherein the aforementioned identification information is used to uniquely identify the user's identity; Step S20213, if the historical map includes at least the aforementioned text information, determine the classification result corresponding to the historical map as a third subcategory, wherein the aforementioned text information includes at least the user's text information; Step S20214, perform clustering processing on the first subcategory, the second subcategory, and the third subcategory to obtain the first category.

[0047] Specifically, the aforementioned biometric information can include user DNA sequence, fingerprints, voice, facial features, iris, hair, and other biometric characteristics. The aforementioned identification information can include name, ID number, and ID photo. The aforementioned text information can include amounts, times, and names related to sensitive information. The above-mentioned method of first classifying and then clustering further simplifies the classification and labeling process. For example, faces, official seals, and text information are classified as sensitive information, while other images are classified as simple information. Therefore, a four-classification network is needed to classify the segmented images, where 0 represents faces, 1 represents official seals, 2 represents text information, and 3 represents others. After obtaining the classification labels, results with values ​​[0, 1, 2] are aggregated into one class, and 3 is in a separate class. The classification mapping relationship of the network is shown in Table 1. Therefore, after passing through the classification network, a set of length n is obtained, which contains the corresponding location index of the image patch and the sensitivity indicator.

[0048] Table 1. Classification Mapping Relationship of Networks

[0049] Category face Official Seal text other Final Category sensitive sensitive sensitive Simple

[0050] Step S204 above can be implemented in other ways, for example: Step S2041, establish a coordinate system with the midpoint of the original image block as the origin, and determine the original coordinates of each first pixel point within the original image block; Step S2042, generate a key based on the original coordinates of each first pixel point; Step S2043, scramble the original image block to obtain a scrambled image block; Step S2044, encrypt the scrambled image block using the key to obtain the encrypted image block. This method can further achieve chaotic encryption more quickly.

[0051] Specifically, chaotic encryption is a technique that uses random sequences generated by chaotic systems for encryption. The specific steps are as follows: First, a suitable chaotic system is selected as the basis for the encryption algorithm, such as the logistic map, Henon map, or Lorenz system; the parameters of the chaotic system are set, including initial conditions and control parameters, and the system is initialized; iterative calculations are performed through the chaotic system to generate a chaotic sequence; plaintext data is mapped onto the chaotic sequence and scrambled to create a complex correlation between the plaintext data and the chaotic sequence; the scrambled data is XORed with the key to obtain the encrypted ciphertext data.

[0052] In some embodiments, step S2042 can be implemented by the following steps: Step S20421, according to the formula Calculate the mapped coordinates of the first pixel, where x i Let y be the original x-coordinate of the i-th pixel mentioned above. i Let x be the original ordinate of the i-th pixel mentioned above. i+1 Let y be the mapped x-coordinate of the i-th of the first pixel mentioned above. i+1 Let α be the ordinate of the i-th first pixel, α∈[0,1], β∈[0,3]; Step S20422, according to the formula K=mod(round(S i )×10 6 The key K is calculated using the formula (256), where mod() performs modulo operation and round() performs remainder operation. This method generates chaotic maps using 2D sine logistic regression, further enhancing randomness and complexity.

[0053] Specifically, in the above encryption process, the chaotic sequence is generated using 2D sine logistic to generate chaotic mapping. 2D sine logistic chaotic encryption is an encryption algorithm based on nonlinear dynamic systems. This algorithm first converts the plaintext data into a two-dimensional matrix, and then uses the sine logistic chaotic system to generate a series of chaotic sequences as keys. By performing a series of operations on the plaintext matrix and the key matrix, the plaintext data is encrypted into ciphertext.

[0054] The aforementioned scrambled image block includes multiple second pixels. Step S2043 can be implemented as follows: Step S20431, according to the formula... The original image above is scrambled, where x i Let y be the original x-coordinate of the i-th pixel mentioned above. i Let x be the original ordinate of the i-th pixel mentioned above. ′ Let y be the x-coordinate of the i-th second pixel mentioned above. ′ Let be the ordinate of the i-th second pixel mentioned above. This method can further accelerate the above scrambling process.

[0055] Specifically, for the original image tiles classified into the first category by the classification network, they carry a large amount of information. Generally, these image tiles can be considered to carry information containing customer privacy, and these image tiles need to be encrypted more carefully. For the original image tiles of the first category, a random number within the interval [a, b] can be used as the number of scrambling attempts N. h For original patches whose final category is classified as the second category by the classification network, their foreground is relatively simple and carries only limited information. For such patches, a random number within the interval [c,d] is used as the scrambling iteration N. l , where N l <N h .

[0056] The aforementioned encrypted image block includes multiple encrypted pixels, and the aforementioned scrambled image block includes multiple second pixels. Step S2044 includes: Step S20441, determining whether the pixel to be encrypted is the first of the aforementioned second pixels in the aforementioned scrambled image block, wherein the pixel to be encrypted is any one of the multiple aforementioned second pixels; Step S20442, if the pixel to be encrypted is the first of the aforementioned second pixels in the aforementioned scrambled image block, according to the formula... The aforementioned pixels to be encrypted are then encrypted to obtain the aforementioned encrypted pixels. in, For the above key, For the above pixels to be encrypted, For XOR operation; Step S20443, if the pixel to be encrypted is not the first second pixel in the scrambled image block, according to the formula The aforementioned pixels to be encrypted are then encrypted to obtain the aforementioned encrypted pixels. in, This refers to the second pixel preceding the pixel to be encrypted. This method can further reduce the computational load, thereby improving overall performance.

[0057] Specifically, the generation of the chaotic sequence of the original tiles in the first category will also involve more iterations to generate a pseudo-random number sequence K that is closer to random numbers. h The chaotic sequence K of the original tiles in the second category. l The generation process involves fewer iterations, achieving a certain level of encryption capability while reducing computational load and improving overall performance. Furthermore, the tile-based approach allows for multi-threaded processing of single, complete images, further enhancing encryption speed. Experiments using the method described in this application show that, in a 1280×1280 image scenario, encrypting the entire image using the same method takes 220.55 seconds. However, when the image is cropped into 128×128 tiles and a different encryption method is used, the time drops to 155.76 seconds. Using a multi-threaded (8-thread) approach further reduces the time to 19.47 seconds. Therefore, the encryption method of this invention significantly improves encryption speed and provides greater performance gains compared to encrypting the entire image, especially in scenarios with limited sensitive foreground information.

[0058] In another embodiment, after step S204, the method further includes step S205, according to the formula... The encrypted text P corresponding to the above encrypted image block is calculated, where R is the position of the above encrypted image block in the above original image, N is the number of times the above encrypted image block is scrambled, K is the key of the above encrypted image block, and γ is used to characterize the classification result of the above encrypted image block. For the predetermined encryption rules; in step S206, the above-mentioned encrypted blocks and the above-mentioned encrypted text are encapsulated to obtain encapsulated data {X}. ( ′ i,j) ,P (i,j)}, where X ( ′ i,j) For the above encrypted block, P (i,j) The above-mentioned encrypted text; step S207, after encrypting all the above-mentioned original tiles in the above-mentioned original image, a data set is obtained, wherein the above-mentioned data set includes multiple randomly arranged encapsulated data. This method performs secondary scrambling at the tile level, which can further improve the security of the system.

[0059] Specifically, the aforementioned pre-defined encryption rules can be encrypted using rules that comply with national cryptographic transmission requirements. In practical applications, data can be saved locally or transmitted to an internal system according to business needs. Both storage and transmission are encrypted. Even if the device is physically lost, it is difficult to retrieve the collected data solely through data recovery from the storage chip, thus strengthening the privacy protection of customer data.

[0060] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the image encryption method of this application will be described in detail below with reference to specific embodiments.

[0061] Example 1

[0062] Example 1 relates to a specific image sharing method, taking a customer image as an example, such as... Figure 3 As shown, it includes the following steps:

[0063] Step S11: Image segmentation and classification to obtain image patches;

[0064] Step S12: Image block encryption;

[0065] Step S13: Encrypted information storage and transmission, which can be performed locally or internally;

[0066] Step S14: Image decryption.

[0067] Example 2

[0068] Example 2 relates to a specific image segmentation and classification method, such as... Figure 4 As shown, it includes the following steps:

[0069] Step S21: Obtain the original image;

[0070] Step S22: Image segmentation to obtain image patches;

[0071] Step S23: Classify the tiles to obtain sensitive tiles and general tiles;

[0072] Step S24: Scramble sensitive blocks and scramble general blocks, with the number of scrambling operations for sensitive blocks being greater than the number of scrambling operations for general blocks;

[0073] Step S25: Encrypt the scrambled sensitive blocks and the scrambled general graph using a chaotic sequence;

[0074] Step S26: Reassemble in random order to obtain encrypted data.

[0075] Example 3

[0076] Example 3 relates to a specific method for storing and transmitting encrypted information, such as... Figure 5 As shown, it includes the following steps:

[0077] Step S31: Concatenate the tile index R, scrambling times N, key K obtained through the chaotic sequence, and identifier γ according to certain rules. Then, encrypt the concatenated string using rules that comply with national cryptographic transmission requirements.

[0078] Step S32: Further encapsulate the encrypted tiles and encrypted text information into one-to-one corresponding objects {img:X ( ′ i,j) ,param:P (i,j) Once all the image tiles have been processed, the encrypted data set corresponding to the overall image is obtained, and the objects in the set are arranged in a random order.

[0079] Example 4

[0080] Example 4 relates to a specific image decryption method, such as... Figure 6 As shown, it includes the following steps:

[0081] Step S41: Obtain the encrypted data set;

[0082] Step S42: Extract m objects containing encrypted text information and images from the encrypted data {img:X ( ′ i,j) ,param:P (i,j)};

[0083] Step S43: Process text information P (i,j) Decryption is performed to obtain the corresponding chaotic sequence and scrambling count of the graph pieces;

[0084] Step S43: Decrypt the blocks and then perform a descrambling operation on the decrypted blocks;

[0085] Step S44: After all elements have been traversed and decrypted, the image blocks are pieced together according to their index positions to obtain the decrypted original image.

[0086] This application also provides an image encryption device. It should be noted that the image encryption device of this application can be used to execute the image encryption method provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0087] The image encryption device provided in the embodiments of this application will be described below.

[0088] Figure 7 This is a schematic diagram of an image encryption device according to an embodiment of this application. Figure 7 As shown, the device includes:

[0089] The acquisition unit 10 is used to acquire an original image, segment the original image to obtain multiple original image patches, and the original image includes at least the user's identity information.

[0090] Specifically, during the segmentation process, the dimensions of the multiple original image tiles can be the same or different. For example, the collected customer image data can be segmented into m image tiles X, each with a length and width of 128px. (i,j) .

[0091] Input unit 20 is used to obtain historical image patches and the classification results corresponding to the historical image patches, input multiple original image patches into the classification network to obtain the classification results corresponding to the original image patches, wherein the classification network is trained by machine learning using multiple sets of historical data, each set of the multiple sets of historical data includes: the historical image patch and the classification results corresponding to the historical image patch, the classification results are used to characterize the importance of the original image patch in the original image, the historical image patch is obtained by segmenting the historical image, and the historical image is the original image obtained before the current time.

[0092] Specifically, the aforementioned classification network can be a multilayer perceptron, convolutional neural network, recurrent neural network, support vector machine, decision tree, ensemble learning, or Bayesian classifier, etc. The importance level can be interpreted as the sensitivity of the data, for example, sensitive information such as faces, official seals, and textual information (e.g., amount, time, name) in images obtained by business personnel during fieldwork (e.g., pre-loan investigation, marketing, collection of documents). Considering both speed and accuracy, MobileNet V3 can be selected as the classification network. MobileNet is a lightweight network structure, and its backbone has already demonstrated excellent performance in areas such as object detection and semantic segmentation. Its input layer and final output layer can be specifically adjusted to meet the input and classification result requirements of this invention.

[0093] The determining unit 30 is used to determine the corresponding predetermined chaotic encryption method based on the above classification results, wherein any two of the above predetermined chaotic encryption methods have different scrambling times;

[0094] Specifically, chaotic encryption primarily utilizes sequences generated iteratively by chaotic systems as a factor sequence for encryption transformation. The theoretical basis of chaotic encryption is the self-similarity of chaos, ensuring that locally selected chaotic key sets are similar in distribution to the overall system. Chaotic systems are highly sensitive to initial states, exhibit complex dynamics, and their distribution does not conform to probabilistic statistical principles; they are quasi-random sequences with complex structures that can provide quasi-random sequences with good randomness, correlation, and complexity, making chaotic systems difficult to reconstruct, analyze, and predict. In fact, a crucial aspect of the decryption protection provided by chaotic sequences is that even if the decryptor knows the equations that generate the chaotic sequence, it is difficult to guess the coefficient parameters and initial values ​​that determine the chaotic sequence. This is because these key values ​​originate from the rational number field (although these key values ​​are defined in the real number field, due to computer rounding errors, the actual processing of chaotic encryption sequences occurs in the rational number field). Rational numbers are dense in any region. Simple guessing is almost impossible to obtain the coefficient parameters.

[0095] The encryption unit 40 is used to encrypt the original map block using the predetermined chaotic encryption method described above, so as to obtain an encrypted map block.

[0096] Specifically, Fridrich pioneered chaotic image encryption by introducing chaos into the field for the first time. Typical chaotic encryption systems involve scrambling the entire image, generating a key, and then encrypting. This process operates along the entire image dimension, resulting in identical computational costs across all image regions and consistent encryption parameters for the entire image. Once a key match is successful, all original information can be obtained. In this invention, the parameters corresponding to each image patch must first be decrypted before the patch itself can be decrypted. After obtaining all the original image patches, they are stitched together to restore the original image. This process can be approximated as scrambling the entire image along the patch dimension. Compared to typical chaotic encryption systems, this patch-based encryption method improves both encryption speed and overall security.

[0097] In this embodiment, the acquisition unit acquires the original image, segments the original image to obtain multiple original image patches, and the original image includes at least the user's identity information; the input unit acquires historical image patches and their corresponding classification results, inputs the multiple original image patches into the classification network, and obtains the classification results corresponding to the original image patches. The classification results are used to characterize the importance of the original image patches in the original image. The historical image patches are obtained by segmenting historical images, and the historical images are the original images acquired before the current time; the determination unit determines the corresponding predetermined chaotic encryption method based on the classification results, wherein any two predetermined chaotic encryption methods have different scrambling times; the encryption unit encrypts the original image patches using the predetermined chaotic encryption method to obtain encrypted image patches. By segmenting the acquired original image data to obtain original image patches, which are then sent to the classification network and classified according to their importance in the original image, different encryption methods are used for original image patches of different importance. At the same time, the encryption parameters of the same category of image patches also have a certain degree of randomness, which solves the technical problem of high risk of decryption of encrypted images in the prior art.

[0098] In the specific implementation process, the classification results include a first category and a second category. The historical patch corresponding to the first category is more important than the historical patch corresponding to the second category in the historical image. The input unit includes a first determining module and a second determining module. The first determining module is used to determine the classification result corresponding to the historical patch as the first category when the historical patch includes at least the user's identity information. The second determining module is used to determine the classification result corresponding to the historical patch as the second category when the historical patch does not include the user's identity information. This device further refines the specific classification categories of the classification network.

[0099] Specifically, the aforementioned user identity information can be a face, an official seal, or text information (such as amount, time, name), etc.

[0100] To further refine the specific content of the first category, the aforementioned identity information includes biometric information, identification information, and text information. The first determining module of this application includes a first determining submodule, a second determining submodule, a third determining submodule, and a first processing submodule. The first determining submodule is used to determine the classification result corresponding to the historical map patch as a first subcategory when the historical map patch includes at least the aforementioned biometric information, wherein the aforementioned biometric information is the information used by the user for biometric identification. The second determining submodule is used to determine the classification result corresponding to the historical map patch as a second subcategory when the historical map patch includes at least the aforementioned identification information, wherein the aforementioned identification information is used to uniquely identify the user's identity. The third determining submodule is used to determine the classification result corresponding to the historical map patch as a third subcategory when the historical map patch includes at least the aforementioned text information, wherein the aforementioned text information includes at least the user's text information. The first processing submodule is used to perform clustering processing on the first subcategory, the second subcategory, and the third subcategory to obtain the first category.

[0101] Specifically, the aforementioned biometric information can include user DNA sequence, fingerprints, voice, facial features, iris, hair, and other biometric characteristics. The aforementioned identification information can include name, ID number, and ID photo. The aforementioned text information can include amounts, times, and names related to sensitive information. The above-mentioned method of first classifying and then clustering further simplifies the classification and labeling process. For example, faces, official seals, and text information are classified as sensitive information, while other images are classified as simple information. Therefore, a four-classification network is needed to classify the segmented images, where 0 represents faces, 1 represents official seals, 2 represents text information, and 3 represents others. After obtaining the classification labels, results with values ​​[0, 1, 2] are aggregated into one class, and 3 is in a separate class. The classification mapping relationship of the network is shown in Table 1. Therefore, after passing through the classification network, a set of length n is obtained, which contains the corresponding location index of the image patch and the sensitivity indicator.

[0102] The aforementioned encryption unit includes a third determining module, a generating module, a processing module, and an encryption module. The third determining module establishes a coordinate system with the midpoint of the original image patch as the origin, determining the original coordinates of each first pixel within the original image patch. The generating module generates a key based on the original coordinates of each first pixel. The processing module scrambles the original image patch to obtain a scrambled image patch. The encryption module encrypts the scrambled image patch using the key to obtain an encrypted image patch. This device can further achieve chaotic encryption more quickly.

[0103] Specifically, chaotic encryption is a technique that uses random sequences generated by chaotic systems for encryption. The specific steps are as follows: First, select a suitable chaotic system as the basis for the encryption algorithm, such as the logistic map, Henon map, or Lorenz system; set the parameters of the chaotic system, including initial conditions and control parameters, and initialize the system; perform iterative calculations through the chaotic system to generate a chaotic sequence; map the plaintext data onto the chaotic sequence and scramble it to create a complex correlation between the plaintext data and the chaotic sequence; perform an XOR operation between the scrambled data and the key to obtain the encrypted ciphertext data.

[0104] In some embodiments, the above-mentioned generation module includes a first calculation submodule and a second calculation submodule, wherein the first calculation submodule is used to calculate according to the formula Calculate the mapped coordinates of the first pixel, where x i Let y be the original x-coordinate of the i-th pixel mentioned above. i Let x be the original ordinate of the i-th pixel mentioned above. i+1 Let y be the mapped x-coordinate of the i-th of the first pixel mentioned above. i+1 Let α be the ordinate of the i-th first pixel, α ∈ [0, 1], β ∈ [0, 3]; the second calculation submodule is used to calculate K according to the formula K = mod(round(S) i )×10 6 The key K is calculated using the formula (256), where mod() performs modulo operation and round() performs remainder operation. This device generates chaotic maps using 2D sine logistic regression, further enhancing randomness and complexity.

[0105] Specifically, in the above encryption process, the chaotic sequence is generated using 2D sine logistic to generate chaotic mapping. 2D sine logistic chaotic encryption is an encryption algorithm based on nonlinear dynamic systems. This algorithm first converts the plaintext data into a two-dimensional matrix, and then uses the sine logistic chaotic system to generate a series of chaotic sequences as keys. By performing a series of operations on the plaintext matrix and the key matrix, the plaintext data is encrypted into ciphertext.

[0106] The aforementioned scrambled image block includes multiple second pixels, and the aforementioned processing module includes a second processing submodule, used to process the image according to the formula. The original image above is scrambled, where x i Let y be the original x-coordinate of the i-th pixel mentioned above. i Let x be the original ordinate of the i-th pixel mentioned above. ′ Let y be the x-coordinate of the i-th second pixel mentioned above.′ Let be the ordinate of the i-th second pixel. This device can further accelerate the above-mentioned scrambling process.

[0107] Specifically, for the original image tiles classified into the first category by the classification network, they carry a large amount of information. Generally, these image tiles can be considered to carry information containing customer privacy, and these image tiles need to be encrypted more carefully. For the original image tiles of the first category, a random number within the interval [a, b] can be used as the number of scrambling attempts N. h For original patches whose final category is classified as the second category by the classification network, their foreground is relatively simple and carries only limited information. For such patches, a random number within the interval [c,d] is used as the scrambling iteration N. l , where N l <N h .

[0108] The aforementioned encrypted image block includes multiple encrypted pixels, the aforementioned scrambled image block includes multiple second pixels, and the aforementioned encryption module includes a fourth determining submodule, a first encryption submodule, and a second encryption submodule. The fourth determining submodule is used to determine whether the pixel to be encrypted is the first of the aforementioned second pixels in the aforementioned scrambled image block, wherein the pixel to be encrypted is any one of the multiple aforementioned second pixels. The first encryption submodule is used to, when the pixel to be encrypted is the first of the aforementioned second pixels in the aforementioned scrambled image block, determine whether the pixel to be encrypted is the first of the aforementioned second pixels according to the formula... The aforementioned pixels to be encrypted are then encrypted to obtain the aforementioned encrypted pixels. in, For the above key, For the above pixels to be encrypted, The second encryption submodule is used to perform an XOR operation when the pixel to be encrypted is not the first second pixel in the scrambled image block, according to the formula... The aforementioned pixels to be encrypted are then encrypted to obtain the aforementioned encrypted pixels. in, This refers to the preceding second pixel in the aforementioned pixel to be encrypted. This device can further reduce computational load, thereby improving overall performance.

[0109] Specifically, the generation of the chaotic sequence of the original tiles in the first category will also involve more iterations to generate a pseudo-random number sequence K that is closer to random numbers. h The chaotic sequence K of the original tiles in the second category. lThe generation process involves fewer iterations, achieving a certain level of encryption capability while reducing computational load and improving overall performance. Furthermore, the tile-based approach allows for multi-threaded processing of single, complete images, further enhancing encryption speed. Experiments using the method described in this application show that, in a 1280×1280 image scenario, encrypting the entire image using the same method takes 220.55 seconds. However, when the image is cropped into 128×128 tiles and a different encryption method is used, the time drops to 155.76 seconds. Using a multi-threaded (8-thread) approach further reduces the time to 19.47 seconds. Therefore, the encryption method of this invention significantly improves encryption speed and provides greater performance gains compared to encrypting the entire image, especially in scenarios with limited sensitive foreground information.

[0110] In another embodiment, the above-described apparatus further includes a calculation unit, a first processing unit, and a second processing unit, wherein the calculation unit is used to process the data according to the formula... The encrypted text P corresponding to the above encrypted image block is calculated, where R is the position of the above encrypted image block in the above original image, N is the number of times the above encrypted image block is scrambled, K is the key of the above encrypted image block, and γ is used to characterize the classification result of the above encrypted image block. Based on predetermined encryption rules, the first processing unit encapsulates the aforementioned encrypted blocks and encrypted text to obtain encapsulated data {X}. ( ′ i,j) ,P (i,j)}, where X ( ′ i,j) For the above encrypted block, P (i,j) The first processing unit encrypts all the original tiles in the original image to obtain a data set, which includes multiple randomly arranged encapsulated data. This device performs secondary scrambling at the tile level, further enhancing system security.

[0111] Specifically, the aforementioned pre-defined encryption rules can be encrypted using rules that comply with national cryptographic transmission requirements. In practical applications, data can be saved locally or transmitted to an internal system according to business needs. Both storage and transmission are encrypted. Even if the device is physically lost, it is difficult to retrieve the collected data solely through data recovery from the storage chip, thus strengthening the privacy protection of customer data.

[0112] The aforementioned image encryption device includes a processor and a memory. The acquisition unit, input unit, determination unit, and encryption unit are all stored as program units in the memory, and the processor executes these program units to achieve their respective functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.

[0113] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and images can be encrypted by adjusting kernel parameters.

[0114] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0115] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device containing the computer-readable storage medium to execute the image encryption method.

[0116] Specifically, image encryption methods include:

[0117] Step S201: Obtain the original image, segment the original image to obtain multiple original image patches, wherein the original image includes at least the user's identity information;

[0118] Step S202: Obtain historical image patches and their corresponding classification results. Input multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification network is trained using multiple sets of historical data through machine learning. Each set of historical data includes: the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time.

[0119] Step S203: Based on the above classification results, determine the corresponding predetermined chaotic encryption method, wherein the number of scrambling steps of any two of the above predetermined chaotic encryption methods is different;

[0120] Step S204: The original map block is encrypted using the predetermined chaotic encryption method described above to obtain an encrypted map block.

[0121] This invention provides a processor for running a program, wherein the program executes the image encryption method described above.

[0122] Specifically, image encryption methods include:

[0123] Step S201: Obtain the original image, segment the original image to obtain multiple original image patches, wherein the original image includes at least the user's identity information;

[0124] Step S202: Obtain historical image patches and their corresponding classification results. Input multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification network is trained using multiple sets of historical data through machine learning. Each set of historical data includes: the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time.

[0125] Step S203: Based on the above classification results, determine the corresponding predetermined chaotic encryption method, wherein the number of scrambling steps of any two of the above predetermined chaotic encryption methods is different;

[0126] Step S204: The original map block is encrypted using the predetermined chaotic encryption method described above to obtain an encrypted map block.

[0127] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:

[0128] Step S201: Obtain the original image, segment the original image to obtain multiple original image patches, wherein the original image includes at least the user's identity information;

[0129] Step S202: Obtain historical image patches and their corresponding classification results. Input multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification network is trained using multiple sets of historical data through machine learning. Each set of historical data includes: the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time.

[0130] Step S203: Based on the above classification results, determine the corresponding predetermined chaotic encryption method, wherein the number of scrambling steps of any two of the above predetermined chaotic encryption methods is different;

[0131] Step S204: The original map block is encrypted using the predetermined chaotic encryption method described above to obtain an encrypted map block.

[0132] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0133] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:

[0134] Step S201: Obtain the original image, segment the original image to obtain multiple original image patches, wherein the original image includes at least the user's identity information;

[0135] Step S202: Obtain historical image patches and their corresponding classification results. Input multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification network is trained using multiple sets of historical data through machine learning. Each set of historical data includes: the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time.

[0136] Step S203: Based on the above classification results, determine the corresponding predetermined chaotic encryption method, wherein the number of scrambling steps of any two of the above predetermined chaotic encryption methods is different;

[0137] Step S204: The original map block is encrypted using the predetermined chaotic encryption method described above to obtain an encrypted map block.

[0138] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0139] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0143] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0144] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0145] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0146] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0147] As can be seen from the above description, the embodiments of this application achieve the following technical effects:

[0148] 1) The image encryption method of this application firstly acquires an original image, segments it to obtain multiple original image patches, and the original image includes at least the user's identity information; then, it acquires historical image patches and their corresponding classification results, inputs the multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification results are used to characterize the importance of the original image patches in the original image. The historical image patches are obtained by segmenting historical images, which are original images acquired before the current time. Then, based on the classification results, a corresponding predetermined chaotic encryption method is determined, wherein any two predetermined chaotic encryption methods have different scrambling times; finally, the predetermined chaotic encryption method is used to encrypt the original image patches to obtain encrypted image patches. By segmenting the acquired original image data to obtain original image patches, which are then fed into a classification network and classified according to their importance in the original image, different encryption methods are used for original image patches of different importance. At the same time, the encryption parameters of the same category of image patches also have a certain degree of randomness, solving the technical problem of high risk of decryption of encrypted images in the prior art.

[0149] 2) The image encryption device of this application includes an acquisition unit that acquires an original image, segments the original image to obtain multiple original image patches, and the original image includes at least the user's identity information; an input unit that acquires historical image patches and their corresponding classification results, inputs the multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches, the classification results being used to characterize the importance of the original image patches in the original image, the historical image patches being obtained by segmenting historical images, and the historical images being the original images acquired before the current time; a determination unit that determines a corresponding predetermined chaotic encryption method based on the classification results, wherein any two predetermined chaotic encryption methods have different scrambling times; and an encryption unit that encrypts the original image patches using the predetermined chaotic encryption method to obtain encrypted image patches. By segmenting the acquired original image data to obtain original image patches, which are then sent to a classification network and classified according to their importance in the original image, different encryption methods are used for original image patches of different importance, and the encryption parameters of the same category of image patches also have a certain degree of randomness, thus solving the technical problem of high risk of decryption of encrypted images in the prior art.

[0150] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An image encryption method, characterized in that, include: The original image is acquired and segmented to obtain multiple original image patches. The original image includes at least the user's identity information. A historical image patch and its corresponding classification result are obtained. Multiple original image patches are input into a classification network to obtain the classification result corresponding to the original image patch. The classification network is trained by machine learning using multiple sets of historical data. Each set of historical data includes the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time. Based on the classification results, a corresponding predetermined chaotic encryption method is determined, wherein any two predetermined chaotic encryption methods have different scrambling times; The original map tile is encrypted using the predetermined chaotic encryption method to obtain an encrypted map tile.

2. The method according to claim 1, characterized in that, The classification results include a first category and a second category. The historical tiles corresponding to the first category are more important in the historical images than the historical tiles corresponding to the second category. Obtaining the classification results corresponding to the historical tiles includes: If the historical map includes at least the user's identity information, the classification result corresponding to the historical map is determined to be the first category; If the historical map does not include the user's identity information, the classification result corresponding to the historical map is determined to be the second category.

3. The method according to claim 2, characterized in that, The identity information includes biometric information, identification information, and text information. When the historical map tile includes at least the user's identity information, determining the classification result corresponding to the historical map tile as the first category includes: If the historical map patch includes at least the biometric information, the classification result corresponding to the historical map patch is determined as the first subcategory, wherein the biometric information is the information used by the user for biometric identification; If the historical map tile includes at least the identification information, the classification result corresponding to the historical map tile is determined to be the second sub-category, wherein the identification information is used to uniquely identify the user's identity; If the historical map tile includes at least the text information, the classification result corresponding to the historical map tile is determined to be the third subcategory, wherein the text information includes at least the user's text information; Clustering is performed on the first sub-category, the second sub-category, and the third sub-category to obtain the first category.

4. The method according to claim 1, characterized in that, The original map tile is encrypted using the predetermined chaotic encryption method to obtain an encrypted map tile, including: A coordinate system is established with the midpoint of the original image block as the origin, and the original coordinates of each first pixel point within the original image block are determined. Generate a key based on the original coordinates of each of the first pixels; The original tiles are scrambled to obtain scrambled tiles; The scrambled block is encrypted using the key to obtain the encrypted block.

5. The method according to claim 4, characterized in that, The scrambled image block includes multiple second pixels. The original image block is scrambled to obtain a scrambled image block, including: According to the formula The original image is scrambled, wherein... For the first The original x-coordinate of the first pixel. For the first The original ordinate of the first pixel point for The x-coordinate of the second pixel point For the first The ordinate of the second pixel.

6. The method according to claim 4, characterized in that, The encrypted image block includes multiple encrypted pixels, and the scrambled image block includes multiple second pixels. The scrambled image block is encrypted using the key to obtain the encrypted image block, which includes: Determine whether the pixel to be encrypted is the first second pixel in the scrambled image block, wherein the pixel to be encrypted is any one of a plurality of second pixels; When the pixel to be encrypted is the first second pixel in the scrambled image block, according to the formula... The pixel to be encrypted is encrypted to obtain the encrypted pixel. ,in, The key. For the pixel to be encrypted, This is an XOR operation; If the pixel to be encrypted is not the first second pixel in the scrambled image block, according to the formula... The pixel to be encrypted is encrypted to obtain the encrypted pixel. ,in, The second pixel is the one preceding the pixel to be encrypted.

7. The method according to claim 1, characterized in that, After obtaining the encrypted tile, the method further includes: According to the formula The encrypted text P corresponding to the encrypted image block is calculated, where R is the position of the encrypted image block in the original image, N is the number of times the encrypted image block is scrambled, and K is the key of the encrypted image block. The classification result used to characterize the encrypted map patch Pre-defined encryption rules; The encrypted image and the encrypted text are encapsulated to obtain encapsulated data. ,in, For the encrypted block, The encrypted text; After encrypting all the original tiles in the original image, a data set is obtained, wherein the data set includes multiple encapsulated data arranged in random order.

8. An image encryption device, characterized in that, include: An acquisition unit is used to acquire an original image, segment the original image to obtain multiple original image patches, wherein the original image includes at least the user's identity information; An input unit is used to obtain historical image patches and their corresponding classification results, and to input multiple original image patches into a classification network to obtain the classification results corresponding to the original image patches. The classification network is trained by machine learning using multiple sets of historical data. Each set of historical data includes the historical image patch and its corresponding classification result. The classification result is used to characterize the importance of the original image patch in the original image. The historical image patch is obtained by segmenting the historical image. The historical image is the original image obtained before the current time. A determining unit is configured to determine a corresponding predetermined chaotic encryption method based on the classification result, wherein any two predetermined chaotic encryption methods have different scrambling times; An encryption unit is used to encrypt the original map block using the predetermined chaotic encryption method to obtain an encrypted map block.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Method and device for installing, configuring and activating tool software

    CN113220315A

  • Image forming system, server, image forming apparatus, and image forming method that reduce server capacity and allows to pull print

    US20200341702A1