Dynamic spiral and bidirectional diffusion image encryption method based on four-dimensional chaos
By combining a four-dimensional chaotic system and a dynamic spiral scrambling mechanism with a bidirectional nonlinear diffusion mechanism, the security and efficiency issues of existing chaotic image encryption schemes are solved, achieving image encryption with high security and anti-attack capabilities, and is suitable for ordinary computing devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING NORMAL UNIVERSITY
- Filing Date
- 2025-12-15
- Publication Date
- 2026-05-08
AI Technical Summary
Existing chaotic image encryption schemes suffer from insufficient security of low-dimensional chaotic systems, static and fixed scrambling methods, low diffusion efficiency, and insufficient avalanche effect, making image data vulnerable to attacks during transmission or storage.
A high-entropy key stream is generated using a four-dimensional chaotic system. Combined with dynamic spiral scrambling and bidirectional nonlinear diffusion mechanisms, adaptive spiral scrambling and global avalanche effect are achieved in the image, enhancing the image's security and resistance to attacks.
By generating a high-entropy key stream through a four-dimensional chaotic system, and employing dynamic spiral scrambling and bidirectional nonlinear diffusion mechanisms, the security and resistance to differential attacks of image encryption are significantly improved, ensuring plaintext sensitivity and diffusion, and making it suitable for ordinary computing devices.
Smart Images

Figure CN122001990A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image information security and cryptography technology, specifically relating to a method for image encryption using chaotic systems, and particularly a high-security image encryption scheme that combines dynamic spiral pixel scrambling and bidirectional nonlinear pixel diffusion. Background Technology
[0002] With the rapid development of 5G, Internet of Things (IoT), and Vehicle-to-Everything (V2X) technologies, digital images, as a key information carrier, are playing an increasingly prominent role in fields such as smart healthcare, military reconnaissance, financial payments, and intelligent surveillance. These images typically contain a large amount of sensitive information, and if they are stolen or tampered with during transmission or storage, it will have serious consequences.
[0003] Traditional encryption algorithms, such as the Advanced Encryption Standard (AES) and the Data Encryption Standard (DES), offer good security for text data, but they have significant shortcomings when directly applied to image data. Image data is characterized by its large volume, high redundancy, and strong correlation between adjacent pixels, resulting in low efficiency of traditional encryption algorithms. Furthermore, the encrypted images exhibit unsatisfactory statistical properties, making them vulnerable to attacks such as statistical analysis and differential cryptanalysis.
[0004] Chaotic systems, due to their extreme sensitivity to initial conditions and control parameters, ergodicity, and near-randomness, are highly compatible with the requirements of cryptography and are widely used in image encryption. A typical chaotic image encryption system usually consists of three core parts: chaotic sequence generation, pixel position scrambling, and pixel value diffusion. However, existing chaotic image encryption schemes still have many limitations:
[0005] (1) Many schemes use low-dimensional chaotic systems, whose dynamic behavior is relatively simple and the range of chaotic parameters is narrow. When implemented in the digital domain, they are prone to degenerate into short-period sequences due to the finite precision effect, resulting in insufficient security.
[0006] (2) In the pixel scrambling stage, a fixed, predefined scanning path (such as line scanning, Hilbert curve, or fixed-direction spiral scanning) is often used. This static scrambling method may not be able to completely break the inherent spatial correlation of the image, and attackers may be able to restore some information by analyzing statistical patterns.
[0007] (3) In the pixel value diffusion stage, many schemes adopt linear or unidirectional diffusion mechanisms. This mechanism usually requires multiple iterations to achieve a sufficient diffusion effect, which is inefficient and the avalanche effect (i.e., the characteristic that a small change in plaintext leads to a large change in ciphertext) is not significant enough, and the ability to resist differential attacks is weak.
[0008] Therefore, there is an urgent need for a new image encryption scheme that can comprehensively solve the above problems, namely, while ensuring encryption and decryption efficiency, it has a larger key space, stronger pixel scrambling ability and a more efficient diffusion mechanism. Summary of the Invention
[0009] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a highly secure and efficient chaotic image encryption method based on dynamic spiral permutation and bidirectional nonlinear diffusion. Addressing the problems of easy degradation of low-dimensional chaotic systems, insufficient security, static and fixed scrambling methods, low diffusion efficiency, and insufficient avalanche effect in the background technology, this invention proposes a highly secure image encryption scheme that combines "four-dimensional chaotic-driven dynamic spiral pixel scrambling" with "bidirectional nonlinear pixel diffusion," achieving strong statistical security and resistance to differential attacks while ensuring computational efficiency. The core technical mechanism of this invention lies in the following: First, a four-dimensional continuous chaotic system with strong nonlinear coupling is constructed. A high-entropy, long-period key stream is generated by being sensitive to both the initial key and image hash information, thus avoiding the problem of easy degradation of low-dimensional chaotic systems in digital implementation. Then, the direction sequence, starting point sequence, and step size sequence of the spiral traversal are dynamically controlled by the chaotic sequence to achieve adaptive spiral scrambling of the entire image, no longer relying on any fixed scanning path, thereby effectively breaking the inherent spatial correlation of the image. Next, a bidirectional nonlinear diffusion mechanism driven by both forward and reverse key streams is introduced, so that the ciphertext result of each pixel depends simultaneously on its original value, the diffusion feedback value of the preceding and following pixels, and two sets of non-repeating key sequences, realizing a global avalanche effect within a single round of diffusion, which greatly improves the resistance to differential attacks, chosen-plaintext attacks, and statistical attacks. In summary, the technical innovations of this invention are concentrated in the following aspects: (1) using a four-dimensional chaotic system as the driving source, significantly improving the key space size and the randomness of the chaotic sequence; (2) proposing a dynamic spiral scrambling mechanism, which completely controls the scanning path through the chaotic sequence, achieving fully random changes in direction, starting point, and step size; and (3) designing a bidirectional nonlinear diffusion structure to form bidirectional coupling feedback between pixels, achieving efficient, reversible, and strong avalanche diffusion effects. The synergistic effect of the above-mentioned technical features of this invention makes it superior to existing chaotic image encryption schemes in terms of security, complexity, and anti-attack capability.
[0010] To achieve the above objectives, the present invention adopts the following technical solution:
[0011] The core idea of this invention lies in improving the overall security of image encryption through collaborative innovation at three levels:
[0012] At the level of chaotic sources: A novel four-dimensional chaotic system is designed and used as a random number generator. This system has more complex nonlinear terms and a larger parameter space, enabling it to generate chaotic sequences with better randomness and longer periodicity, providing a high-quality keystream for the encryption process.
[0013] At the pixel scrambling level, a dynamic spiral permutation mechanism is proposed. This mechanism abandons the fixed scanning pattern, and key parameters such as the direction, starting point, and step size of the spiral traversal are dynamically controlled by a chaotic sequence, making the scrambling pattern unique and unpredictable for each encryption, thereby greatly enhancing the randomness and resistance to statistical analysis of the scrambling.
[0014] At the pixel diffusion level: An enhanced bidirectional nonlinear diffusion mechanism is designed. This mechanism utilizes two independent key streams to simultaneously diffuse the image forward and backward, and combines nonlinear operations (such as modulo addition, cyclic shift, and XOR) to ensure that even small changes in each pixel can be rapidly propagated to the entire image within a single round of operation, achieving efficient global confusion and a significant avalanche effect.
[0015] The beneficial effects of this invention include:
[0016] High security: It adopts a four-dimensional chaotic system with a huge key space, which can effectively resist brute-force attacks; dynamic scrambling and bidirectional nonlinear diffusion greatly enhance the algorithm's ability to resist statistical analysis, differential attacks and chosen-plaintext attacks.
[0017] Strong plaintext sensitivity: The key generation is bound to the hash value of the original image, ensuring the "one-time pad" property. Any slight modification to the plaintext will produce completely different ciphertext.
[0018] Excellent diffusion: The two-way diffusion mechanism can achieve global pixel value obfuscation within a single round of encryption, resulting in a significant avalanche effect.
[0019] Practicality: The algorithm has a clear structure, is easy to implement in software, and can run efficiently on ordinary computing devices, making it suitable for image encryption applications. Attached Figure Description
[0020] Figure 1 This is an overall flowchart of the image encryption method provided in the embodiments of the present invention.
[0021] Figure 2 This is an experimental result diagram of the image encryption method provided in the embodiments of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. The following embodiments describe a preferred implementation of the invention, but the scope of protection of the invention is not limited thereto.
[0023] Reference Figure 1 The image encryption method of the present invention mainly includes three stages executed sequentially: chaotic key sequence generation, dynamic spiral permutation, and enhanced bidirectional nonlinear diffusion.
[0024] Phase 1: Chaotic Key Sequence Generation (S1)
[0025] The goal of this stage is to generate a high-quality, plaintext-related keystream for subsequent permutation and diffusion stages.
[0026] Image hash calculation: Input a raw grayscale image I of size H × W. Calculate the SHA-512 hash value of this image, obtaining a 512-bit binary sequence H_sha. This hash value will serve as the "fingerprint" for the encryption process, making the key correlated with the plaintext image content, thereby enhancing the algorithm's resistance to chosen-plaintext attacks.
[0027] System parameters and state initialization: The 512-bit hash value H_sha is divided into several segments and mapped to the control parameters a, b, c, d and the initial states x_0, y_0, z_0, w_0 of the four-dimensional chaotic system. For example, it can be converted into integers between 0 and 65535 in groups of 16 bits, and then mapped to the required numerical range of the system parameters through a linear transformation.
[0028] Chaotic Sequence Generation and Preprocessing: Using initialized parameters and states, the differential equations of the four-dimensional chaotic system described in claim 2 are solved iteratively using numerical methods (such as the fourth-order Runge-Kutta method). To avoid transient effects, the values from the first N_0 (e.g., 1000) iterations are discarded. The process continues iteratively to generate four chaotic sequences X, Y, Z, and W of sufficient length. These sequences are post-processed (e.g., modulo operations, amplification, etc.) and normalized to the integer range [0, 255] to form the final key matrix. These key streams are divided into a direction sequence D for controlling the spiral permutation, a starting point sequence S, a step size sequence T, and two key streams K_1 and K_2 for bidirectional diffusion.
[0029] Phase Two: Dynamic Spiral Displacement (S2)
[0030] The goal of this stage is to disrupt the spatial correlation between image pixels.
[0031] Initialization and Layering: Input the original image I and the key sequence D, S, T. Determine the number of spiral layers. Create an empty matrix I_s of the same size as I to store the scrambled image.
[0032] Layer-by-layer spiral scrambling: For each layer k (from the outermost layer k=0 to the innermost layer k=L-1):
[0033] Determine the traversal parameters: The spiral direction of this layer is determined based on the value of the sequence D(k) (e.g., 0 represents clockwise and 1 represents counterclockwise). The starting index and permutation step size of the spiral path of this layer are determined based on the values of S(k) and T(k) (constrained within the valid range by modulo operation).
[0034] Generate a spiral path: Starting from the top left corner of the layer, extract the coordinates of all pixels on the layer boundary in sequence, forming a coordinate sequence seq. For example, for a rectangular layer, the path order might be: top (left -> right), right (top -> bottom), bottom (right -> left), left (bottom -> top).
[0035] Perform a cyclic permutation: Based on the starting index start = S(k) and the step size step = T(k), perform a cyclic shift operation on the pixel coordinate indices in the path sequence seq. For example, cyclically shift the sequence to the right by step positions. Record the mapping relationship between the original coordinates and the scrambled coordinates; this mapping relationship will be used for the inverse permutation during decryption.
[0036] Write back pixels: Write the pixel values on the spiral path in the original image to the corresponding positions in the output image I_s according to the new order after the permutation.
[0037] After processing all layers, output the scrambled image I_s.
[0038] Stage 3: Enhanced bidirectional nonlinear diffusion (S3)
[0039] The goal of this stage is to change the grayscale value of each pixel so that a small change in the plaintext can cause a large change in the ciphertext, and to eliminate statistical regularity.
[0040] Initialization: Unfold the scrambled 2D image I_s into a 1D pixel vector P = [p_1, p_2, ..., p_N] in row-major or column-major order, where N = H × W. Initialize a feedback variable fb (e.g., a specific value from the keystream).
[0041] Forward diffusion: Perform the following operation from the first pixel to the last pixel (i ranges from 1 to N):
[0042] Back diffusion: Perform the following operation from the last pixel to the first pixel (i from N to 1):
[0043] Output: The one-dimensional vector C that has undergone bidirectional diffusion is reshaped into a two-dimensional matrix of H × W, resulting in the final encrypted image I_enc.
[0044] Decryption process
[0045] Decryption is the reverse process of encryption. First, the exact same keystream must be reproduced using the same original image (or its SHA-512 hash) and system parameters. Then, the three stages are performed in reverse order:
[0046] Reverse bidirectional diffusion: Performs a reverse bidirectional diffusion operation on the encrypted image to recover the one-dimensional vector form of the scrambled image I_s. Its formula is the inverse operation of the encryption diffusion formula.
[0047] Reverse dynamic spiral permutation: Using the mapping relationship recorded during encryption (or regenerating the same permutation parameters using the same key stream), reverse pixel position permutation is performed on I_s, putting each pixel back to its original position.
[0048] Finally, the decrypted original image is obtained.
[0049] Depend on Figure 2 As can be seen, the original image was processed by the encryption algorithm of this invention to generate a highly chaotic and difficult-to-identify ciphertext image. After decryption, it was successfully restored to a decrypted image that was completely consistent with the original image, which fully verified the effectiveness and feasibility of the algorithm.
[0050] To verify the robustness and sensitivity to minor perturbations of the encryption algorithm of this invention, UACI (Uniform Average Change Intensity) and NPCR (Non-Pin Pixel Change Rate) analyses were performed on multiple sets of standard test images. Experimental results show that for test images of different sizes (256×256 and 512×512), the NPCR values are approximately 99.58%–99.62%, and the UACI values are approximately 33.03%–34.27%. These results indicate that the algorithm of this invention exhibits significant pixel changes after encryption, effectively resisting differential attacks and possessing high security.
[0051] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A dynamic spiral and bidirectional diffusion image encryption method based on four-dimensional chaos, characterized in that, Includes the following steps: Step S1: Input the original image and calculate its SHA-512 hash value; The hash value is used to initialize the parameters and initial state of a four-dimensional chaotic system; the four-dimensional chaotic system is run to generate the required chaotic sequence, and the chaotic sequence is normalized to obtain the key stream for permutation and diffusion; Step S2: Divide the original image into multiple spiral layers; dynamically determine the parameters of each spiral layer using the key stream generated in step S1, specifically including: traversal direction, starting position, and permutation step size; based on the determined parameters of each spiral layer, perform cyclic permutation on the pixel positions within each spiral layer and record the mapping relationship to obtain the scrambled image; Step S3: Convert the scrambled image obtained in step S2 into a one-dimensional pixel vector; use step S1 to generate two independent key streams, and perform forward diffusion and backward diffusion on the one-dimensional vector respectively, wherein the encryption value of each pixel is nonlinearly calculated with the key stream and the encryption results of adjacent pixels; reshape the one-dimensional vector that has completed bidirectional diffusion into a two-dimensional matrix, and output it as the final encrypted image.
2. The image encryption method based on four-dimensional chaos and dynamic spiral and bidirectional diffusion according to claim 1, characterized in that, The four-dimensional chaotic system in step S1 is defined by the following set of differential equations: ; ; ; ; The meanings of the parameters a, b, c, and d in the system of differential equations are explained as follows: Parameter a: Used to adjust the intensity of chaotic oscillations in the system, making the generated key sequence more random, thereby increasing the unpredictability of the ciphertext against external attacks and enhancing its resistance to brute-force attacks; Parameter b: Used to enhance the coupling between the state variables of the system, making the chaotic sequence extremely sensitive to the initial image and hash input, thereby ensuring that a completely different key stream is generated when the plaintext undergoes any slight change; Parameter c: Used to control the contraction and divergence speed of system energy, so that the chaotic system can maintain a strong chaotic state for a long time without degenerating into periodic behavior, thereby ensuring that the key sequence has long period and high entropy characteristics; Parameter d: Used to enhance the nonlinear feedback inside the system, making the chaotic trajectory exhibit irreversible perturbation diffusion characteristics, thereby effectively improving the key sequence's resistance to differential attacks, statistical analysis, and chosen-plaintext attacks.
3. The image encryption method based on four-dimensional chaos and dynamic spiral and bidirectional diffusion according to claim 1, characterized in that, The dynamic spiral permutation in step S2 specifically includes: The number of spiral layers L is determined by the image height H and width W, and the calculation formula is: ; The traversal direction sequence D, the starting point sequence S, and the step size sequence T are all dynamically determined by specific calculations from the chaotic sequence generated in step S1. The rounding up symbol is used to ensure that the spiral permutation process can cover the innermost pixel region of the image and guarantee the reversibility of encryption. By adopting the rounding up mechanism, it is ensured that the remaining center pixels constitute an effective spiral layer, so that the dynamic spiral traversal can completely cover the entire image and avoid the phenomenon of unsorted pixels. The rounding up symbol undertakes the encryption security function of controlling the coverage range of the layer number. For each spiral layer k, a spiral path coordinate sequence is generated based on the direction D(k); based on the starting point S(k) and the step size T(k), the pixels on the path are cyclically shifted right or left to scramble the pixel positions.
4. The image encryption method based on four-dimensional chaos and dynamic spiral and bidirectional diffusion according to claim 1, characterized in that, The enhanced bidirectional nonlinear diffusion in step S3 specifically refers to: Let the one-dimensional pixel vector be P = [p_1, p_2, ..., p_N], the forward key stream be K_1 = [k1_1, k1_2, ..., k1_N], and the backward key stream be K_2 = [k2_1, k2_2, ..., k2_N]; where p_1, p_2, ..., p_N represent the one-dimensional pixel sequence obtained by spiral scrambling and unfolding, where each pᵢ is the gray value of the corresponding pixel, which is the input data of the diffusion process; k1_1, k1_2, ..., k1_N represent the key sequence used for forward diffusion, which is jointly generated by a four-dimensional chaotic system and image hashing, and performs pixel-by-pixel encryption from p1 to p_N; k2_1, k2_2, ..., k2_N represent the key sequence used for back diffusion, which is unique to K1. Back diffusion is performed on the pixel from p_N to p_1 to offset the directional bias and enhance the global diffusion capability. Forward diffusion proceeds in order from p_1 to p_N, and the encryption formula is: ; Back diffusion proceeds in the order from p_N to p_1, and the encryption formula is: ; The meaning of each symbol in the diffusion formula is as follows: i: The index of the pixel position currently participating in the diffusion operation; Non-linear blending operations are used to break the original grayscale patterns. FB: Forward diffusion feedback value, updated by the diffusion result of the previous pixel, giving the diffusion a cascading avalanche effect; FBr: Back-diffusion feedback value, updated by the diffusion result of the next pixel, enabling bidirectional diffusion propagation; C_i: The final ciphertext pixel sequence after bidirectional diffusion, each pixel of which depends on p_i, k1_i, k2_i, FB and FBr simultaneously, thereby achieving global pixel obfuscation; Through the above mechanism, even the smallest changes in any pixel or key will propagate to the entire image within a single round of computation, achieving a strong avalanche effect and high resistance to differential attacks.
5. The image encryption method based on four-dimensional chaos and dynamic spiral and bidirectional diffusion according to claim 1, characterized in that, The key space of the method is composed of the initial state / parameters of the chaotic system, the SHA-512 hash value, and the dynamic spiral parameters. The total space exceeds 2^128, which can effectively resist exhaustive attacks, including potential quantum computing attacks.
6. An image encryption system for implementing the encryption method as described in any one of claims 1 to 5, characterized in that, The system includes: Memory is used to store executable instructions for a computer; The processor is configured to execute the instructions to implement the following modules: A chaotic key generation module, used to perform step S1 in claim 1; A dynamic spiral displacement module is used to perform step S2 in claim 1; A bidirectional nonlinear diffusion module is used to perform step S3 in claim 1; Image input / output interface module, used to receive raw images and output encrypted images.