Digital picture file encryption method based on three-dimensional positioning encryption
By reconstructing the face region into a 3D cube and combining it with a dual chaotic system and a 3D cat mapping method, the problems of limited key space and insufficient region differentiation in existing technologies are solved, achieving highly secure face region encryption and enhancing the complexity and anti-attack capability of the image.
Patent Information
- Application Number
- CN202511732905.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-17
AI Technical Summary
Existing two-dimensional pixel scrambling and grayscale diffusion methods have limited key space, obvious scrambling periodicity, and insufficient resistance to attacks in image encryption. They are difficult to meet the high security requirements of long-term storage and cross-network transmission of sensitive information in electronic archives. Furthermore, traditional encryption algorithms fail to distinguish between sensitive and non-sensitive areas, resulting in insufficient privacy protection.
A three-dimensional positioning encryption method is adopted to crop the face region into sub-images and merge them into a compact three-dimensional cube structure. A chaotic sequence is generated by combining a dual chaotic system to perform pixel diffusion and scrambling, distinguishing sensitive areas from non-sensitive areas for regional encryption. The complexity and anti-attack capability are enhanced by three-dimensional cat mapping and spiral path diffusion.
It achieves efficient and regional encryption of the face region, significantly enhancing the complexity and anti-attack capability of the ciphertext, ensuring the randomness of pixel distribution and decryption symmetry, and effectively resisting statistical analysis attacks.
Smart Images

Figure CN121547540A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing and data encryption technology, specifically to an encryption method for digital image files based on three-dimensional positioning encryption. Background Technology
[0002] With the rapid development of facial recognition systems, they have been widely applied in fields such as surveillance, social media, and biometric authentication. Facial areas in digital images have become highly sensitive carriers of personal information. However, due to the frequent transmission and storage of images on open networks, the risks of unauthorized access, tampering, or privacy leaks are rapidly increasing. With the continuous development of the information society, traditional paper archives are gradually shifting towards electronic and digital formats. Electronic archives have advantages such as large storage capacity, easy retrieval, fast transmission speed, and strong sharing capabilities, making them an important trend in archive management for government agencies, enterprises, and industries such as healthcare and education. However, electronic archives are highly vulnerable to illegal copying, theft, and tampering during storage and transmission. Currently, common image encryption methods are mostly based on two-dimensional pixel scrambling and grayscale diffusion. While these methods improve image security to some extent, they still have drawbacks such as limited key space, obvious scrambling periodicity, and insufficient resistance to attacks, making it difficult to meet the high security requirements for long-term storage and cross-network transmission of sensitive information in electronic archives. Traditional image encryption algorithms typically perform scrambling and diffusion globally without distinguishing between sensitive and non-sensitive areas. Therefore, their effectiveness is limited in scenarios requiring regional protection, such as facial privacy protection. To address this issue, this paper proposes an innovative face region-oriented image encryption method. This method ensures the structure and reversibility of the encrypted content while providing dual protection specifically for the face region. Summary of the Invention
[0003] To address the aforementioned issues, a digital image archive encryption method based on 3D positioning encryption is proposed. First, the facial regions in the archive are detected and extracted using coordinate information, cropped into sub-images, and merged into a compact 3D cube structure. Subsequently, to construct the complete cube, its total pixel count is adjusted by filling non-facial regions of the original image with pixels, thus laying the foundation for subsequent spatial encryption.
[0004] The encryption system is driven by a key-initialized dual-chaotic system. The proposed two-dimensional chaotic map is constructed based on sinusoidal function coupled with nonlinear interactions, aiming to generate a wider range of chaos and richer dynamic behavior. The system generates a chaotic sequence after discarding transient iterations to ensure high randomness and unpredictability. During encryption, pixels within the cube diffuse along a spiral path, progressing layer by layer inward from a vertex of the cube, thus achieving deep spatial confusion and strong pixel dependency. To further improve scrambling complexity, the cube is divided into eight equal-sized sub-cubes by bitwise partitioning. These sub-cubes are then combined into a larger cube of doubled size, and spatial scrambling is performed on the overall structure using a 3D cat map, drawing on existing 3D chaotic perturbation methods. After scrambling, a reverse diffusion process is performed along the spiral path to ensure decryption symmetry. Finally, the encrypted pixels are extracted and reconstructed to the same image size as the original face region. Non-face regions are encrypted separately using one-dimensional chaotic diffusion to ensure overall security coverage. Finally, the encrypted face image is embedded back into the original image structure, and global pixel scrambling is performed under the guidance of the chaotic sequence.
[0005] A digital image archive encryption method based on three-dimensional positioning encryption, characterized by the following steps: S1: Use an object detection model to identify objects of size... M × N The face regions in the original archive image are extracted, their position coordinates in the original archive image are extracted, and the corresponding face regions in the original image are cropped to obtain all the multiple independent face images in the original archive image. S2: Merge the face images to form a cube structure; S3: Generate SHA-256 hash values for the image, which are used to generate initial values and initial parameters for initializing the chaotic system. Use the initial values and initial parameter values to iterate the chaotic system and generate a chaotic sequence. S4: Use chaotic sequences to encrypt the face region, spread the merged cube, scramble it and then spread it in the reverse direction; S5: Flatten the non-face regions in the original archive image to one dimension and perform a diffusion operation; S6: Reconstruct the three-dimensional face region cube and the one-dimensional non-face region into two-dimensional images of the original size, respectively; S7: Place the encrypted face image back into the non-face image, perform a global scrambling operation, and obtain the final ciphertext image; S8: Decrypt the image by reversing the image encryption process to obtain the decrypted image.
[0006] The beneficial effects of the above technical solution are as follows: (1) This method can distinguish between sensitive and non-sensitive areas, realize regional encryption, and avoid the problems of low efficiency or insufficient privacy protection in traditional global encryption. (2) By reconstructing the face region into a three-dimensional data cube and combining block and recombination operations, the scrambling and diffusion process is carried out in a higher dimension, thereby significantly enhancing the complexity and anti-attack capability of the ciphertext. (3) The spiral diffusion method of cubic pixels introduces strong pixel dependence, ensuring that the encrypted image is close to an ideal random distribution in terms of statistical characteristics, thus resisting statistical analysis attacks. Attached Figure Description
[0007] Figure 1 This is a flowchart illustrating the encryption process of the present invention. Figure 2 This is a schematic diagram of the diffusion algorithm of the present invention; Figure 3 This is a schematic diagram of the scrambling algorithm of the present invention; Figure 4 (a), (b), and (c) are illustrations demonstrating the encryption effect of this invention; Figure 5 (a), (b), and (c) are histograms of the encryption effect demonstration diagram of the present invention. Detailed Implementation
[0008] The foregoing and other technical contents, features and effects of the present invention will be clearly presented in the following detailed description of the embodiments with reference to the accompanying drawings. The structural contents mentioned in the following embodiments are all based on the accompanying drawings.
[0009] In an embodiment of the present invention, a 3D Cat Map is introduced to achieve global spatial scrambling of cubic pixel data. This mapping is an extension of the 2D Arnold Cat Map in 3D space. Essentially, it redistributes the point coordinates in 3D space through a linear invertible transformation, thereby achieving the effect of global pixel scrambling.
[0010] like Figures 1 to 3 As shown, the specific steps are as follows: I. Proposing and constructing a two-dimensional sinusoidal coupled chaotic system The proposed two-dimensional sinusoidal coupled chaotic system is shown in equation (1), where a , b , c , d This represents the parameter, where i represents the current iteration number.
[0011]
[0012] II. Key Generation Step 1: Process the original imageP Applying the SHA-256 function yields a 256-bit hash value; Step 2: Divide the 256-bit hash value into four 64-bit segments, and convert each segment into a normalized decimal number. d k ,in k =1, 2, 3, 4; Step 3: Use normalized decimal numbers d k The initial value of the chaotic system is calculated using formula (2). x 0、 y 0 and initial parameters a , b , c , d .
[0013]
[0014] III. Image Encryption
[0015] Let the size of the plaintext image be... M × N .
[0016] Step 1: Use YOLOv11 to identify the location of the face region in the original image.
[0017] Step 2: Merge the face images, calculate the total number of pixels (totalPixels) for all face images, and then calculate the minimum cube side length required to reshape all pixels into a cube structure. n 1. The number of pixels to be added (padding) is taken from the non-face region, and these padding pixels are merged with the face image and reshaped into a shape with a side length of 1. n The cubic structure C is 1. The specific method is to fill all pixel data in a column-first manner, first arranging them from top to bottom and then from left to right in each layer to form a two-dimensional plane, and then stacking them layer by layer from front to back in order, finally reshaping them into a three-dimensional cube.
[0018] Step 3: Iterate through a two-dimensional sinusoidal coupled chaotic system 1000+3× M × N After discarding the first 1000 iterations, we obtained a length of 3× M × N The two sequences chaosx and chaosy; Step 4: Process chaosx and chaosy according to formula (3) to obtain four chaotic sequences chaosq1, chaosq2, chaosq3, and chaosq4. Arrange chaosq1 and chaosq2 from top to bottom and then from left to right in each layer to form a two-dimensional plane. Then stack them layer by layer from front to back according to the layer order, and finally reshape them into two three-dimensional cubes.
[0019]
[0020] Step 5: Select a vertex of the cube structure C, XOR it with the first value of chaosq1 and then XOR it with the last value of chaosq2. Then, use chaosq1 and the voxel value of the previous position to traverse and modify the voxel values on the three edges of the cube structure C connected to this vertex in a spiral manner. Step 6: Traverse the three visible surfaces of the cube structure C in a spiral manner.
[0021] Step 7: Repeat steps 5 and 6, traversing the internal sub-cubes of the cube until all voxels of the entire cube structure C have been modified. The entire diffusion algorithm is shown in the pseudocode algorithm in Table 1.
[0022]
[0023] Step 8: Decompose each voxel in the cube structure C after the diffusion operation into 8 bits; Step 9: Reassemble all bits into a single bit of size 2. n 1×2 n 1×2 n A 1-bit cube (where n 1 represents the side length of the original cubic structure C). Step 10: According to the pseudocode algorithm in Table 2, obtain a 3×3 matrix with an absolute value of 1 modulo 1 using chaosx and chaosy. M Using the matrix according to formula (4) M The bit cube is permuted using a 3D cat map.
[0024]
[0025] Step 11: Select the vertices of the scrambled cube ( n 1, n 1, n 1) Repeat steps 5, 6, and 7, using chaoseq2 for back diffusion.
[0026] Step 12: According to formula (5), use chaoseq3 to perform element-wise XOR operation on the flattened one-dimensional non-face region vector.
[0027]
[0028] Step 13: Re-merge the face region and non-face region, and generate a sorting index using chaoseq4 according to formula (6), and rearrange the positions of the merged image data according to the index.
[0029]
[0030] Step 14: Obtain the final encrypted image.
[0031] like Figure 4 As shown, this invention selects one electronic image of an archive. Using the encryption algorithm of this invention, an encrypted image can be obtained. It is clear that no useful information can be obtained at all, which can effectively protect the image information.
[0032] Histograms can characterize the distribution of pixel values. Figure 4 (a) is a plain text file image. Figure 5 (a) is a histogram of plain text file images. Figure 4 (b) is an image showing the effect of encrypting only the facial area in the file. Figure 5 (b) is an image histogram of only the face region in the encrypted file. Figure 4 (c) is a screenshot of the effect of global encryption. Figure 5 (c) is a histogram of the globally encrypted encrypted file image, where the horizontal axis of the histogram represents the pixel value, which is fixed between 0 and 255, and the vertical axis represents the number of that pixel value. Clearly, the distribution of plaintext pixel values is extremely irregular. If an attacker understands this pattern, they could easily brute-force the plaintext image. However, after processing by the encryption algorithm of this invention, the distribution of each pixel value is obviously more uniform, indicating that the encrypted image effectively covers the pixel distribution pattern of the plaintext image.
[0033] IV. Image Decryption
[0034] Step 1: Use the key to generate initial values and control parameters, and use them to iterate through the chaotic system to generate chaosq1, chaosq2, chaosq3, and chaosq4.
[0035] Step 2: Use chaoseq4 to remove the global scrambling of the image in reverse process of formula (6).
[0036] Step 3: Use position coordinates to separate the encrypted image of the face region and merge and reshape it into a cube structure.
[0037] Step 4: Use chaoseq2 to remove the back diffusion of the cube according to the reverse back diffusion algorithm.
[0038] Step 5: Divide the cube into 8 smaller cubes and merge them into a larger cube with a side length of 2. Use the modulo inverse of the scrambling matrix to remove the scrambling of the cube using formula (4), and then merge the cubes again.
[0039] Step 6: Use chaoseq1 to remove the diffusion of the cube using the inverse diffusion algorithm, and then restore the cube to the original face image.
[0040] Step 7: Restore the original data of the non-face region using chaoseq3 following the reverse process of formula (5).
[0041] Step 8: Re-embed the face region into the non-face region to obtain the original image.
[0042] The above description is only for illustrating the present invention and should be understood as not being limited to the above embodiments. Various modifications that conform to the spirit of the present invention are within the protection scope of the present invention.
Claims
1. A digital picture archive encryption method based on three-dimensional positioning encryption, characterized in that, Includes the following steps: S1: Use an object detection model to identify objects of size... M × N The face regions in the original archive image are extracted, their position coordinates in the original archive image are extracted, and the corresponding face regions in the original image are cropped to obtain all the multiple independent face images in the original archive image. S2: Merge the face images to form a cube structure; S3: Generate SHA-256 hash values for the image, which are used to generate initial values and initial parameters for initializing the chaotic system. Use the initial values and initial parameters to iterate the chaotic system and generate a chaotic sequence. S4: Use chaotic sequences to encrypt the face region, spread the merged cube, scramble it and then spread it in the reverse direction; S5: Flatten the non-face regions in the original archive image to one dimension and perform a diffusion operation; S6: Reconstruct the three-dimensional face region cube and the one-dimensional non-face region into two-dimensional images of the original size, respectively; S7: Place the encrypted face image back into the non-face image, perform a global scrambling operation, and obtain the final ciphertext image; S8: Decrypt the image by reversing the image encryption process to obtain the decrypted image.
2. The digital image archive encryption method based on three-dimensional positioning encryption according to claim 1, characterized in that, The process of merging the face images in step S2 includes: Calculate the total number of pixels (totalPixels) for all face images, and then calculate the minimum cube side length required to reshape all pixels into a cube structure. n 1. The number of pixels to be added (padding) is taken from the non-face region, and these padding pixels are merged with the face image and reshaped into a shape with a side length of 1. n 1. A cubic structure C.
3. The digital image archive encryption method based on three-dimensional positioning encryption according to claim 1, characterized in that, In step S3, the chaotic system is a two-dimensional sinusoidal coupled-mapped system (2D-SCMM), and its equations are as follows: in, a , b c d Indicates parameters, i Indicates the current iteration number.
4. The digital image archive encryption method based on three-dimensional positioning encryption according to claim 3, characterized in that, The process of generating the initial values and initial parameters in step S3 is as follows: S3-1: Apply the SHA-256 function to the original archive image to obtain a 256-bit hash value; S3-2: Divide the 256-bit hash value into four 64-bit segments, and convert each segment into a normalized decimal number. d k ,in k =1, 2, 3, 4; using normalized decimal numbers d k The initial value of the chaotic system is calculated using formula (2). x 0、 y 0 and initial parameters a , b c d :
5. The digital image archive encryption method based on three-dimensional positioning encryption according to claim 4, characterized in that, The iteration of the chaotic system and the generation of the chaotic sequence in step S3 include: Use the obtained initial parameters of the chaotic system a , b c d and initial value x 0、 y 0-iteration chaotic system 1000+3× M × N Next, the first 1000 iterations are removed to eliminate transient effects, resulting in two sequences, chaosx and chaosy. Chaosx and chaosy are then processed according to formula (3) to obtain four chaotic sequences:
6. The method for encrypting digital image archives based on three-dimensional positioning encryption according to claim 5, characterized in that, The diffusion operation in step S4 includes: The visible surfaces of the cube structure C are traversed in a clockwise spiral manner, and finally the internal sub-cubes of the cube structure C are traversed in the same manner. Specifically, this is achieved by XORing the current voxel value with the corresponding value in the three-dimensional cube as reshaped by the chaotic sequence and the previously processed voxel value in the spatial continuous path, and using the last value of chaosq2 as the previous value of the first vertex. The specific steps include: S4-1: Select a vertex of the cube structure C, XOR it with the first value of chaosq1 and then XOR it with the last value of chaosq2. Then use the chaotic sequence chaosq1 and the voxel value of the previous position to traverse and modify the voxel values on the three edges of the cube structure C connected to this vertex in a spiral manner. S4-2: Traverse and modify the voxel values on the three visible surfaces of the cube structure C in a spiral manner; S4-3: Repeat steps S4-1 and S4-2 to traverse the internal sub-cubes of the cube structure C until the voxel values of the entire cube structure C have been modified.
7. The method for encrypting digital image archives based on three-dimensional positioning encryption according to claim 5, characterized in that, The scrambling operation in step S4 specifically includes: S4-4: Decompose each voxel value in the cube structure C after the diffusion operation into 8 bits; S4-5: Reassemble all bits into a 2x2 array. n 1×2 n 1×2 n A 1-bit cube, in which n 1 represents the side length of the original cubic structure C; S4-6: Obtain a 3×3 matrix with an absolute value of 1 modulo 1 using chaosx and chaosy. M Using the matrix according to formula (4) M The bit cube is permuted using a 3D cat map:
8. The digital image archive encryption method based on three-dimensional positioning encryption according to claim 5, wherein the diffusion operation in step S5 includes: The flattened one-dimensional non-face region vector is XORed element-wise using chaosq3 according to formula (5): Where, flat( j ) represents a one-dimensional vector of a non-face region. j Indicates the array index of the current operation.
9. A digital image archive encryption method based on three-dimensional positioning encryption according to claim 5, characterized in that, The global scrambling operation in step S7 includes generating a sorting index using chaoseq4 and rearranging the positions of the merged image data according to the index.
10. A digital image archive encryption method based on three-dimensional positioning encryption according to claim 9, characterized in that, The decryption method in step S8 is the reverse of the encryption process, and the detailed steps are as follows: S8-1: Use a 256-bit hash value to generate initial values and initial parameters, and use them to iterate the chaotic system. S8-2: Use chaosq4 to remove the global scrambling of the image according to the reverse process of the global scrambling operation in step S7. S8-3: Use position coordinates to separate the encrypted image of the face region and merge and reshape it into a cube structure; forming 4 chaotic sequences: chaosq1, chaosq2, chaosq3, chaosq4. S8-2: Use chaosq4 to remove the global scrambling of the image by reversing the global scrambling operation in step S7; S8-3: Use positional coordinates to separate the encrypted image of the face region and merge and reshape it into a cube structure; S8-4: Use chaosq2 to remove the back diffusion of the cube according to the reverse back diffusion algorithm; S8-5: Divide the cube into 8 smaller cubes and merge them into a larger cube with a side length of 2. Use the modulo inverse of the scrambling matrix to remove the scrambling of the cube using formula (4), and then merge the cubes again. S8-6: Use Chaoseq1 to remove the diffusion of the cube using the inverse diffusion algorithm, and then restore the cube to the original face image; S8-7: Recover the original data of the non-face region using chaosq3 in the reverse process of formula (5); S8-8: Re-embed the face region into the non-face region to obtain the original archive image.