Multi-image encryption method and system based on decentralized three-dimensional magic cube permutation and face chain diffusion

By employing a decentralized 3D Rubik's Cube scrambling and surface chain diffusion multi-image encryption method, the problems of high computational redundancy and insufficient security in existing technologies are solved, achieving efficient and secure multi-image encryption that is suitable for unified processing of grayscale and color images.

CN122496592APending Publication Date: 2026-07-31CHONGQING THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING THREE GORGES UNIV
Filing Date
2026-04-22
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing multi-image encryption algorithms suffer from high computational redundancy, low efficiency, and fail to fully utilize the correlation between images, making it difficult to meet real-time requirements and lacking in security.

Method used

A multi-image encryption method employing decentralized 3D Rubik's Cube scrambling and surface chain diffusion is proposed. By constructing a 3D data cube, a chaotic sequence is generated using a hash function and a four-dimensional memristor hyperchaotic system. Multiple rounds of 3D Rubik's Cube scrambling and bidirectional surface chain diffusion are then performed. Combining grayscale and color image pixel information, decentralized scrambling and efficient diffusion are achieved.

Benefits of technology

It improves scrambling efficiency, reduces the length of chaotic sequences and the number of scrambling operations, lowers computational overhead, enhances security and resistance to attacks, and is suitable for secure transmission of batch images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122496592A_ABST
    Figure CN122496592A_ABST
Patent Text Reader

Abstract

This invention relates to the field of image encryption technology, specifically disclosing a multi-image encryption method and system based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion. The method includes: fusing grayscale and color image pixels to be encrypted to construct a 3D data cube; generating a chaotic sequence using a hash function and a four-dimensional memristor hyperchaotic system and performing integerization to obtain a pseudo-random integer sequence required for encryption; dynamically controlling the cutting plane and rotation angle according to the obtained pseudo-random integer sequence to divide the 3D data cube into two parts for rotation, and combining this with an explosion operation to achieve decentralized 3D Rubik's Cube scrambling. The chaotic cube is then used to perform forward and reverse surface chain diffusion on the scrambled 3D data cube in the X, Y, and Z dimensions; finally, a ciphertext cube is obtained. The algorithm proposed in this invention has good scrambling and diffusion performance, ensuring encryption security while maintaining operational efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image encryption technology, specifically to a multi-image encryption method and system based on decentralized three-dimensional cube scrambling and surface chain diffusion. Background Technology

[0002] Images, as an important carrier of information, have become one of the most common forms of online communication due to their intuitive, vivid, and easy-to-understand characteristics, and are widely used in fields such as medicine, military, satellite, communications, power grids, and intelligent monitoring. However, images often contain a large amount of private data, making them highly vulnerable to security risks such as theft, tampering, and forgery during transmission and storage. Therefore, image encryption has become a key means of ensuring information security to prevent privacy leaks during transmission.

[0003] In current multimedia, cloud storage, and medical imaging scenarios, images are often generated in batches and multiple frames. Traditional single-image encryption algorithms require image-by-image processing, repeatedly performing key generation, scrambling, and diffusion operations, resulting in high computational redundancy, low efficiency, and failure to utilize the correlation between images, making it difficult to meet real-time requirements. Multi-image encryption can process multiple images at once, improving efficiency and resource utilization, fully utilizing the redundancy between images, with low key overhead, low latency, and stronger resistance to attacks, making it more suitable for modern batch image security applications. Chaotic systems, with their advantages of unpredictability, initial value sensitivity, and ergodicity, are widely used in the field of image encryption. However, some existing chaotic image encryption algorithms have shortcomings such as insufficient security and low encryption efficiency. Summary of the Invention

[0004] The purpose of this invention is to provide a multi-image encryption method and system based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A multi-image encryption method based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, the method comprising: By fusing the grayscale and color image pixels to be encrypted and combining them with their size and type identifiers, a three-dimensional data cube is constructed. A chaotic sequence is generated using a hash function and a four-dimensional memristor hyperchaotic system and then integerized to obtain the pseudo-random integer sequence required for encryption. A multi-round decentralized 3D cube scrambling operation is performed on a 3D data cube based on a chaotic pseudo-random integer sequence. Each round of scrambling includes: dividing the cube into two parts according to the chaotic pseudo-random integer sequence along a set coordinate axis, and performing rotation operations at different angles on the two parts respectively; then dividing the cube into 8 geometric sub-blocks according to the chaotic pseudo-random integer sequence, and performing an explosion operation on each sub-block. This operation is geometrically equivalent to performing a centrally symmetric flip on each sub-block to achieve decentralized scrambling of the internal elements of the cube.

[0006] The chaotic sequence is constructed into multiple three-dimensional chaotic cubes. The scrambled three-dimensional data cube and the three-dimensional chaotic cube are divided into N planes in the X, Y, and Z dimensions. The forward and reverse surface chain diffusion operations are performed sequentially on the corresponding planes to complete the bidirectional surface chain diffusion and obtain the final encryption result.

[0007] As a further embodiment of the present invention, the step of fusing the grayscale and color image pixels to be encrypted, and combining their size and type identifiers to construct a three-dimensional data cube further includes: Multiple images to be encrypted are uniformly converted to grayscale to obtain a set of grayscale images; Extract the width, height, and type identifier of each original image, and split the width and height into base 256 to construct the corresponding image attribute sequence. Concatenate the image attribute sequences to obtain the total attribute sequence, and split the length of the total attribute sequence into base 256. All image pixels in the grayscale image set are sequentially expanded into a one-dimensional pixel sequence, and the total attribute sequence and the 256-ary decomposition result of the length of the total attribute sequence are concatenated at the end of the one-dimensional pixel sequence to form a one-dimensional total data stream. The total number of elements in the one-dimensional total data stream is counted. Based on this, the side length of the smallest three-dimensional equilateral cube that can fully contain the one-dimensional total data stream is calculated. Zero-value elements are added to the end of the one-dimensional total data stream so that its total length matches the volume capacity of the three-dimensional equilateral cube to obtain an expanded data stream. The expanded data stream is then mapped and filled into the three-dimensional equilateral cube.

[0008] As a further aspect of the present invention, the width, height, and type identifier of each original image are extracted, and the width and height are split into base-256 values. Given that the upper limit of the value corresponding to a 16-bit binary sequence is 65535, this can fully cover conventional image sizes, including 4K and 8K ultra-high-definition resolutions. While meeting the requirements of industrial-grade image processing, this method maximizes the compression of data space occupied by auxiliary information and effectively reduces system storage redundancy.

[0009] As a further embodiment of the present invention, the image type identifier is used to distinguish whether the original image is a grayscale image or a color image.

[0010] As a further embodiment of the present invention, the step of generating a chaotic sequence using a hash function and a four-dimensional memristor hyperchaotic system and then performing integerization processing to obtain the pseudo-random integer sequence required for encryption specifically includes: The SHA-256 hash function is used to calculate the three-dimensional data cube, generating a 256-bit hash value and dividing it into 32 groups. These groups are then combined with a preset initial seed key to calculate the initial value of the four-dimensional memristor hyperchaotic system. Substituting the initial value into the chaotic system for iteration and discarding the first part of the state value, multiple pseudo-random sequences are obtained; The generated pseudo-random sequences are preprocessed and mapped to a preset numerical range to obtain control sequences for scrambling and diffusion.

[0011] As a further embodiment of the present invention, when performing each round of the decentralized three-dimensional Rubik's Cube scrambling operation, the set coordinate axis directions are sequentially performed in the order of perpendicular to the X-axis, perpendicular to the Y-axis, and perpendicular to the Z-axis.

[0012] As a further embodiment of the present invention, the step of dividing the three-dimensional data cube into 8 geometric sub-blocks based on a chaotic pseudo-random integer sequence and performing an explosion operation on each sub-block specifically includes: Based on the sequence, a dividing plane is determined in each of the three dimensions X, Y, and Z, and the three-dimensional data cube is divided into eight geometric sub-blocks; The eight geometric sub-blocks are rotated 180 degrees clockwise around the Z-axis. Then, the geometric sub-blocks are divided into multiple planar layers along the direction perpendicular to the Z-axis. The multiple planar layers are then swapped in reverse order according to the layer coordinates to complete a spatial rearrangement that is equivalent to a centrally symmetric flip.

[0013] As a further embodiment of the present invention, the step of sequentially performing forward-facing chain diffusion operations and reverse-facing chain diffusion operations on corresponding planes specifically includes: The forward chain diffusion operation starts from the first plane in this dimension: the forward diffusion result of the first plane is obtained by adding the pixel value of the current plane to the corresponding chaotic plane and taking the modulo 256; starting from the second plane, the pixel value of the current plane, three times the forward diffusion result of the previous plane, and the corresponding chaotic plane are added in sequence and the modulo 256 is taken to obtain the forward diffusion result of each plane in sequence. The reverse-plane chain diffusion operation starts from the last plane of this dimension: the final diffusion result of the last plane is obtained by XORing its forward diffusion result with the corresponding chaotic plane; from the second to last plane forward to the first plane, the forward diffusion result of the current plane, the reverse diffusion result completed by the next plane and the corresponding chaotic plane are XORed bit by bit to obtain the final diffusion result of each plane.

[0014] This invention also provides a multi-image encryption system based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, the system comprising: The sequence generation module is used to construct a three-dimensional data cube from multiple image data to be encrypted, and to generate a control sequence using cryptographic hash functions and chaotic systems. The scrambling module is used to perform multiple rounds of scrambling operations on the three-dimensional data cube based on the control sequence. Each round of scrambling operations includes: dividing the cube into two parts according to a chaotic pseudo-random integer sequence along a set coordinate axis, and performing rotation operations at different angles on the two parts respectively; then dividing the cube into 8 geometric sub-blocks according to the chaotic pseudo-random integer sequence, and performing an explosion operation on each sub-block. This operation is equivalent to performing a centrally symmetric flip on each sub-block in spatial geometry, so as to achieve decentralized scrambling of the internal elements of the cube.

[0015] The diffusion module is used to construct multiple three-dimensional chaotic cubes from the chaotic sequence. It divides the scrambled three-dimensional data cube and the three-dimensional chaotic cube into N planes in the X, Y, and Z dimensions. It then performs forward and reverse surface chain diffusion operations in sequence with the corresponding planes to complete bidirectional surface chain diffusion and obtain the final encryption result.

[0016] Compared with existing technologies, the beneficial effects of this invention are as follows: By designing a decentralized Rubik's Cube scrambling algorithm, the elements inside the cube can achieve more complete spatial rearrangement, enhancing the scrambling effect and reducing the required length of chaotic sequences and the number of scrambling operations, thereby improving the efficiency of the Rubik's Cube scrambling algorithm; In the diffusion stage, by designing a surface chain diffusion method, the calculation unit of diffusion is transformed from a single pixel to a plane, reducing the computational overhead caused by pixel-by-pixel operations and reducing the number of required chaotic sequences, thereby improving the overall running efficiency of the algorithm while ensuring encryption security. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention.

[0018] Figure 1This is a flowchart illustrating the encryption process of a multi-image encryption method based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, provided in an embodiment of the present invention.

[0019] Figure 2 A schematic diagram of the construction of a three-dimensional data cube provided in an embodiment of the present invention.

[0020] Figure 3 The diagrams are for a four-dimensional memristor hyperchaotic system, where (a) is the three-dimensional phase diagram of wxy, (b) is the three-dimensional phase diagram of xyz, (c) is the three-dimensional phase diagram of yzw, and (d) is the three-dimensional phase diagram of xzw.

[0021] Figure 4 A schematic diagram of scrambling a decentralized 3D Rubik's Cube.

[0022] Figure 5 The diagrams are schematic diagrams of surface chain diffusion, where (a) is a schematic diagram of diffusion in the X-axis direction, (b) is a schematic diagram of diffusion in the Y-axis direction, and (c) is a schematic diagram of diffusion in the Z-axis direction.

[0023] Figure 6 The following are simulation results: (a) is the original plaintext image, (b) is the three-dimensional data cube, (c) is the encrypted ciphertext cube, and (d) is the decrypted image.

[0024] Figure 7 Figure (a) shows the histogram of the three-dimensional data cube, and Figure (b) shows the histogram of the ciphertext cube.

[0025] Figure 8 The following is a schematic diagram of the correlation test of adjacent pixels provided in an embodiment of the present invention, wherein (a) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the horizontal direction (X), (b) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the vertical direction (Y), (c) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the depth direction (Z), (d) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the diagonal direction (XY), (e) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the diagonal direction (XZ), (f) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the diagonal direction (YZ), and (g) is a correlation distribution diagram of adjacent pixels of the ciphertext cube in the three-dimensional diagonal (XYZ). Detailed Implementation

[0026] To make the technical problems to be solved, the technical solutions, and the beneficial effects of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.

[0027] Figure 1 Here is a flowchart of a multi-image encryption method based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, as shown below. Figure 1 As shown in the embodiment of the present invention, a multi-image encryption method based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion includes: By fusing the grayscale and color image pixels to be encrypted and combining them with their size and type identifiers, a three-dimensional data cube is constructed. A chaotic sequence is generated using a hash function and a four-dimensional memristor hyperchaotic system and then integerized to obtain the pseudo-random integer sequence required for encryption. A multi-round decentralized 3D cube scrambling operation is performed on a 3D data cube based on a chaotic pseudo-random integer sequence. Each round of scrambling includes: dividing the cube into two parts according to the chaotic pseudo-random integer sequence along a set coordinate axis, and performing rotation operations at different angles on the two parts respectively; then dividing the cube into 8 geometric sub-blocks according to the chaotic pseudo-random integer sequence, and performing an explosion operation on each sub-block. This operation is geometrically equivalent to performing a centrally symmetric flip on each sub-block to achieve decentralized scrambling of the internal elements of the cube.

[0028] The chaotic sequence is constructed into multiple three-dimensional chaotic cubes. The scrambled three-dimensional data cube and the three-dimensional chaotic cube are divided into N planes in the X, Y, and Z dimensions. The forward and reverse surface chain diffusion operations are performed sequentially on the corresponding planes to complete the bidirectional surface chain diffusion and obtain the final encryption result.

[0029] In this embodiment, most existing technologies cannot encrypt grayscale and color images simultaneously, and after constructing multiple images into a cube, it is necessary to transmit an additional key containing the size information of each image. In contrast, the present invention can encrypt color and grayscale images simultaneously. By recording the size information and image type of each plaintext image to be encrypted, and constructing a cube together with the plaintext pixels, the plaintext image can be restored without transmitting the image size information key separately.

[0030] Most existing Rubik's Cube scrambling methods utilize chaotic sequences to rotate a certain cutting plane on the YOZ, XOZ, or XOY faces of the cube by 90° / 180° / 270°. Regardless of the rotation, the element at the cube's center remains concentrated there, without any decentralization. Furthermore, since only one cutting plane is operated on at a time, achieving sufficient scrambling requires numerous cube scrambling operations and a large number of chaotic sequences. Therefore, this invention changes the operation target from a single cutting plane to a portion of the cube, reducing the required number of chaotic sequences and improving scrambling efficiency. An explosion operation is also designed to address the issue of the cube's center element remaining at the center during Rubik's Cube scrambling.

[0031] Existing multi-image encryption methods typically employ pixel-by-pixel XOR during the diffusion phase. However, multi-image encryption requires numerous chaotic sequences for pixel-by-pixel operations, leading to high computational cost and low execution efficiency. To address this issue, this invention designs a surface-chain diffusion algorithm. This diffusion method treats surfaces as the operation objects, performing XOR, addition, and modulo operations on each surface along the X, Y, and Z dimensions. This ensures that any pixel in the cube is associated with its adjacent elements above, below, left, right, front, and back, improving computational efficiency while ensuring that changes in a single pixel affect the entire cube.

[0032] In a preferred embodiment of the present invention, the step of fusing the grayscale and color image pixels to be encrypted, and combining their size and type identifiers to construct a three-dimensional data cube further includes: Multiple images to be encrypted are uniformly converted to grayscale to obtain a set of grayscale images; Extract the width, height, and type identifier of each original image, and split the width and height into base 256 to construct the corresponding image attribute sequence. Concatenate the image attribute sequences to obtain the total attribute sequence, and split the length of the total attribute sequence into base 256. All image pixels in the grayscale image set are sequentially expanded into a one-dimensional pixel sequence, and the total attribute sequence and the 256-ary decomposition result of the length of the total attribute sequence are concatenated at the end of the one-dimensional pixel sequence to form a one-dimensional total data stream. The total number of elements in the one-dimensional total data stream is counted. Based on this, the side length of the smallest three-dimensional equilateral cube that can fully contain the one-dimensional total data stream is calculated. Zero-value elements are added to the end of the one-dimensional total data stream so that its total length matches the volume capacity of the three-dimensional equilateral cube to obtain an expanded data stream. The expanded data stream is then mapped and filled into the three-dimensional equilateral cube.

[0033] In this embodiment, the set of images to be encrypted is denoted as follows: For image sets I Perform uniform grayscale processing: when I k When the image is in color, it is decomposed into three grayscale images corresponding to the red, green, and blue channels. ;when I k When the image is grayscale, its format is preserved. This results in an image set containing only grayscale images. G For example, suppose a set of images to be encrypted ,in I 1,I 2 is a grayscale image. I 3 is a color image, then .

[0034] For the collection of images to be encrypted I ,by I k Build each original image as a unit I k Corresponding image attribute information sequence m k ,sequence m k This includes the image's width, height, and image type identifier, where the type identifier for grayscale images is 0, and for color images it is 1. Since the image width and height may exceed 255, the image needs to be losslessly split into base 256. (The last sentence appears to be incomplete and possibly refers to a different image format.) I Taking 1 as an example, its corresponding image information sequence can be represented as follows: , indicating that the image width is Image height The image type is grayscale.

[0035] Sequence by sequence m 1, m 2, m 3... m k By concatenating the images, a sequence containing all image attribute information is obtained. M , M The length is denoted as LM .right LM Obtained by lossless splitting in base 256 ,express . Set G The grayscale images in the image are unfolded and stitched together in row-major order to obtain a one-dimensional pixel sequence. P In a one-dimensional pixel sequence P A sequence of image attribute information is appended at the end. M and This constitutes the final data stream. Computational data flow C The total number of elements and determine that it meets the requirements. The smallest positive integer N , which serves as the side length of the three-dimensional data cube. When At that time, in the data stream C End of supplement Given zero-valued elements, a length of [length] is obtained. N 3 Extended data stream Finally, the data stream will be extended. Mapped sequentially to a size of Within the cube, the construction of the three-dimensional data cube is completed.

[0036] By designing a more universal method for constructing 3D data cubes, it can be applied to the unified encryption processing of both grayscale and color images. At the same time, the image size information is incorporated into the construction process of the 3D data cube, thereby eliminating the need to transmit an auxiliary key containing size information such as image length and width separately, thus improving system security.

[0037] As a preferred embodiment of the present invention, the step of generating a chaotic sequence using a hash function and a four-dimensional memristor hyperchaotic system and performing integerization processing to obtain the pseudo-random integer sequence required for encryption specifically includes: The SHA-256 hash function is used to calculate the three-dimensional data cube, generating a 256-bit hash value and dividing it into 32 groups. These groups are then combined with a preset initial seed key to calculate the initial value of the four-dimensional memristor hyperchaotic system. Substituting the initial value into the chaotic system for iteration and discarding the first part of the state value, multiple pseudo-random sequences are obtained; The generated pseudo-random sequences are preprocessed and mapped to a preset numerical range to obtain control sequences for scrambling and diffusion.

[0038] In this embodiment, a hash function is used to bind the initial value of the chaotic system to the plaintext image. SHA -256 hash calculations are performed on the 3D data cube to generate a 256-bit binary hash value. k .Will k Divided into 32 groups based on bytes, each group is represented as follows: k 1, k 2, k 3... k 32 . SHA -256 is a collision-resistant cryptographic hash function; it is difficult to find two different inputs that produce the same hash value, and even a small change in the input can completely alter the output hash value. This prevents attackers from generating the same key by forging inputs and also makes the initial value of the chaotic system highly sensitive to plaintext images. The initial value of the chaotic system is calculated according to the following formula. x 0, y 0, z 0, w 0, as part of the key set. This is a given value, which is the initial seed key set by the user. Based on the obtained initial values ​​of the chaotic system x0, y 0, z 0, w 0, let the parameter , , , , , , The four-dimensional memristor hyperchaotic system was iterated over, and the values ​​of the first 2000 iterations were discarded, resulting in four values ​​of length 6. N 3 pseudo-random sequence X , Y , Z and W .

[0039] Four-dimensional memristor hyperchaotic system: Due to the four pseudo-random sequences generated X , Y , Z and W The numbers contain decimals and their value ranges do not meet the preset requirements, so they need to be processed uniformly. First, by truncating the sequence... X , Y , Z The top 3 L The number is obtained , , Subsequently, the sequence Normalization and modular arithmetic are performed to map its sequence values ​​to... Interval; for sequences Normalization and modular arithmetic are performed to map its sequence values ​​to... Interval; for sequences Normalization and modular arithmetic are performed to map its sequence values ​​to... The interval, where, To round down; for the sequence W Normalization and modular arithmetic are performed to map its sequence values ​​to... The intervals are then used to obtain the sequences for scrambling the Rubik's Cube. D, E, F, and the sequence used for diffusion H .make L Represents the number of rounds in which the Rubik's Cube is scrambled. Represents a sequence The i The number, similarly. Representing sequences respectively The i Number; Representing sequences respectively The minimum value in; Representing sequences respectively The maximum value in the range; the specific formula for processing is as follows: , , ; ; ; ; .

[0040] In a preferred embodiment of the present invention, when performing each round of the decentralized 3D Rubik's Cube scrambling operation, the set coordinate axis directions are sequentially performed in the order of perpendicular to the X-axis, perpendicular to the Y-axis, and perpendicular to the Z-axis.

[0041] The step of dividing the three-dimensional data cube into eight geometric sub-blocks based on a chaotic pseudo-random integer sequence and performing an explosion operation on each sub-block specifically includes: determining a dividing plane in each of the X, Y, and Z dimensions based on the sequence, dividing the three-dimensional data cube into eight geometric sub-blocks; rotating the eight geometric sub-blocks 180 degrees clockwise around the Z-axis, then dividing the geometric sub-blocks into multiple planar layers along a direction perpendicular to the Z-axis, and swapping the multiple planar layers in reverse order according to the layer coordinate size to complete a spatial rearrangement equivalent to a centrally symmetric flip.

[0042] In this embodiment, the decentralized 3D Rubik's Cube scrambling algorithm has a total of L rounds. The operation steps of each round are the same as those of the first round. Here, only the specific steps of the first round of decentralized Rubik's Cube scrambling are described. The sequence... D Used to divide a three-dimensional data cube into two parts, a sequence. E Used to determine how much angle to rotate between these two parts, sequence F Used to determine the coordinates of the explosion point required for the explosion operation.

[0043] The specific steps for the first round of decentralized cube scrambling are as follows: In vertical X In the axial direction, according to the sequence D elements in d 1. Divide the cube into two parts, 0 to d One side is considered as a part, denoted as T 1; d 1+1 to N -1 is a part, denoted as T 2. Subsequently, according to the sequence E elements in e 1 pair T 1 and T The two parts rotate clockwise. If e If 1=1, then... T 1. Rotate 90° clockwise. T 2. Rotate 180° clockwise; ife If 1 = 2, then... T 1. Rotate 90° clockwise. T 2. Rotate clockwise 270°; if e If 1 = 3, then... T 1. Rotate clockwise 180°. T 2. Rotate 90° clockwise; if e 1=4, then T 1. Rotate clockwise 180°. T 2. Rotate clockwise 270°; if e 1=5, then T 1. Rotate clockwise 270°. T 2. Rotate 90° clockwise; if e 1=6, then T 1. Rotate clockwise 270°. T 2. Rotate 180° clockwise.

[0044] In vertical Y In the axial direction, according to the sequence D elements in d 2. Divide the cube into two parts, 0 to d Two sides constitute a part, denoted as T 3; d 2+1 to N -1 is a part, denoted as T 4. Subsequently, according to the sequence E elements in e 2 pairs T 3 and T 4. The two parts rotate clockwise. If e If 2 = 1, then... T 3. Rotate 90° clockwise. T 4. Rotate 180° clockwise; if e 2=2, then T 3. Rotate 90° clockwise. T 4. Rotate 270° clockwise; if e 2=3, then T 3. Rotate 180° clockwise. T 4. Rotate 90° clockwise; if e 2=4, then T 4. Rotate 180° clockwise. T 4. Rotate 270° clockwise; if e 2=5, then T 3. Rotate clockwise 270°. T 4. Rotate 90° clockwise; if e 2=6, then T 3. Rotate clockwise 270°.T 4. Rotate 180° clockwise.

[0045] In vertical Z In the axial direction, according to the sequence D elements in d 3. Divide the cube into two parts, 0 to d Three sides constitute a part, denoted as T 5; d 3+1 to N -1 is a part, denoted as T 6. Subsequently, according to the sequence E elements in e 3 pairs T 5 and T The two parts rotate clockwise. If e 3=1, then T 5. Rotate 90° clockwise. T 6. Rotate 180° clockwise; if e 3=2, then T 5. Rotate 90° clockwise. T 6. Rotate 270° clockwise; if e 3=3, then T 5. Rotate 180° clockwise. T 6. Rotate 90° clockwise; if e 3=4, then T 5. Rotate 180° clockwise. T 6. Rotate 270° clockwise; if e 3=5, then T 5. Rotate clockwise 270°. T 6. Rotate 90° clockwise; if e 3=6, then T 5. Rotate clockwise 270°. T 6. Rotate 180° clockwise.

[0046] Perform an explosion operation on the cube, according to the sequence. F elements in f 1, f 2, f 3 and the following formula divide the cube into eight parts, namely: B 1, B 2, B 3, B 4, B 5, B 6, B 7, B 8. ; ; ; ; right B 1, B 2, B 3, B 4, B 5, B 6, B 7, B 8. These eight geometric solids are rotated 180° clockwise around the z-axis, and the solids are positioned perpendicular to the z-axis. The axial direction is divided into Layers. Then, these layers are swapped in reverse order according to their coordinates, i.e., the first layer is mapped to the last layer, the second layer to the second-to-last layer, and so on, completing a full layer symmetrical flip. The explosion operation solves the problem of the cube's central portion remaining concentrated in the center during Rubik's Cube rotation.

[0047] In a preferred embodiment of the present invention, the step of sequentially performing forward-facing chain diffusion operations and reverse-facing chain diffusion operations on corresponding planes specifically includes: The forward chain diffusion operation starts from the first plane in this dimension: the forward diffusion result of the first plane is obtained by adding the pixel value of the current plane to the corresponding chaotic plane and taking the modulo 256; starting from the second plane, the pixel value of the current plane, three times the forward diffusion result of the previous plane, and the corresponding chaotic plane are added in sequence and the modulo 256 is taken to obtain the forward diffusion result of each plane in sequence. The reverse-plane chain diffusion operation starts from the last plane of this dimension: the final diffusion result of the last plane is obtained by XORing its forward diffusion result with the corresponding chaotic plane; from the second to last plane forward to the first plane, the forward diffusion result of the current plane, the reverse diffusion result completed by the next plane and the corresponding chaotic plane are XORed bit by bit to obtain the final diffusion result of each plane.

[0048] In this embodiment, the chaotic sequence H Constructed into six The three-dimensional chaotic cubes are denoted as follows: H 1, H 2, ... , H 6. Move the scrambled 3D data cube along... The axial direction is divided into N There are three planes, denoted as... P 1, P 2, ... , P N ; the chaotic cube H 1 along The axial direction is divided into N There are three planes, denoted as... H11 , H 12 , ... , H 1N Similarly, consider the chaotic cube. H 2 along The axial direction is divided into N There are three planes, denoted as... H 21 , H 22 , ... , H 2N .exist In the axial direction, a forward-facing chain diffusion operation is first performed to obtain the diffused cube. V .

[0049] Forward surface chain diffusion process: ; After completing the forward chain diffusion on all planes, then apply the diffusion to the cube. V Perform a similar reverse-plane chain diffusion operation. Unlike the forward-plane chain diffusion, the starting point of the reverse-plane chain diffusion is the [missing information - likely a specific step or operation]. N Each plane is calculated by performing AND operations layer by layer from back to front, thereby creating a global coupling relationship between the planes.

[0050] Reverse-side chain diffusion process: ; Subsequently, axial direction and Perform the same operation on the cube along the axial direction, except that... Along the axial direction The axial direction divides the cube into N The chaotic cube used in the diffusion process is a plane. H 3, H 4; in Along the axial direction The axial direction divides the cube into N The chaotic cube used in the diffusion process is a plane. H 5, H 6.

[0051] This surface-chain diffusion algorithm is in The cube corresponds to three dimensions N Zhang's image was used as the diffusion target, and sequentially... direction, direction and Direction NThe image is diffused in a bidirectional, face-chain manner from front to back and from back to front, so that any pixel in the cube is associated with its adjacent elements above, below, left, right, in front, and behind. This ensures that changes in a single pixel can affect the pixels of the entire cube, improving the algorithm's resistance to differential and statistical attacks.

[0052] By sequentially executing the above five steps, the final encryption result is obtained, which is presented in the form of a ciphertext cube. During decryption, the encrypted ciphertext cube is decrypted using the same initial seed key, hash value, and number of Rubik's Cube scramble rounds to recover the encrypted result. k A single original plaintext image.

[0053] This embodiment uses PyCharm 2020.3 as the simulation platform to verify whether the algorithm can achieve correct encryption and decryption. The following images are selected as the original plaintext images: Img1 (256*256*1 pixels), Img2 (256*256*3 pixels), Img3 (256*256*3 pixels), Img4 (512*512*1 pixels), Img5 (512*512*3 pixels), Img6 (512*512*3 pixels), and Img7 (1024*1024*1 pixels). Figure 6 As shown in (a).

[0054] The specific implementation steps for encrypting multiple original plaintext images using the method proposed in this invention are as follows: The original plaintext images Img1, Img2, Img3, Img4, Img5, Img6, and Img7 are processed uniformly to obtain a data stream. C and in the data stream C Adding 32,627 zero-value elements to the end results in a three-dimensional data cube of size 150*150*150, as shown below. Figure 6 As shown in (b). The schematic diagram of the construction of the three-dimensional data cube is shown below. Figure 2 As shown.

[0055] Using a hash function SHA -256 hash calculations are performed on the 3D data cube to generate a 256-bit binary hash value. Get the initial seed key. The initial values ​​of the chaotic system are calculated using values ​​of 0.1, 0.2, 0.1, and 0.3 respectively. x 0, y 0, z 0, w 0, based on the obtained initial values ​​of the chaotic system x 0, y 0, z 0,w 0, setting the parameters of the chaotic system to 0. , , , , , , The four-dimensional memristor hyperchaotic system was iterated over, and the values ​​of the first 2000 iterations were discarded, resulting in four values ​​of length 6. N 3 pseudo-random sequence X , Y , Z and W The phase diagram of the four-dimensional memristor hyperchaotic system is as follows: Figure 3 As shown, the top left subplot is the wxy three-dimensional phase diagram, the top right subplot is the xyz three-dimensional phase diagram, the bottom left subplot is the yzw three-dimensional phase diagram, and the bottom right subplot is the xzw three-dimensional phase diagram.

[0056] Processing chaotic sequence data: First, extract the sequence. X , Y , Z The top 3 L The number is obtained , , Subsequently, the sequence , , W is normalized and moduloed to map its sequence values ​​to... , , , The interval is used to obtain the sequence for scrambling the Rubik's Cube. D, E, F and the sequence used for diffusion H .

[0057] Decentralized 3D Rubik's Cube Scrambling: Scramble the Rubik's Cube L =20, according to the sequence D, E, F The value is obtained by performing 20 decentralized 3D Rubik's Cube scrambling operations on the 3D data cube using a decentralized 3D Rubik's Cube scrambling algorithm. The decentralized 3D Rubik's Cube scrambling diagram is shown below. Figure 4 As shown.

[0058] According to the sequence H Applying a surface-chain diffusion operation to the scrambled 3D data cube yields an encrypted ciphertext cube with a size of 150*150*150. Figure 6 As shown in (c). The schematic diagram of the surface chain diffusion is shown below. Figure 5As shown.

[0059] Using the same initial seed key, hash value, and number of Rubik's Cube scramble rounds to decrypt the encrypted ciphertext cube, seven original plaintext images can be recovered. The decryption results are as follows: Figure 6 As shown in (d), the simulation results verify that the designed algorithm can effectively encrypt and decrypt multiple original plaintext images.

[0060] Histogram analysis is a typical statistical analysis technique, primarily used to visually present the distribution characteristics of data. In the field of image encryption, the histogram of the encrypted image should tend towards a uniform distribution to improve the algorithm's ability to resist statistical analysis attacks. The histograms of the three-dimensional data cube and ciphertext cube constructed in this invention are as follows: Figure 7 As shown in the figure, the pixel value distribution of the histogram of the 3D data cube is not uniform, while the histogram of the encrypted ciphertext cube has a very uniform distribution.

[0061] Pixels in a raw image typically exhibit strong spatial correlation, but this correlation is effectively destroyed after processing with a secure encryption algorithm. Therefore, a reliable image encryption scheme should be able to transform the raw image into an encrypted image with extremely low correlation between adjacent pixels.

[0062] A schematic diagram of the correlation test between adjacent pixels in this invention is shown below. Figure 8 As shown, it can be observed that the scatter points of all sub-images are evenly distributed throughout the entire plane, without forming obvious linear trends or clustered areas. This indicates that the encrypted ciphertext cube exhibits extremely low pixel correlation in all adjacent directions, meeting the requirements of secure image encryption and effectively resisting attack methods based on statistical analysis.

[0063] This invention proposes a unified multi-image encryption method applicable to both grayscale and color images. By designing a novel three-dimensional data cube construction mechanism, the pixel data of the images to be encrypted, along with their corresponding image size and type information, are embedded into the three-dimensional data cube structure. This allows multiple images of different sizes and types to be fused together into a single three-dimensional data cube for overall encryption. During decryption, this method can directly recover multiple plaintext images based on the information contained within the cube, eliminating the need to separately transmit auxiliary keys containing image length and width information. This reduces the complexity of key management and transmission, while simultaneously improving the algorithm's versatility and system security.

[0064] This invention addresses the shortcomings of traditional Rubik's Cube scrambling methods, such as insufficient decentralization and low scrambling efficiency, by improving the scrambling mechanism. Unlike existing methods that typically only rotate a single cutting plane of the cube, this invention expands the object of each scrambling operation from a single cutting plane to the entire cube. Based on a chaotic sequence, the cube is divided into two parts, and these two parts are rotated by 90° / 180° / 270° respectively. Each Rubik's Cube scrambling operation can change the position of all elements in the cube, reducing the need for a chaotic sequence while improving overall scrambling efficiency. Furthermore, this invention introduces an "explosion" operation, allowing pixels originally located in the cube's center region to spread outwards to other spatial locations, achieving effective decentralization of the cube's center region. This further enhances the randomness and complexity of pixel spatial distribution, improving the algorithm's resistance to statistical and structural analysis attacks.

[0065] This invention proposes a face-chain diffusion mechanism in the diffusion stage. Using the "faces" of a cube as the basic operation unit, diffusion operations are performed sequentially in the X, Y, and Z directions. Inter-pixel values ​​are influenced by XOR, addition, and modulo operations. Compared to traditional pixel-by-pixel diffusion methods, this method significantly reduces the number of chaotic sequences required and effectively lowers the computational complexity of the algorithm. Furthermore, since the diffusion operation on each face affects the pixel relationships in its adjacent directions, changes in any pixel within the cube can propagate through a chain to its adjacent elements above, below, left, right, front, and back, ultimately spreading to the entire cube. This significantly improves the algorithm's execution efficiency while ensuring diffusion strength and security.

[0066] This invention also provides a multi-image encryption system based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, the system comprising: The sequence generation module is used to construct a three-dimensional data cube from multiple image data to be encrypted, and to generate a control sequence using cryptographic hash functions and chaotic systems. The scrambling module is used to perform multiple rounds of scrambling operations on the three-dimensional data cube based on the control sequence. Each round of scrambling operations includes: dividing the cube into two parts according to a chaotic pseudo-random integer sequence along a set coordinate axis, and performing rotation operations at different angles on the two parts respectively; then dividing the cube into 8 geometric sub-blocks according to the chaotic pseudo-random integer sequence, and performing an explosion operation on each sub-block. This operation is equivalent to performing a centrally symmetric flip on each sub-block in spatial geometry, so as to achieve decentralized scrambling of the internal elements of the cube.

[0067] The diffusion module is used to construct multiple three-dimensional chaotic cubes from the chaotic sequence. It divides the scrambled three-dimensional data cube and the three-dimensional chaotic cube into N planes in the X, Y, and Z dimensions. It then performs forward and reverse surface chain diffusion operations in sequence with the corresponding planes to complete bidirectional surface chain diffusion and obtain the final encryption result.

[0068] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A multi-image encryption method based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, characterized in that, The method includes: By fusing the grayscale and color image pixels to be encrypted and combining them with their size and type identifiers, a three-dimensional data cube is constructed. A chaotic sequence is generated using a hash function and a four-dimensional memristor hyperchaotic system and then integerized to obtain the pseudo-random integer sequence required for encryption. A multi-round decentralized 3D cube scrambling operation is performed on a 3D data cube based on a chaotic pseudo-random integer sequence. Each round of scrambling includes: dividing the cube into two parts along a set coordinate axis according to the chaotic pseudo-random integer sequence, and performing rotation operations at different angles on each part; then dividing the cube into 8 geometric sub-blocks according to the chaotic pseudo-random integer sequence, and performing an explosion operation on each sub-block. This operation is geometrically equivalent to performing a centrosymmetric flip on each sub-block to achieve decentralized scrambling of the internal elements of the cube. Multiple 3D chaotic cubes are constructed from the chaotic sequence. The scrambled 3D data cube and the 3D chaotic cube are divided into N planes along the X, Y, and Z dimensions. Forward and reverse face-chain diffusion operations are then performed sequentially on the corresponding planes to complete bidirectional face-chain diffusion, resulting in the final encryption result.

2. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 1, characterized in that, The step of fusing the grayscale and color image pixels to be encrypted, and combining their size and type identifiers to construct a three-dimensional data cube, further includes: Multiple images to be encrypted are uniformly converted to grayscale to obtain a set of grayscale images; Extract the width, height, and type identifier of each original image, and split the width and height into base 256 to construct the corresponding image attribute sequence. Concatenate the image attribute sequences to obtain the total attribute sequence, and split the length of the total attribute sequence into base 256. All image pixels in the grayscale image set are sequentially expanded into a one-dimensional pixel sequence, and the total attribute sequence and the 256-ary decomposition result of the length of the total attribute sequence are concatenated at the end of the one-dimensional pixel sequence to form a one-dimensional total data stream. The total number of elements in the one-dimensional total data stream is counted. Based on this, the side length of the smallest three-dimensional equilateral cube that can fully contain the one-dimensional total data stream is calculated. Zero-value elements are added to the end of the one-dimensional total data stream so that its total length matches the volume capacity of the three-dimensional equilateral cube to obtain an expanded data stream. The expanded data stream is then mapped and filled into the three-dimensional equilateral cube.

3. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 2, characterized in that, The process involves extracting the width, height, and type identifier of each original image, and then splitting the width and height into base 256 units. Given that the upper limit of the numerical value corresponding to a 16-bit binary sequence is 65535, this fully covers common image sizes, including 4K and 8K ultra-high-definition resolutions. While meeting the requirements of industrial-grade image processing, this method maximizes the compression of data space occupied by auxiliary information, effectively reducing system storage redundancy.

4. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 2, characterized in that, The image type identifier is used to distinguish whether the original image is a grayscale image or a color image.

5. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 1, characterized in that, The steps of generating a chaotic sequence using a hash function and a four-dimensional memristor hyperchaotic system and then performing integerization to obtain the pseudo-random integer sequence required for encryption specifically include: The SHA-256 hash function is used to calculate the three-dimensional data cube, generating a 256-bit hash value and dividing it into 32 groups. These groups are then combined with a preset initial seed key to calculate the initial value of the four-dimensional memristor hyperchaotic system. Substituting the initial value into the chaotic system for iteration and discarding the first part of the state value, multiple pseudo-random sequences are obtained; The generated pseudo-random sequences are preprocessed and mapped to a preset numerical range to obtain control sequences for scrambling and diffusion.

6. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 1, characterized in that, During each round of the decentralized 3D Rubik's Cube scrambling operation, the set coordinate axis directions are sequentially arranged in the order of perpendicular to the X-axis, perpendicular to the Y-axis, and perpendicular to the Z-axis.

7. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 1, characterized in that, The process of dividing the three-dimensional data cube into eight geometric sub-blocks based on a chaotic pseudo-random integer sequence and performing an explosion operation on each sub-block specifically includes: Based on the sequence, a dividing plane is determined in each of the three dimensions X, Y, and Z, and the three-dimensional data cube is divided into eight geometric sub-blocks; The eight geometric sub-blocks are rotated 180 degrees clockwise around the Z-axis. Then, the geometric sub-blocks are divided into multiple planar layers along the direction perpendicular to the Z-axis. The multiple planar layers are then swapped in reverse order according to the layer coordinates to complete a spatial rearrangement that is equivalent to a centrally symmetric flip.

8. The multi-image encryption method based on decentralized three-dimensional Rubik's Cube scrambling and surface chain diffusion according to claim 1, characterized in that, The sequential execution of forward and reverse chain diffusion operations on corresponding planes specifically includes: The forward chain diffusion operation starts from the first plane in this dimension: the forward diffusion result of the first plane is obtained by adding the pixel value of the current plane to the corresponding chaotic plane and taking the modulo 256; starting from the second plane, the pixel value of the current plane, three times the forward diffusion result of the previous plane, and the corresponding chaotic plane are added in sequence and the modulo 256 is taken to obtain the forward diffusion result of each plane in sequence. The reverse-plane chain diffusion operation starts from the last plane of this dimension: the final diffusion result of the last plane is obtained by XORing its forward diffusion result with the corresponding chaotic plane; from the second to last plane forward to the first plane, the forward diffusion result of the current plane, the reverse diffusion result completed by the next plane and the corresponding chaotic plane are XORed bit by bit to obtain the final diffusion result of each plane.

9. A multi-image encryption system based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion, used to implement the multi-image encryption method based on decentralized 3D Rubik's Cube scrambling and surface chain diffusion as described in any one of claims 1-8, characterized in that, The system includes: The sequence generation module is used to construct a three-dimensional data cube from multiple image data to be encrypted, and to generate a control sequence using cryptographic hash functions and chaotic systems. The scrambling module performs multiple rounds of scrambling operations on the 3D data cube based on the control sequence. Each round of scrambling includes: dividing the cube into two parts according to a chaotic pseudo-random integer sequence along a set coordinate axis, and performing rotation operations at different angles on each part; then dividing the cube into 8 geometric sub-blocks according to the chaotic pseudo-random integer sequence, and performing an explosion operation on each sub-block. This operation is geometrically equivalent to performing a centrosymmetric flip on each sub-block to achieve decentralized scrambling of the elements inside the cube. The diffusion module constructs multiple 3D chaotic cubes from the chaotic sequence, divides the scrambled 3D data cube and the 3D chaotic cube into N planes along the X, Y, and Z dimensions, and sequentially performs forward and reverse surface chain diffusion operations on the corresponding planes to complete bidirectional surface chain diffusion and obtain the final encryption result.