GPU (Graphics Processing Unit) data encryption method, equipment and medium
Through deep neural networks and multi-dimensional chaotic mapping technology, the image encryption area is dynamically determined and encrypted, solving the problem of insufficient flexibility and security of existing GPU encryption methods, and achieving efficient and secure image encryption.
Patent Information
- Application Number
- CN202510102671.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-16
AI Technical Summary
The existing GPU encryption methods have obvious limitations in terms of flexibility and encryption strength, and it is difficult to dynamically adjust according to actual needs. The security of encrypted image data is difficult to guarantee when facing complex and changeable attack methods.
Through deep neural networks, the key information areas and non-critical information areas in the image are automatically learned, and the size, shape and position of the encrypted area are dynamically determined. Based on the encryption algorithm of multi-dimensional chaotic mapping, the image data in the encrypted area is encrypted, and the non-encrypted area is subjected to frequency domain changes and equalization processing, and the encrypted image is recombined.
It realizes the flexibility and targeted encryption, improves the security of encrypted image data, and achieves the best visual effect and noise resistance while maintaining the recognizable original content.
Smart Images

Figure CN120012132A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a GPU data encryption method, device and medium. Background Art
[0002] With the advent of the digital age, the security and privacy protection of image data have become important issues. As an important carrier of information transmission, images involve multiple industries and fields, so the security of image data is extremely important.
[0003] GPU (Graphics Processing Unit) is a microprocessor specially designed to handle complex graphics and computationally intensive tasks. Compared with CPU (central processing unit), GPU shows higher efficiency and performance when handling large-scale parallel computing tasks. This makes GPU play an important role in graphics rendering, video processing, scientific computing and encryption technology, which has received increasing attention in recent years.
[0004] However, existing GPU encryption methods have obvious limitations in terms of flexibility and encryption strength. After obtaining the image to be encrypted, traditional GPU encryption methods often use a fixed position and a fixed encryption algorithm to encrypt it, which is difficult to dynamically adjust according to actual needs. This fixed encryption method not only limits the flexibility of encryption, but also reduces the adaptability of encryption, making it difficult to ensure the security of encrypted image data when facing complex and changeable attack methods. Summary of the invention
[0005] The embodiments of the present application provide a GPU data encryption method, device and medium, which are used to solve the following technical problems: the existing GPU encryption methods have obvious limitations in flexibility and encryption strength. The traditional GPU encryption method limits the flexibility of encryption and reduces the adaptability of encryption, making it difficult to ensure the security of encrypted image data when facing complex and changeable attack methods.
[0006] The present application embodiment adopts the following technical solutions:
[0007] The embodiment of the present application provides a GPU data encryption method. The method includes obtaining an image to be encrypted input by a user and an encryption level corresponding to the image to be encrypted; performing key information area detection on the image to be encrypted by presetting a neural network model, so as to determine the encrypted area and the non-encrypted area in the image to be encrypted based on the detection result and the encryption level; coupling different types of chaotic mapping to generate a high-dimensional chaotic sequence; encrypting the image data in the encrypted area based on the GPU parallel processing architecture and the high-dimensional chaotic sequence; performing frequency domain change and equalization processing on the non-encrypted area, and recombining the processed non-encrypted area with the encrypted area to obtain an encrypted image.
[0008] The implementation of this application automatically learns the key information areas and non-key information areas in the image through a deep neural network, and dynamically determines the size, shape and position of the encryption area according to the encryption level set by the user and the analysis results of the image content, which can meet the diverse encryption needs while ensuring the flexibility and pertinence of the encryption. Secondly, the encryption algorithm based on the multidimensional chaotic mapping in the embodiment of this application not only has extremely high complexity and randomness, but also has strong correlations with each other, which increases the difficulty of cracking and improves the security of the encrypted image data. In addition, the embodiment of this application dynamically equalizes the image data outside the encryption area to ensure that the processed image achieves the best visual effect and noise resistance while maintaining the recognizability of the original content.
[0009] In one implementation of the present application, a key information area detection is performed on an image to be encrypted through a preset neural network model, so as to determine the encryption area in the image to be encrypted based on the detection result and the encryption level, specifically including: inputting the image to be encrypted into a preset neural network model, and performing key information area detection on the image to be encrypted through the preset neural network model, so as to divide the image to be encrypted into multiple blocks based on the detection result; determining the image information categories corresponding to the multiple blocks; matching the image information categories with the encryption levels to determine the encryption levels corresponding to the multiple blocks; determining the encryption area in the multiple blocks based on the encryption level, and determining the encryption parameters corresponding to the encryption area; wherein the encryption parameters include at least one of the encryption area, the encryption position and the encryption algorithm.
[0010] In one implementation of the present application, different types of chaotic maps are coupled with each other to generate a high-dimensional chaotic sequence, specifically including: constructing a Logistic mapping iterative function and a Tent mapping iterative function based on preset initial values; constructing a hybrid iterative function based on the Logistic mapping iterative function, the Tent mapping iterative function and a dynamic adjustment factor; and generating a high-dimensional chaotic sequence based on the hybrid iterative function.
[0011] In one implementation of the present application, a hybrid iterative function is constructed based on the Logistic mapping iterative function, the Tent mapping iterative function and the dynamic adjustment factor, specifically including: the Logistic mapping iterative function is:
[0012] x n+1 = r1·x n ·(1-x n );
[0013] The Tent mapping iteration function is:
[0014]
[0015] The mixed iterative function is:
[0016] z n =αx n +(1-α)·y n +γ·x n ·y n ;
[0017] Based on the hybrid iterative function, the image data in the encryption area is encrypted; wherein r1 is the first control parameter; r2 is the second control parameter; α is the dynamic adjustment factor; x n+1 is the iterative function of the Logistic mapping; y n+1 is the Tent mapping iterative function; γ is the nonlinear coefficient, z n is a mixed iterative function, and n is the number of iterations.
[0018] In one implementation of the present application, the dynamic adjustment factor is:
[0019]
[0020] Among them, α is the dynamic adjustment factor; θ is the parameter that controls the frequency of α change; and n is the number of iterations.
[0021] In one implementation of the present application, frequency domain transformation and equalization processing are performed on the non-encrypted area, and the processed non-encrypted area is recombined with the encrypted area to obtain an encrypted image, specifically including: converting the image corresponding to the non-encrypted area from the spatial domain to the frequency domain through a two-dimensional discrete Fourier transform; in the frequency domain, dynamically adjusting the parameters of the equalization function according to the spectral distribution characteristics of the image to dynamically equalize the spectrum of the image corresponding to the non-encrypted area; converting the image block after the equalization processing from the frequency domain to the spatial domain through a two-dimensional discrete Fourier inverse transform; and recombining the non-encrypted area and the encrypted area after the inverse transformation to obtain an encrypted image.
[0022] In one implementation of the present application, image data in an encrypted area is encrypted based on a GPU parallel processing architecture and a high-dimensional chaotic sequence, specifically including: assigning corresponding GPU threads to each encrypted area; mapping the value of the high-dimensional chaotic sequence to the same range as the image pixel value through multiple GPU threads, and replacing the image pixel value with the value of the high-dimensional chaotic sequence based on a preset encryption rule to achieve pixel replacement; wherein the preset encryption rule includes at least one of an exclusive-or operation and an addition operation; generating a permutation matrix based on the high-dimensional chaotic sequence, and permuting the pixel positions of the image pixels according to the permutation matrix; and completing the encryption process based on pixel replacement and pixel position permutation.
[0023] In one implementation of the present application, after determining the encrypted area and the non-encrypted area in the image to be encrypted based on the detection results and the encryption level, the method also includes: determining the upload time and the encryption area of the image to be encrypted; after a preset interval, obtaining the number of propagation times corresponding to the encrypted image; comparing the number of propagation times with the encryption level threshold table to determine the encryption upgrade level corresponding to the encrypted image based on the comparison result; based on a preset encryption level mapping relationship, determining the encryption extension area corresponding to the upgraded encryption level, so as to perform secondary encryption on the encrypted image based on the encryption extension area.
[0024] An embodiment of the present application provides a GPU data encryption device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: obtain an image to be encrypted input by a user and an encryption level corresponding to the image to be encrypted; perform key information area detection on the image to be encrypted through a preset neural network model, so as to determine an encrypted area and a non-encrypted area in the image to be encrypted based on the detection result and the encryption level; couple different types of chaotic mappings to generate a high-dimensional chaotic sequence; encrypt image data in the encrypted area based on the GPU parallel processing architecture and the high-dimensional chaotic sequence; perform frequency domain transformation and equalization processing on the non-encrypted area, and recombine the processed non-encrypted area with the encrypted area to obtain an encrypted image.
[0025] A non-volatile computer storage medium provided in an embodiment of the present application stores computer executable instructions, wherein the computer executable instructions are configured to: obtain an image to be encrypted input by a user and an encryption level corresponding to the image to be encrypted; perform key information area detection on the image to be encrypted by presetting a neural network model, so as to determine an encrypted area and a non-encrypted area in the image to be encrypted based on the detection result and the encryption level; couple different types of chaotic mappings to generate a high-dimensional chaotic sequence; encrypt image data in the encrypted area based on a GPU parallel processing architecture and a high-dimensional chaotic sequence; perform frequency domain transformation and equalization processing on the non-encrypted area, and recombine the processed non-encrypted area with the encrypted area to obtain an encrypted image.
[0026] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the implementation of the present application automatically learns the key information areas and non-key information areas in the image through a deep neural network, and dynamically determines the size, shape and position of the encryption area according to the encryption level set by the user and the analysis results of the image content, which can meet the diverse encryption needs while ensuring the flexibility and pertinence of the encryption. Secondly, the encryption algorithm based on the multidimensional chaotic mapping in the embodiments of the present application not only has extremely high complexity and randomness, but also has strong correlation with each other, which increases the difficulty of cracking and improves the security of the encrypted image data. In addition, the embodiments of the present application dynamically equalize the image data outside the encryption area to ensure that the processed image achieves the best visual effect and noise resistance while maintaining the recognizability of the original content. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0028] In the figure:
[0029] Figure 1 A flow chart of a GPU data encryption method provided in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of a GPU data encryption system provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the structure of a GPU data encryption device provided in an embodiment of the present application.
[0032] Reference numerals:
[0033] 200: GPU data encryption device, 201: processor, 202: memory. DETAILED DESCRIPTION
[0034] Embodiments of the present application provide a GPU data encryption method, device, and medium.
[0035] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0036] The technical solution proposed in the embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0037] Figure 1 A flowchart of a GPU data encryption method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the GPU data encryption method includes the following steps:
[0038] S101: Obtain an image to be encrypted input by a user and an encryption level corresponding to the image to be encrypted.
[0039] In one embodiment of the present application, an image to be encrypted and its encryption level input by a user are received to determine encryption parameters according to the encryption level, wherein the encryption parameters may include the size and position of the encryption area and the selection of the encryption algorithm.
[0040] S102: Perform key information area detection on the image to be encrypted by using a preset neural network model, so as to determine the encrypted area and the non-encrypted area in the image to be encrypted based on the detection result and the encryption level.
[0041] In one embodiment of the present application, an image to be encrypted is input into a preset neural network model, and a key information area detection is performed on the image to be encrypted by the preset neural network model, so as to divide the image to be encrypted into multiple blocks based on the detection results. The image information categories corresponding to the multiple blocks are determined. The image information categories are matched with the encryption levels to determine the encryption levels corresponding to the multiple blocks. Based on the encryption levels, an encryption area is determined in the multiple blocks, and encryption parameters corresponding to the encryption area are determined; wherein the encryption parameters include at least one of the encryption area, the encryption position, and the encryption algorithm.
[0042] Specifically, the parallel computing power of the GPU is used to divide the input image into multiple blocks. The encrypted area is dynamically generated according to the encryption parameters and image content. The position and size of the encrypted area can be determined based on image features, such as edges, textures, etc. and the encryption level set by the user. Specifically, by training a deep neural network (such as a convolutional neural network CNN), the network can automatically learn key information areas in the image, such as faces, text, important signs, etc., and non-key information areas, such as backgrounds, textures, etc. During the encryption process, the network will dynamically determine the size, shape and position of the encrypted area based on the encryption level set by the user and the analysis results of the image content. Compared with fixed area encryption, this method of dynamically generating encrypted areas can better meet diverse encryption needs while ensuring the flexibility and pertinence of encryption.
[0043] Further, the image to be encrypted is input into a preset neural network model, which is trained to identify key information areas in the image. Based on the detection results of the key information areas, the image is divided into multiple blocks. These blocks can be fixed rectangular areas or areas dynamically divided according to the shape of the key information. For each block, the image information category contained in it is determined, and these categories are matched with the preset encryption level according to the image information category of each block. The encryption level can be low, medium, high, or a more fine-grained classification. For example, a block containing a face is assigned a higher encryption level because face information is generally more sensitive than landscape information. Further, based on the encryption level, it is determined in multiple blocks which areas need to be encrypted. Then, specific encryption parameters are determined for each encrypted area, and these parameters include at least the encryption area, the encryption position, and the encryption algorithm.
[0044] S103, coupling different types of chaotic maps to generate a high-dimensional chaotic sequence.
[0045] In one embodiment of the present application, based on preset initial values, a Logistic mapping iterative function and a Tent mapping iterative function are constructed. Based on the Logistic mapping iterative function, the Tent mapping iterative function and a dynamic adjustment factor, a hybrid iterative function is constructed. Based on the hybrid iterative function, a high-dimensional chaotic sequence is generated.
[0046] Specifically, the embodiment of the present application adopts an encryption algorithm based on multidimensional chaotic mapping. Compared with the traditional single chaotic mapping, the multidimensional chaotic mapping system of the embodiment of the present application is formed by coupling multiple different types of chaotic mappings (such as Logistic mapping, Tent mapping) to generate high-dimensional chaotic sequences through complex nonlinear relationships. These chaotic sequences not only have extremely high complexity and randomness, but also have strong correlations with each other, which greatly increases the difficulty of cracking. In the encryption process, these chaotic sequences are used as encryption keys or encryption parameters to encrypt image data in the encryption area.
[0047] The improved chaotic encryption scheme based on the hybrid of Logistic mapping and Tent mapping is as follows:
[0048] Set the initial value x0, which is the starting point of the chaotic sequence and should be kept confidential;
[0049] Two control parameters r1 and r2 are set for Logistic mapping and Tent mapping respectively. In Logistic mapping, r1 usually takes a value close to 4 (such as 3.99) to ensure chaotic behavior; in Tent mapping, r2 usually takes a value of 2;
[0050] A dynamic adjustment factor α is introduced to dynamically adjust the control parameters or mixing ratio during the iteration process to increase the unpredictability of the system.
[0051] In one embodiment of the present application, the Logistic mapping iterative function is:
[0052] x n+1 = r1·x n ·(1-x n );
[0053] The Tent mapping iteration function is:
[0054]
[0055] Introduce a mixed function f(x n ,y n , α) This function is based on x n ,y n and the dynamic adjustment factor α to calculate a new value z for the encryption process. The mixing function can be nonlinear to increase the complexity of the system.
[0056] The mixed iterative function is:
[0057] z n =αx n +(1-α)·y n +γ·x n ·yn ;
[0058] Based on the hybrid iterative function, the image data in the encryption area is encrypted;
[0059] Among them, r1 is the first control parameter; r2 is the second control parameter; α is the dynamic adjustment factor; x n+1 is the iterative function of the Logistic mapping; y n+1 is the Tent mapping iterative function; γ is the nonlinear coefficient, z n is a mixed iterative function, and n is the number of iterations.
[0060] In one embodiment of the present application, the dynamic adjustment factor is:
[0061]
[0062] Among them, α is the dynamic adjustment factor; θ is the parameter that controls the frequency of α change; and n is the number of iterations.
[0063] Use the generated z n The sequence is used as a part of the key stream or encryption process to encrypt the plaintext. The specific encryption method can be XOR operation, substitution encryption, etc.
[0064] The encrypted data will depend on the initial values x0, y0, control parameters r1, r2, dynamic adjustment factor α (and its parameter θ), nonlinear coefficient γ and number of iterations, which together constitute the key space of the encryption system.
[0065] S104, encrypting the image data in the encryption area based on the GPU parallel processing architecture and high-dimensional chaotic sequence.
[0066] In one embodiment of the present application, in terms of acceleration of the encryption process, the embodiment of the present application makes full use of the parallel computing capabilities of the GPU, and performs customized optimization in combination with the architectural characteristics of the GPU. Compared with traditional CPU encryption, GPU encryption can realize parallelization of data processing, thereby greatly improving encryption efficiency. However, different GPU architectures and hardware characteristics have different effects on parallelization performance. Therefore, the embodiment of the present application proposes a unique customized optimization strategy, which customizes and optimizes the parallelization implementation of the encryption algorithm according to the specific model and performance parameters of the GPU.
[0067] The customized optimization strategies in the embodiments of the present application include but are not limited to: optimizing the memory access mode of the GPU to reduce cache conflicts and data transmission delays; adjusting the task scheduling strategy to balance the computing load and memory bandwidth utilization of the GPU; using the specific instruction set and acceleration library of the GPU (such as CUDA, OpenCL, etc.) to optimize the execution efficiency of the algorithm, etc. Through these customized optimization measures, the embodiments of the present application can maximize the parallel computing capabilities of the GPU and achieve efficient acceleration of the encryption process.
[0068] In one embodiment of the present application, each encrypted area is assigned a corresponding GPU thread. Through multiple GPU threads, the value of the high-dimensional chaotic sequence is mapped to the same range as the image pixel value, and based on the preset encryption rule, the image pixel value is replaced with the value of the high-dimensional chaotic sequence to achieve pixel replacement; wherein the preset encryption rule includes at least one of an XOR operation and an addition operation. A permutation matrix is generated based on the high-dimensional chaotic sequence, and the pixel position of the image pixel is permuted according to the permutation matrix. Based on the pixel replacement and the pixel position permutation, the encryption process is completed.
[0069] Specifically, in order to improve encryption efficiency, the embodiment of the present application divides the image into multiple encryption areas, and allocates a GPU thread to each encryption area. The parallel computing capability of the GPU allows multiple threads to be processed simultaneously, thereby significantly accelerating the encryption speed. The high-dimensional chaotic sequence is a sequence with complexity and unpredictability, which is suitable for image encryption. In the embodiment of the present application, a high-dimensional chaotic sequence is generated, and its value is mapped to the same range as the image pixel value (for example, 0-255 for 8-bit images). Based on the preset encryption rules, the pixel values in the image are replaced with the corresponding values of the high-dimensional chaotic sequence. Wherein, the preset encryption rules can include XOR operations, addition operations or other mathematical operations, which can change the pixel values without losing too much information details of the original image.
[0070] Among them, the exclusive OR operation (XOR) is to perform an exclusive OR operation on the image pixel value and the value of the high-dimensional chaotic sequence to generate a new pixel value. The addition operation is to add the image pixel value and the value of the high-dimensional chaotic sequence, and then take the modulus of the result (for example, 256 for an 8-bit image) to ensure that the new pixel value is within the valid range.
[0071] Furthermore, a permutation matrix is generated based on the high-dimensional chaotic sequence. A permutation matrix is a matrix used to specify the way in which the positions of image pixels are exchanged. The permutation matrix is used to permute the positions of image pixels, that is, the pixels in the image are moved to new positions according to the instructions of the permutation matrix. The two techniques of pixel replacement and pixel position permutation are combined to complete the encryption processing of the image. The encrypted image will have a completely different appearance from the original image, and it is difficult to visually identify the original information.
[0072] S105, performing frequency domain transformation and equalization processing on the non-encrypted area, and recombining the processed non-encrypted area with the encrypted area to obtain an encrypted image.
[0073] In one embodiment of the present application, the image corresponding to the non-encrypted area is converted from the spatial domain to the frequency domain by a two-dimensional discrete Fourier transform. In the frequency domain, the parameters of the equalization function are dynamically adjusted according to the spectral distribution characteristics of the image to dynamically equalize the spectrum of the image corresponding to the non-encrypted area. The image block after equalization is converted from the frequency domain to the spatial domain by a two-dimensional discrete Fourier inverse transform. The non-encrypted area after the inverse transform is recombined with the encrypted area to obtain an encrypted image.
[0074] Specifically, the image corresponding to the non-encrypted area is converted from the spatial domain to the frequency domain using a two-dimensional discrete Fourier transform to obtain the image's spectrum diagram, which displays the image's frequency distribution characteristics. In the frequency domain, the image's frequency distribution characteristics can be displayed through a spectrum diagram, and the bright spots on the spectrum diagram represent the gradient size at that location, that is, the degree of change in the pixel value. According to the image's spectral distribution characteristics, the parameters of the equalization function are dynamically adjusted, and by applying the equalization function, the image's spectrum is dynamically equalized to improve the image's contrast.
[0075] Furthermore, the equalized image blocks are converted from the frequency domain back to the spatial domain using a two-dimensional discrete Fourier inverse transform to obtain a processed non-encrypted area image with improved contrast. The inverse transformed non-encrypted area is recombined with the encrypted area to obtain an encrypted image, and the inverse transformed non-encrypted area is recombined with the encrypted area to obtain an encrypted image.
[0076] In one embodiment of the present application, the upload time and encryption area of the image to be encrypted are determined, and after a preset interval, the number of propagation times corresponding to the encrypted image is obtained. The number of propagation times is compared with the encryption level threshold table to determine the encryption upgrade level corresponding to the encrypted image based on the comparison result. Based on the preset encryption level mapping relationship, the encryption extension area corresponding to the upgraded encryption level is determined to perform secondary encryption on the encrypted image based on the encryption extension area.
[0077] Specifically, after the image is encrypted and published, after a preset interval, the number of times the encrypted image is spread is monitored and recorded. The number of times the image is spread can be counted by the number of clicks on the image sharing link, the number of reposts on social media, the number of web page visits, etc. The embodiment of the present application is provided with an encryption level threshold table, which defines the encryption level thresholds corresponding to different ranges of the number of spreads. The actual number of spreads is compared with the encryption level threshold table to determine whether the encryption level of the current encrypted image is high enough and whether the encryption level needs to be increased. Based on the comparison result, if the number of spreads exceeds the threshold corresponding to the current encryption level, it is determined that the encryption level needs to be increased. The number of levels to be increased can be dynamically adjusted according to the degree of excess of the number of spreads. For example, the more the threshold is exceeded, the higher the level will be.
[0078] Furthermore, the embodiment of the present application also presets an encryption level mapping relationship, which defines the size or range of the encryption area corresponding to different encryption levels. According to the encryption level after the upgrade, the corresponding encryption extension area is determined from the mapping relationship. The encryption extension area can be an extension of the current encryption area, or it can be a designation of a new unencrypted part in the image. After the encryption extension area is determined, the image pixels in the area are subjected to secondary encryption processing, and the secondary encryption can use an algorithm or parameter different from the initial encryption to increase the difficulty of cracking.
[0079] Figure 2 A schematic diagram of a GPU data encryption system provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the GPU data encryption system includes an input module, a GPU processing module, an encryption parameter determination module, a storage module, and an output module. Among them:
[0080] Input module: used to receive the image to be encrypted and the encryption level setting input by the user.
[0081] GPU processing module: contains multiple parallel processing units, which are used to perform core processing tasks such as image segmentation, chaotic encryption, frequency domain transformation, equalization processing and inverse transformation.
[0082] Encryption parameter determination module: automatically generates corresponding encryption parameters according to the encryption level set by the user, including the location and size of the encryption area and the selection of encryption algorithm.
[0083] Storage module: used to store encrypted images, decrypted layer data, chaos parameters and other information.
[0084] Output module: outputs the encrypted image and decrypted layer data to users or other application systems.
[0085] Figure 3 A schematic diagram of the structure of a GPU data encryption device provided in an embodiment of the present application is shown in FIG. Figure 3As shown, the GPU data encryption device 200 includes: at least one processor 201; and a memory 202 that is communicatively connected to the at least one processor 201; wherein the memory 202 stores instructions that can be executed by the at least one processor 201, and the instructions are executed by the at least one processor 201 so that the at least one processor 201 can: obtain the image to be encrypted input by the user and the encryption level corresponding to the image to be encrypted; perform key information area detection on the image to be encrypted through a preset neural network model, so as to determine the encrypted area and the non-encrypted area in the image to be encrypted based on the detection result and the encryption level; couple different types of chaotic mappings to each other to generate a high-dimensional chaotic sequence; encrypt the image data in the encrypted area based on the GPU parallel processing architecture and the high-dimensional chaotic sequence; perform frequency domain change and equalization processing on the non-encrypted area, and recombine the processed non-encrypted area with the encrypted area to obtain an encrypted image.
[0086] A non-volatile computer storage medium provided in an embodiment of the present application stores computer executable instructions, wherein the computer executable instructions are configured to: obtain an image to be encrypted input by a user and an encryption level corresponding to the image to be encrypted; perform key information area detection on the image to be encrypted by using a preset neural network model, so as to determine an encrypted area and a non-encrypted area in the image to be encrypted based on the detection result and the encryption level; couple different types of chaotic mappings to generate a high-dimensional chaotic sequence; encrypt image data in the encrypted area based on a GPU parallel processing architecture and the high-dimensional chaotic sequence; perform frequency domain transformation and equalization processing on the non-encrypted area, and recombine the processed non-encrypted area with the encrypted area to obtain an encrypted image.
[0087] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0088] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the embodiments of the present application may have various changes and variations. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application.
Claims
1. A GPU data encryption method, characterized in that: The method comprises: Obtaining an image to be encrypted input by a user and an encryption level corresponding to the image to be encrypted; By using a preset neural network model, key information area detection is performed on the image to be encrypted, so as to determine an encrypted area and a non-encrypted area in the image to be encrypted based on the detection result and the encryption level; Different types of chaotic maps are coupled to each other to generate high-dimensional chaotic sequences; Based on the GPU parallel processing architecture and the high-dimensional chaotic sequence, encrypting the image data in the encryption area; The non-encrypted area is subjected to frequency domain transformation and equalization processing, and the processed non-encrypted area is recombined with the encrypted area to obtain an encrypted image.
2. A GPU data encryption method according to claim 1, characterized in that: The method of detecting the key information area of the image to be encrypted by using a preset neural network model, so as to determine the encryption area in the image to be encrypted based on the detection result and the encryption level, specifically includes: Inputting the image to be encrypted into the preset neural network model, performing key information area detection on the image to be encrypted by the preset neural network model, and dividing the image to be encrypted into a plurality of blocks based on the detection result; Determining the image information categories corresponding to the plurality of blocks respectively; Matching the image information category with the encryption level to determine the encryption levels corresponding to the plurality of blocks respectively; Based on the encryption level, the encryption area is determined in the plurality of blocks, and encryption parameters corresponding to the encryption area are determined; wherein the encryption parameters include at least one of an encryption area, an encryption position, and an encryption algorithm.
3. The GPU data encryption method according to claim 1, characterized in that: The method of coupling different types of chaotic maps to generate a high-dimensional chaotic sequence specifically includes: Based on the preset initial values, construct the Logistic mapping iterative function and the Tent mapping iterative function; Constructing a hybrid iterative function based on the Logistic mapping iterative function, the Tent mapping iterative function and a dynamic adjustment factor; Based on the hybrid iterative function, the high-dimensional chaotic sequence is generated.
4. The GPU data encryption method according to claim 3, characterized in that: The constructing of a hybrid iterative function based on the Logistic mapping iterative function, the Tent mapping iterative function and the dynamic adjustment factor specifically includes: The Logistic mapping iterative function is: x n+1 =r1·x n ·(1-x n ); The Tent mapping iteration function is: The hybrid iterative function is: z n =αx n +(1-α)·y n +γ·x n ·y n ; Based on the hybrid iterative function, encrypting the image data in the encryption area; Among them, r1 is the first control parameter; r2 is the second control parameter; α is the dynamic adjustment factor; x n+1 is the iterative function of the Logistic mapping; y n+1 is the Tent mapping iterative function; γ is the nonlinear coefficient, z n is a mixed iterative function, and n is the number of iterations.
5. A GPU data encryption method according to claim 4, characterized in that: The dynamic adjustment factor is: Among them, α is the dynamic adjustment factor; θ is the parameter that controls the frequency of α change; and n is the number of iterations.
6. The GPU data encryption method according to claim 1, characterized in that: The performing frequency domain transformation and equalization processing on the non-encrypted area, and recombining the processed non-encrypted area with the encrypted area to obtain an encrypted image specifically includes: Converting the image corresponding to the non-encrypted area from the spatial domain to the frequency domain by two-dimensional discrete Fourier transform; In the frequency domain, dynamically adjusting the parameters of the equalization function according to the spectrum distribution characteristics of the image, so as to perform dynamic equalization processing on the spectrum of the image corresponding to the non-encrypted area; The equalized image blocks are converted from the frequency domain to the spatial domain through a two-dimensional inverse discrete Fourier transform; The inversely transformed non-encrypted area is recombined with the encrypted area to obtain the encrypted image.
7. The GPU data encryption method according to claim 1, characterized in that: The encryption processing of the image data in the encryption area based on the GPU parallel processing architecture and the high-dimensional chaotic sequence specifically includes: Allocate corresponding GPU threads to each of the encryption areas; By using a plurality of the GPU threads, the values of the high-dimensional chaotic sequence are mapped to the same range as the image pixel values, and based on a preset encryption rule, the image pixel values are replaced with the values of the high-dimensional chaotic sequence to achieve pixel replacement; wherein the preset encryption rule includes at least one of an exclusive-or operation and an addition operation; generating a permutation matrix based on the high-dimensional chaotic sequence, and performing pixel position permutation on the image pixels according to the permutation matrix; Based on the pixel replacement and the pixel position permutation, the encryption process is completed.
8. The GPU data encryption method according to claim 1, characterized in that: After determining the encrypted area and the non-encrypted area in the image to be encrypted based on the detection result and the encryption level, the method further includes: Determining the upload time and encryption area of the image to be encrypted; After a preset time interval, obtaining the number of propagation times corresponding to the encrypted image; Comparing the number of propagation times with an encryption level threshold table to determine an encryption enhancement level corresponding to the encrypted image based on the comparison result; Based on the preset encryption level mapping relationship, an encryption extension area corresponding to the increased encryption level is determined, so as to perform secondary encryption on the encrypted image based on the encryption extension area.
9. A GPU data encryption device, characterized in that: The device comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute the method according to any one of claims 1 to 8.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions can execute the method according to any one of claims 1 to 8.