Image encryption method based on digital domain chaotic system
By using pseudo-random control sequences generated by digital domain chaotic systems and the Mason slew algorithm, a complex key stream generation method is constructed. This solves the problems of sensitivity unidirectionality and misunderstanding of differential relationships in image encryption algorithms, and achieves highly secure and robust image encryption.
Patent Information
- Application Number
- CN202511127673.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-11-18
AI Technical Summary
Existing image encryption algorithms suffer from one-way sensitivity and misunderstanding of differential relationships, making them vulnerable to chosen ciphertext attacks and differential attacks. Furthermore, floating-point operations cause the dynamic characteristics of chaotic sequences to degrade, affecting long-term security.
A pseudo-random control sequence is generated by combining a digital domain chaotic system with the Mason scrambling algorithm. A complex key stream generation method is constructed through pixel-level and bit-level scrambling and diffusion operations to ensure bidirectional sensitivity between plaintext and ciphertext. Heterogeneous operations are introduced to enhance the diffusion effect.
It achieves complex chaotic sequence generation and efficient image encryption, resists various attacks, ensures that the key space is larger than brute force attacks, and has high security and robustness.
Smart Images

Figure CN120976004A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information transmission, and more particularly, it relates to an image encryption method based on a digital domain chaotic system. BACKGROUND
[0002] Image encryption technology, as a core means to protect data security, aims to convert the original image (plaintext) with high redundancy and strong correlation into a disordered and noise-like ciphertext image through specific algorithms. The design idea of modern image encryption algorithms is largely derived from the confusion and diffusion principles proposed by Shannon. At the same time, the chaos theory is highly consistent with the characteristics required by cryptography due to its inherent pseudo-randomness, ergodicity, and extreme sensitivity to initial conditions and system parameters, which makes it exhibit great potential in realizing the operations of permutation and diffusion, and has become a research hotspot in the past two decades.
[0003] However, despite the numerous encryption schemes based on chaos, many designs still hide serious security flaws that often go beyond the scope of surface performance indicators. On the one hand, a large number of algorithms are plagued by the limited precision effect due to the direct use of floating-point operations to implement continuous chaotic systems, which can lead to the degradation of the dynamic characteristics of chaotic sequences, thereby severely weakening the long-term security of the cryptographic system. On the other hand, with the continuous progress of cryptanalysis techniques, deeper structural vulnerabilities are gradually exposed.
[0004] One of the major security vulnerabilities that has long been overlooked by chaos-based cryptographers is the "unidirectional sensitivity" of the encryption system. Traditional designs generally emphasize the sensitivity of the ciphertext to the plaintext (i.e., minor changes in the plaintext will cause significant changes in the ciphertext), but ignore the fact that the sensitivity of the plaintext to the ciphertext is also crucial. This "unidirectional" sensitivity facilitates advanced attack methods such as chosen ciphertext attacks, where an attacker can infer plaintext information by constructing a specific changed ciphertext. This reveals an important principle: a secure cryptographic system must satisfy the bidirectional sensitivity dependence between the plaintext and the ciphertext, and neither can be missing.
[0005] On this basis, another more hidden security vulnerability lies in the misunderstanding of differential relationships. Even if an algorithm can ensure that the dependence relationships between the key, plaintext, and ciphertext become quite complex, it cannot guarantee that the dependence relationships between the differential plaintext, differential ciphertext, and key are also complex. In differential attacks, the attacker is interested in the relationships between these "differential quantities". If the algorithm is not designed properly, the key may be "canceled out" during the differential process, causing the differential ciphertext to degenerate into a function that is only related to the differential plaintext, thereby greatly simplifying the decryption process. SUMMARY
[0006] In response to the multiple challenges mentioned above regarding reliability, bidirectional sensitivity, and resistance to advanced differential attacks, the purpose of this invention is to deeply integrate digital domain chaos theory with modern cryptographic design concepts, aiming to propose a novel image encryption method with a more secure structure and more reliable implementation.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] An image encryption method based on a digital domain chaotic system includes the following steps: S1, generating initial values and a random control sequence for a three-dimensional digital domain chaotic system based on an initial image; S2, substituting the initial values and the random control sequence into the three-dimensional digital domain chaotic system 3DDCS to generate a key stream; S3, encrypting the initial image based on the key stream to obtain a ciphertext image.
[0009] Step S1 includes the following steps: S11, separating the R channel, B channel, and G channel from the initial image; S12, giving a seed value. Use Mason rotation mode to generate three lines of length. 8-digit random control sequence S13 Initial values are obtained through cyclic displacement calculation. ;
[0010] Step S2 includes the following steps: setting the initial value With random control sequence The three-dimensional digital domain chaotic system 3DDCS was input together and iterated to obtain three lines of length. chaotic sequence ,at this time, This is the diffusion key. Record it. The index will The elements in the array are arranged in ascending order, and the rearranged index is the pixel-level scrambling key. Through the analysis of By performing a modulo-8 operation on each element in the array, the bit-level scrambling key can be obtained. .
[0011] Furthermore, the cyclic displacement formula in step S13 is formula (1).
[0012] (1)
[0013] in, Indicates a leftward circular shift of binary bits. Bit.
[0014] Furthermore, the logical expression of the iterative function of the three-dimensional digital domain chaotic system 3DDCS described in step S2 is formula (2).
[0015] (2)
[0016] After introducing the random control sequence, a three-dimensional digital domain chaotic system is established as a controlled iterative model, and its state transition graph is a strongly connected network graph, and a general form of the iterative equation is obtained as formula (3)
[0017] (3)
[0018] The initial value of the formula is , and the final output is a chaotic sequence .
[0019] Further, the step S3 comprises the following steps: S31, pixel-level scrambling, obtaining a scrambling matrix 1; S32, diffusion 1, diffusing the scrambling matrix 1 into a diffusion matrix 1; S33, pixel-level scrambling is performed on the diffusion matrix 1, and a scrambling matrix 2 is obtained; S34, diffusion 2, diffusing the scrambling matrix 2 into a diffusion matrix 2; S35, performing bit-level scrambling on the diffusion matrix 2 to obtain a scrambling matrix 3; S36, repeating steps S31, S32, S33, S34, S35; S37, after all scrambling and diffusion steps are performed, the ciphertext vector Cvec is reorganized into a matrix, that is, the final output ciphertext C.
[0020] Further, the pixel-level scrambling comprises the following steps:
[0021] S381, the plaintext P is expanded into a one-dimensional vector Pvec by column, the plaintext P is a matrix of M rows and N columns, and the elements are pixel values; the pixel-level scrambling key S is a sequence with a length of MxN, which is used for scrambling operation, wherein S in step S31 is S1, and S in step S33 is S2;
[0022] S382, scrambling operation:
[0023] If M=1 (that is, the plaintext has only one row): directly assign P to Pvec;
[0024] If M>1 (that is, the plaintext has multiple rows): initialize an empty vector Pvec with a length of MxN;
[0025] Traverse each column (column index i from 1 to N):
[0026] In each column, traverse each row (row index j from 1 to M):
[0027] Calculate the vector position k=(j-1) x M+i;
[0028] Assign the matrix element P(i,j) to the k-th position of the vector Pvec, that is...
[0029] Pvec[k]←P(i,j);
[0030] S383. Perform pixel-level scrambling on the vector, i.e., rearrange the vector Pvec using the scrambling key S, traversing each position of the vector (index i from 1 to M×N): perform the operation.
[0031] P P ←Pvec(S(i)) yields the scrambled plaintext P P .
[0032] Furthermore, the diffusion methods of diffusion 1 and diffusion 2 are as shown in formula (4):
[0033] (4)
[0034] in, Indicates bitwise XOR, This represents modulo 256. In step S32, the diffusion key is K1, and in step S34, the diffusion key is K2. During the diffusion process, items exceeding the index are all set to 0.
[0035] Furthermore, the bit-level scrambling includes the following steps: using the value at the corresponding position of the bit-scrambling key S3 as the cyclic displacement distance, and performing bit-level scrambling on the binary representation of each pixel pair in the image sequence according to the cyclic displacement rule to obtain the ciphertext vector Cvec.
[0036] Furthermore, the reorganization includes the following steps: Initializing a two-dimensional matrix: creating an empty matrix C of size M height N width;
[0037] Fill the matrix by column:
[0038] The elements of a one-dimensional vector are filled into a two-dimensional matrix column by column using a double loop:
[0039] Outer loop: Iterate through column index i (from 1 to N)
[0040] Inner loop: Iterate through row index j (from 1 to M)
[0041] Calculate vector index:
[0042] For the current element position (i,j) (row j, column i), calculate the corresponding index in the one-dimensional vector: index = (j-1) × M + i
[0043] Assignment operation:
[0044] Fill the element of the index position in the ciphertext vector Cvec into the matrix: C(i,j)←Cvec(index)
[0045] Return result:
[0046] Return the completely filled two-dimensional ciphertext matrix C.
[0047] Further, the decryption method is also included, which is the inverse operation of the image encryption method based on the digital domain chaotic system.
[0048] The beneficial effects of the present application are:
[0049] ①A digital domain chaotic system with more complex and more difficult to predict dynamic characteristics is constructed, and a random bit update mechanism is introduced by combining the pseudo-random control sequence generated by the Mason rotation algorithm, so that efficient chaotic sequence generation is realized.
[0050] ②In the design of the diffusion equation, the plaintext, ciphertext, key and time delay term are coupled together in the form of heterogeneous operation, forming a complex mixed operation, which effectively enhances the diffusion effect. In the ideal channel, this diffusion rule which is sensitive to both ciphertext and plaintext can resist various attacks.
[0051] ③By introducing bit-level scrambling, the scrambling link is more complex and can resist chain attacks. BRIEF DESCRIPTION OF DRAWINGS
[0052] Figure 1 : flow chart of the image encryption method based on the digital domain chaotic system;
[0053] Figure 2 : is the comparison chart of the plaintext image and the corresponding ciphertext image in the embodiment; DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0055] An image encryption method based on a digital domain chaotic system, as shown in Figure 1 includes the following steps: S1, generating initial values of a three-dimensional digital domain chaotic system and a random control sequence based on an initial image;
[0056] Specifically, S11, set the length and width of the initial image as M and N respectively, and separate the initial image into R channel, B channel and G channel; S12, give a seed value , and input into the Mason rotation generator in python, respectively, to generate three 8-bit random control sequences ; ; S13, The initial value is calculated by the cyclic shift formula (1) ;
[0057] (1)
[0058] Wherein, represents the left cyclic shift of binary bits .
[0059] S2, the initial value and the random control sequence are substituted into the three-dimensional digital domain chaotic system 3DDCS to generate a key stream;
[0060] Specifically, the initial value and the random control sequence are input into the three-dimensional digital domain chaotic system 3DDCS iteration to obtain three chaotic sequences with a length of ;
[0061] The three-dimensional digital domain chaotic system 3DDCS iteration function logical expression is formula (2)
[0062] (2)
[0063] After introducing the random control sequence, the three-dimensional digital domain chaotic system is established as a controlled iteration model, and its state transition diagram is a strongly connected network graph, and the general form of the iteration equation is formula (3)
[0064] (3)
[0065] The initial value of the formula is , and the final output is the chaotic sequence .
[0066] At this time, is the diffusion key. Record the index of , arrange the elements in in ascending order, and the rearranged index is the pixel-level permutation key . By performing 8 modulo operation on each element in , the bit-level permutation key is obtained.
[0067] S3, encrypt the initial image based on the key stream to obtain a ciphertext image;
[0068] Specifically,
[0069] S31, pixel-level scrambling, obtaining a scrambling matrix 1;
[0070] S32, diffusion 1, diffusing the scrambling matrix 1 into a diffusion matrix 1;
[0071] S33, pixel-level scrambling of the diffusion matrix 1, obtaining a scrambling matrix 2;
[0072] S34, diffusion 2, diffusing the scrambling matrix 2 into a diffusion matrix 2;
[0073] S35, bit-level scrambling of the diffusion matrix 2, obtaining a scrambling matrix 3;
[0074] S36, repeating steps S31, S32, S33, S34, S35;
[0075] S37, after all scrambling and diffusion steps are performed, reorganizing the ciphertext vector Cvec into a matrix, which is the final output ciphertext C.
[0076] In step S3, the pixel-level scrambling includes the following steps:
[0077] S381, expanding the plaintext P into a one-dimensional vector Pvec by column, the plaintext P being an M-row-by-N-column matrix with pixel values as elements; the pixel-level scrambling key S being a sequence with a length of MxN, used for scrambling operation, wherein S in step S31 is S1 and S in step S33 is S2;
[0078] S382, scrambling operation:
[0079] If M=1 (i.e., the plaintext has only one row): directly assigning P to Pvec;
[0080] If M>1 (i.e., the plaintext has multiple rows): initializing an empty vector Pvec with a length of MxN;
[0081] Traversing each column (column index i from 1 to N):
[0082] In each column, traversing each row (row index j from 1 to M):
[0083] Calculating the vector position k=(j-1)xM+i;
[0084] Assigning the matrix element P(i,j) to the kth position of the vector Pvec, i.e.
[0085] Pvec[k]<-P(i,j);
[0086] S383, pixel-level scrambling of the vector, i.e. reordering the vector Pvec using a scrambling key S, iterating over each position (index i from 1 to MxN) of the vector: perform operation
[0087] P P ←Pvec(S(i)), obtaining the scrambled plaintext P P .
[0088] In step S3, the diffusion manner of diffusion 1 and diffusion 2 is shown in formula (4):
[0089] (4)
[0090] where, denotes bitwise XOR, denotes modulo 256. Wherein the diffusion key in step S32 is K1, and the diffusion key in step S34 is K2. The items exceeding the index in the diffusion process are all taken as 0.
[0091] The bit-level scrambling includes the following steps: taking the value of the bit scrambling key S3 corresponding to the position as the cyclic shift distance, performing bit-level scrambling on the binary of each group of pixel pairs in the image sequence according to the cyclic shift rule, and obtaining the ciphertext vector Cvec.
[0092] The reorganization includes the following steps: initializing a two-dimensional matrix: creating an empty matrix C with a size of M high and N wide;
[0093] Filling the matrix by column:
[0094] Filling the one-dimensional vector elements into the two-dimensional matrix by double loop:
[0095] Outer loop: iterating over column index i (from 1 to N)
[0096] Inner loop: iterating over row index j (from 1 to M)
[0097] Calculate the vector index:
[0098] For the current element position (i,j) (jth row, ith column), calculate the corresponding index in the one-dimensional vector: index=(j-1) x M+i
[0099] Assignment operation:
[0100] Fill the element in the ciphertext vector Cvec at the index position into the matrix: C(i,j)←Cvec(index)
[0101] Return result:
[0102] Return the completely filled two-dimensional ciphertext matrix C.
[0103] In this embodiment, the above encryption method is used to encrypt the test images baboon, boat, fruits, peppers, and lake commonly used in the field of image processing, and the resolution of the five images is 512x512. The plaintext and ciphertext of the test image are shown in Figure 2 As can be seen, the image after one round of encryption cannot obtain any information related to the original plaintext from the visual point of view.
[0104] The mainstream academic view believes that when the key space is greater than 2 100 , the encryption algorithm can effectively resist exhaustive attack. In the encryption method, the key mainly consists of two parts: the iteration initial value of 3DDCS and the seed of the mersenne rotation. Among them, the iteration initial value is three 8-bit unsigned integers; the seed is three 32-bit unsigned integers. Therefore, the key space size of the algorithm is 2 8×3+32×3 =2 120 >2 100 . Therefore, the algorithm can effectively resist exhaustive attack.
[0105] The encryption method completely destroys the internal correlation of image data at the bit level through bit-level deep scrambling; then, a diffusion mechanism closely coupled with the plaintext, the key, the ciphertext and their time delay is implemented to achieve a highly nonlinear mixing effect. The core of the encryption method is to construct and utilize a strongly connected driven digital domain chaotic system running in a finite integer domain. Not only does it fundamentally avoid the limited precision effect of traditional floating-point operations, ensuring the realizability and determinacy of the cryptographic system, but its excellent chaotic characteristics also directly drive the design and implementation of the two core links of confusion and diffusion in the encryption algorithm. The method has a large key space to resist exhaustive attack, the encrypted image presents ideal pseudo-random characteristics, and can effectively resist differential attack, and the encryption method has security and robustness.
[0106] Decryption method:
[0107] Input the ciphertext image C into the decryption algorithm to obtain the plaintext image P; the decryption algorithm is the inverse operation of the image encryption method based on the digital domain chaotic system.
[0108] Specifically, the inverse pixel scrambling algorithm
[0109] Input: ciphertext C, ciphertext height M, ciphertext width N, scrambling sequence S
[0110] Output: inverse scrambled ciphertext C p
[0111] 01: / / first step: expand the ciphertext C into a vector by column
[0112] 02: if M=1 do
[0113] 03:
[0114] 04: end if
[0115] 05: if M>1 do
[0116] 06: for i=1 to N
[0117] 07: for j=1 to M
[0118] 08:
[0119] 09: end for
[0120] 10: end for
[0121] 11: end if
[0122] 12: / / second step: perform inverse permutation operation
[0123] 13: for i=1 to MxN
[0124] 14:
[0125] 15: end for
[0126] 16: return C p
[0127] The inverse diffusion equation is shown in equation (5).
[0128] (5)
[0129] After performing three inverse permutations and two inverse diffusions, the decrypted plaintext sequence is reorganized into a matrix according to the aforementioned reorganization step, which is the decrypted plaintext.
[0130] Finally, it should be noted that the above only describes the preferred embodiments of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features, as long as they are within the spirit and principles of the present application. Any modification, equivalent replacement, improvement, etc. made within the scope of the present application should be included in the protection scope of the present application.
Claims
1. An image encryption method based on a digital domain chaotic system, characterized in that, The method comprises the following steps: S1, generating initial values and a random control sequence of a three-dimensional digital domain chaos system based on an initial image; S2, substituting the initial values and the random control sequence into the three-dimensional digital domain chaos system 3DDCS to generate a key stream; S3, encrypting the initial image based on the key stream to obtain a ciphertext image; The step S1 comprises the following steps: S11, separating the initial image into R channel, B channel and G channel; S12, giving seed value , generating three 8-bit random control sequences with length of by using Mason rotation mode ; S13, , obtaining initial value by cyclic shift calculation ; The step S2 comprises the following steps: inputting initial values and a random control sequence into a three-dimensional digital domain chaotic system 3DDCS iteration to obtain three chaotic sequences with a length of , wherein is a diffusion key, the index of is recorded, the elements in are arranged in ascending order, the index after rearrangement is a pixel-level permutation key , and the bit-level permutation key is obtained by performing a modulo operation of 8 on each element in .
2. The method of claim 1, wherein, The cyclic shift formula in step S13 is formula (1) (1) wherein represents a binary bit shifted left by one bit bits.
3. The method of claim 1, wherein, The three-dimensional digital domain chaos system 3DDCS iteration function logical expression in step S2 is formula (2) (2) After the random control sequence is introduced, a three-dimensional digital domain chaos system is established as a controlled iteration model, and the state transition diagram thereof is a strongly connected network diagram, and a general form of an iteration equation is formula (3) (3) The initial value of the formula is The final output is a chaotic sequence .
4. The method of claim 1, wherein, The step S3 comprises the following steps: S31, pixel-level scrambling to obtain a scrambling matrix 1; S32, diffusion 1, diffusing the scrambling matrix 1 into a diffusion matrix 1; S33, performing pixel-level scrambling on the diffusion matrix 1 to obtain a scrambling matrix 2; S34, diffusion 2, diffusing the scrambling matrix 2 into a diffusion matrix 2; S35, performing bit-level scrambling on the diffusion matrix 2 to obtain a scrambling matrix 3; S36, repeating steps S31, S32, S33, S34 and S35; and S37, after all scrambling links and diffusion links are executed, reorganizing the ciphertext vector Cvec into a matrix to obtain the final output ciphertext C.
5. The method of claim 4, wherein, The pixel-level scrambling comprises the following steps: S381, expanding the plaintext P into a one-dimensional vector Pvec by column, the plaintext P being a matrix with M rows and N columns and the elements being pixel values; the pixel-level scrambling key S being a sequence with a length of M*N, used for scrambling operation, wherein S in step S31 is S1, and S in step S33 is S2; S382, scrambling operation: If M=1 (i.e., the plaintext has only one row): directly assigning P to Pvec; If M>1 (i.e., the plaintext has multiple rows): initializing an empty vector Pvec with a length of M*N; Traversing each column (column index i from 1 to N): In each column, traversing each row (row index j from 1 to M): Calculating the vector position k=(j-1)×M+i; Assigning the matrix element P(i,j) to the kth position of the vector Pvec, i.e. Pvec[k]←P(i,j); S383, performing pixel-level scrambling on the vector, i.e., rearranging the vector Pvec using the scrambling key S, and traversing each position (index i from 1 to M*N) of the vector: performing the operation P P ← Pvec(S(i)), get the scrambled plaintext P P .
6. The method of claim 4, wherein, The diffusion modes of the diffusion 1 and the diffusion 2 are shown in formula (4): (4) wherein, denotes bitwise XOR, denotes modulo 256, wherein the diffusion key in step S32 is K1 and the diffusion key in step S34 is K2, and the items beyond the index in the diffusion process are taken as 0.
7. The method of claim 4, wherein, The bit-level scrambling comprises the following steps: taking the value of the corresponding position of the bit scrambling key S3 as a cyclic shift distance, performing bit-level scrambling on binary of each group of pixel pairs of the image sequence according to the cyclic shift rule, and obtaining the ciphertext vector Cvec.
8. The method of claim 4, wherein, The reorganization comprises the following steps: initializing a two-dimensional matrix: creating an empty matrix C with a size of M high and N wide; Filling the matrix by column: Through a double loop, the one-dimensional vector elements are filled into the two-dimensional matrix by column: Outer loop: traversing column index i (from 1 to N) Inner loop: iterate over row index j (from 1 to M) Compute vector index: For the current element position (i,j) (j-th row, i-th column), compute the corresponding index in the one-dimensional vector: index = (j-1) x M + i Assignment operation: Fill the element at this index position in the ciphertext vector Cvec into the matrix: C(i,j) <- Cvec(index) Return result: Return the fully filled two-dimensional ciphertext matrix C.
9. The method of claim 1, wherein, Also included is a decryption method, which is the inverse operation of the image encryption method based on a digital domain chaotic system.