An adaptive image scrambling encryption method based on chaotic mapping
By using two-dimensional chaotic mapping and adaptive chaos technology in the image encryption method, combined with SHA-512 function to update the key, the security problem of the existing image encryption method is solved, and higher encryption security and key space are achieved. .
Patent Information
- Application Number
- CN202310142129.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-02-21
AI Technical Summary
The existing image encryption methods have security problems when using chaotic systems, including initial parameter inference and chaotic degradation, and the structure is not related to the original image information and are easily cracked.
Adaptive image chaotic encryption method based on two-dimensional chaos mapping is adopted, and the two-dimensional chaotic mapping of continuous chaotic intervals and complex chaotic expressions is used, combined with the SHA-512 function to update the key, and the image adaptive selection chaotic and mutual diffusion technology is introduced. Enhance the security of encryption methods.
It effectively prevents the degradation of chaotic mapping in encryption applications, increases the key space, improves the ability to resist brute-force attacks, enhances the security of encryption methods and key dependence, and improves the correlation between plaintext and encryption structure.
Smart Images

Figure CN116170545B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of network security, and in particular to an image adaptive scrambling encryption method based on chaos mapping. Background Art
[0002] With the rise of cloud computing technology and the advent of the big data era, the security of private data has attracted widespread attention. In the past, people usually used text to record and transmit private data. Therefore, in order to protect the security of text privacy data, some classic encryption schemes have been proposed, such as DES and AES. However, in the big data era, it is becoming more and more common for people to record and transmit private data through images. However, due to the characteristics of images such as large data capacity and strong correlation between pixels, the classic text encryption scheme is not suitable for protecting the security of private data in images. Therefore, new image encryption methods need to be proposed.
[0003] Chaos, as a unique form of nonlinear dynamic system, has unique internal randomness, initial sensitivity and unpredictability, so it is very suitable for application in the field of image encryption. Although image encryption methods based on chaotic systems show good universality, existing methods still have some possible security issues. These security issues mainly come from two aspects: chaotic systems and method structures. First, some simple chaotic systems have unique chaotic trajectories and discrete chaotic intervals, so attackers may use some techniques to infer the initial parameters of the system, thereby affecting the security of the encryption method. In addition, when these chaotic systems are applied to image encryption, due to their discrete chaotic intervals, chaotic degradation may occur in image encryption applications, causing the encryption method to become no longer secure; secondly, the structure of some image encryption methods is not associated with the original image information, so hackers may crack the encryption method through related technologies such as chosen plaintext attacks.
[0004] Therefore, in view of the shortcomings of some existing image encryption methods, studying a more secure image encryption method has become a problem that needs to be solved. Summary of the invention
[0005] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art and propose an image adaptive scrambling encryption method based on two-dimensional chaotic mapping. The two-dimensional chaotic mapping with continuous chaotic intervals and complex chaotic performance is used to effectively prevent the problem of chaotic mapping degradation in encryption applications. At the same time, the two-dimensional chaotic mapping effectively increases the key space of the encryption method and improves the method's ability to resist brute force attacks.
[0006] The present invention adopts the following technical solution:
[0007] An image adaptive scrambling encryption method based on chaotic mapping, comprising:
[0008] Step S1, input an original grayscale image I of size M×N;
[0009] Step S2, key update: based on the pixel information contained in the original grayscale image I, a hash value hash is generated using the SHA-512 function; then the updated keys x1, y1, a1, b1 are obtained using the initial keys x0, y0, a0, b0 and the hash value hash;
[0010] Step S3, generation of related chaotic sequences and chaotic matrices: using the updated keys x1, y1, a1, b1 to substitute into the chaotic map, obtaining two chaotic sequences A1 and A2, performing multiple different processing on the generated two chaotic sequences A1 and A2, obtaining chaotic sequences A11, A22, A3, A4, A5, W1, W2 and chaotic matrices S1, S2;
[0011] Step S4, image interactive diffusion: decompose each pixel in the original grayscale image I according to hexadecimal to obtain two image matrices P1 and P2; based on the obtained chaotic matrices S1 and S2, perform interactive diffusion encryption operations on P1 and P2 to obtain two encrypted images CP1 and CP2;
[0012] Step S5, image adaptive selection scrambling: based on chaotic sequences A11, A22, A3, A4, A5; firstly, using chaotic sequences A11, A22, A3, A4 in combination with image CP2 to randomly scramble the rows / columns of image CP1 to obtain scrambled image CP11; then, using chaotic sequences A11, A22, A3, A5 in combination with image CP11 to randomly scramble the rows / columns of image CP2 to obtain scrambled image CP22; finally, recombining CP11 and CP22 to obtain an encrypted image C;
[0013] Step S6, image bidirectional successive diffusion: based on the chaotic sequence W1, the encrypted image C is successively diffused in the forward direction to obtain the diffusion array B; then, based on the chaotic sequence W2, the diffusion array B is successively diffused in the reverse direction to obtain the final encrypted image ENC.
[0014] Specifically, the specific method for updating the key in step S2 is: using SHA-512 to encrypt the original grayscale image pixel information to obtain a 512-bit hash value hash, and then dividing the hash into 128 bytes and expressing it as: k1, k2, k3, ..., k 128 , and finally combined with the initial key to obtain the updated key:
[0015]
[0016] Among them, mean{k1, k2} means finding the average value of k1 and k2, sum{k1, k2} means finding the sum of k1 and k2, and mod means the modulo operation.
[0017] Specifically, in step S3, the updated keys x1, y1, a1, and b1 are substituted into the chaotic map to obtain two chaotic sequences A1 and A2. The basic mathematical expression is:
[0018]
[0019] Among them, β=10 is the adjustment parameter of the chaotic mapping, a∈[0,1] and b∈[0,1] are the parameters of the system, and x n and n Indicates the nth iteration value.
[0020] Specifically, in step S3, the two generated chaotic sequences A1 and A2 are processed several times in different ways to obtain chaotic sequences A11, A22, A3, A4, A5, W1, W2 and chaotic matrices S1, S2, and the method of obtaining them is as follows: first, the update keys x1, y1, a1, b1 are substituted into the chaotic map, the map is iterated 1000+M+2N+MN times, and then the first 1000 items are discarded to obtain the two chaotic sequences A1 and A2;
[0021]
[0022] Then after different processing, the chaotic sequence and chaotic matrix are obtained:
[0023]
[0024] Among them, A1(1:MN) means taking all elements between the first element to the MNth element in A1, floor means the floor rounding function, reshape(A, [M, N]) means reconstructing A into an M×N array, [~, X]=sort(K) means sorting the elements in K in ascending order, and the return value X is an index sequence, which represents the position index of the sorted elements in K.
[0025] Specifically, the method of image interactive diffusion encryption described in step S4 is: first, use images P1, P2 and chaotic matrix S2 to perform modular operation to obtain encrypted image CP2, then perform XOR operation on each pixel of image CP2 and each pixel of image P2 to obtain intermediate encrypted image NP, and finally use intermediate encrypted image NP, encrypted image CP2 and chaotic matrix S1 to perform modular operation encryption to obtain encrypted image CP1, the formula is as follows:
[0026]
[0027] Where bitxor means bitwise exclusive OR.
[0028] Specifically, the method for adaptively selecting scrambling of the image described in step S5 is: firstly scramble the CP1 image, wherein the chaotic sequence A3 is used to select the scrambling mode and position, and when the value of A3 is greater than M, the column scrambling is selected, and the rest are selected for row scrambling; then the selected row or column is cyclically shifted, wherein the chaotic sequences A5, A11, A22 and the image CP2 are used to determine the number of bits of each shift, and the specific formula is as follows:
[0029]
[0030] Finally, the scrambling is completed to obtain the image CP11; wherein A3(i) represents the i-th element in A3, circshift(A, K) represents cyclically shifting the elements in A by K positions, CP1(A3(i),:) represents taking the A3(i)-th row element of CP1, and CP1(:, j) represents taking the j-th column element of CP1; then, the image CP2 is adaptively scrambled in a similar way, at this time the chaotic sequence A4 is used to select the scrambling mode and position, the chaotic sequences A5, A11, A22 and the image CP11 are used to determine the number of bits of each shift, and the specific formula is as follows:
[0031]
[0032] Finally, the scrambling is completed and the image CP22 is obtained. Finally, the images CP11 and CP22 are recombined to obtain the final encrypted image C;
[0033] C=CP11×1+CP22.
[0034] Specifically, the method of bidirectional sequential diffusion of the image described in step S6 is: converting the image C into a one-dimensional array C1, performing modular operations on the elements in the array C1 and the chaotic sequence W1 in sequence to obtain an intermediate array B, and then performing modular operations on the elements in the chaotic sequence W2 and the intermediate array B in reverse order to obtain a final encrypted array C2, and finally converting the array C2 into an M×N final encrypted image ENC. The specific formula is as follows:
[0035]
[0036]
[0037] ENC=reshape(C2,[M,N]).
[0038] It can be seen from the above description of the present invention that, compared with the prior art, the present invention has the following beneficial effects:
[0039] 1. The present invention utilizes a two-dimensional chaotic map with continuous chaotic intervals and complex chaotic performance, which effectively prevents the problem of chaotic mapping degradation in encryption applications; at the same time, the two-dimensional chaotic map effectively increases the key space of the encryption method and improves the method's ability to resist brute force attacks.
[0040] 2. The present invention introduces the SHA-512 function to encrypt plaintext information to update the initial key, thereby enhancing the dependence of the encryption method's key on the original image, so that the encryption method can effectively resist related cryptanalysis methods such as chosen plaintext attacks.
[0041] 3. The present invention improves the correlation between the plaintext and the encryption structure in the overall encryption method by introducing methods such as image adaptive selective scrambling and mutual diffusion into the encryption method structure, so that the encryption method has an ideal encryption effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 The invention discloses an encryption flow chart of an image adaptive scrambling encryption method based on chaotic mapping.
[0043] Figure 2 is the original image used in the specific embodiment of the present invention
[0044] Figure 3 It is the encrypted image obtained in the specific embodiment of the present invention.
[0045] Figure 4 It is the decrypted image obtained in the specific embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0047] The encryption method flow chart of the present invention is as follows Figure 1 As shown. You can combine the encryption steps described below, refer to Figure 1 Understand the specific process of the present invention.
[0048] Step S1: Input a grayscale image I of size M×N, such as Figure 2 As shown;
[0049] Step S2, key update: based on the pixel information contained in the original grayscale image I, use the SHA-512 function to generate a hash value hash; then use the initial key x0, y0, a0, b0 and the hash value hash to obtain the updated key x1, y1, a1, b1;
[0050] Step S3, generation of related chaotic sequences and chaotic matrices: using the keys x1, y1, a1, b1 in step S2 to substitute into the chaotic map, obtaining two chaotic sequences A1 and A2, performing multiple different processing on the two generated sequences, obtaining chaotic sequences A11, A22, A3, A4, A5, W1, W2 and chaotic matrices S1, S2;
[0051] Step S4, image interactive diffusion: decompose each pixel in the original image I according to hexadecimal to obtain two image matrices P1 and P2; based on the chaotic matrices S1 and S2 obtained in step S3, perform interactive diffusion encryption operation on P1 and P2 to obtain two encrypted images CP1 and CP2;
[0052] Step S5, image adaptive selection scrambling: based on the chaotic sequence A11, A22, A3, A4, A5 obtained in step S3; first use the chaotic sequence A11, A22, A3, A4 combined with image CP2 to randomly scramble the rows (columns) of image CP1 to obtain a scrambled image CP11; then use the chaotic sequence A11, A22, A3, A5 combined with image CP11 to randomly scramble the rows (columns) of image CP2 to obtain a scrambled image CP22; finally, recombine CP11 and CP22 to obtain an encrypted image C.
[0053] Step S6, image bidirectional sequential diffusion: Use the chaotic sequence W1 in step S3 to perform forward sequential diffusion on image C to obtain a diffusion array B; then, use the chaotic sequence W2 in step S3 to perform reverse sequential diffusion on diffusion array B to obtain the final encrypted image ENC.
[0054] The specific method of updating the key in step S2 is: encrypt the original image pixel information using SHA-512 to obtain a 512-bit hash value hash, and then divide the hash into 128 bytes and represent it as: k1, k2, k3, ..., k 128 , and finally combined with the initial key to obtain the updated key:
[0055]
[0056] Among them, mean*k1, k2} means finding the average value of k1 and k2, sum{k1, k2} means finding the sum of k1 and k2, and mod means the modulo operation.
[0057] The chaotic map used in step S3 is a discrete two-dimensional chaotic map, and its basic mathematical expression is:
[0058]
[0059] Among them, β=10 is the adjustment parameter of the chaotic mapping, a∈[0,1] and b∈[0,1] are the parameters of the system, and x n and n Indicates the nth iteration value.
[0060] The method for generating multiple chaotic sequences and chaotic matrices in step S3 is: first substitute the update keys x1, y1, a1, b1 into the chaotic map described in claim 3, iterate this mapping 1000+M+2N+MN times, and then discard the first 1000 items to obtain two chaotic sequences A1 and A2.
[0061]
[0062] Then after different processing, the chaotic sequence and chaotic matrix are obtained:
[0063]
[0064]
[0065] Among them, A1(1:MN) means taking all elements from the first element to the MNth element in A1, floor means floor rounding function, reshape(A, [M, N]) means reconstructing A into an M×N array, [~, X]=sort(K) means sorting the elements in K in ascending order, and the return value X is an index sequence, which indicates the position index of the sorted elements in K. .
[0066] The method of image mutual diffusion encryption described in step S4 is: first, use images P1, P2 and chaotic matrix S2 to perform modular operation to obtain encrypted image CP2, then perform XOR operation on each pixel of image CP2 and each pixel of image P2 to obtain intermediate encrypted image NP, and finally use intermediate encrypted image NP, encrypted image CP2 and chaotic matrix S1 to perform modular operation encryption to obtain encrypted image CP1. The relevant pseudo code is as follows:
[0067]
[0068] Where bitxor means bitwise exclusive OR.
[0069] The method for adaptively selecting scrambling of the image described in step S5 is: firstly scrambling the CP1 image, wherein the chaotic sequence A3 is used to select the scrambling mode (row scrambling or column scrambling) and position (row or column number), and when the value of A3 is greater than M, column scrambling is selected, and the rest are selected row scrambling; then a cyclic shift operation is performed on the selected row or column, wherein the chaotic sequences A5, A11, A22 and the image CP2 are used to determine the number of bits shifted each time, and the scrambling method is expressed in pseudo code as follows:
[0070]
[0071] Finally, the scrambling is completed and the image CP11 is obtained. A3(i) represents the i-th element in A3, circshift(A, K) represents cyclically shifting the elements in A by K positions, CP1(A3(i),:) represents taking the A3(i)-th row element of CP1, and CP1(:, j) represents taking the j-th column element of CP1. Then, the image CP2 is adaptively scrambled in a similar way. At this time, the chaotic sequence A4 is used to select the scrambling mode and position, and the chaotic sequences A5, A11, A22 and the image CP11 are used to determine the number of bits for each shift. The relevant pseudo code is expressed as follows:
[0072]
[0073] Finally, the scrambling is completed and the image CP22 is obtained. Finally, the images CP11 and CP22 are recombined to obtain the final encrypted image C.
[0074] C=CP11×16+CP22
[0075] The method for bidirectional sequential diffusion of the image described in step S6 is: converting the image C into a one-dimensional array C1, performing modular operations on the elements in the array C1 and the chaotic sequence W1 in sequence to obtain an intermediate array B, and then performing modular operations on the elements in the chaotic sequence W2 and the intermediate array B in reverse order to obtain a final encrypted array C2, and finally converting the array C2 into an M×N final encrypted image ENC, such as Figure 3 Shown:
[0076]
[0077]
[0078] Since the encryption method described in the present invention is a symmetric encryption method, the decryption step is the inverse operation of the encryption step, so the decryption method will not be described in detail. Figure 3 The final decryption result of the encrypted image is shown as Figure 4 shown.
[0079] In the exemplary implementation of the present invention, a common landscape photo with a size of 1280×1704 is used as the original image to be encrypted, and the initial key is set to x0=0.5, y0=0.5, a0=0.5, and b0=0.5. Figure 2 , Figure 3 and Figure 4 They are respectively the original image, the encrypted image and the decrypted image of the example of the present invention, from which it can be seen that the present invention has an ideal encryption effect.
[0080] The present invention utilizes a two-dimensional chaotic map with continuous chaotic intervals and complex chaotic performance, effectively preventing the problem of chaotic mapping degradation in encryption applications; at the same time, the two-dimensional chaotic map effectively increases the key space of the encryption method and improves the method's ability to resist brute force attacks.
[0081] The present invention introduces the SHA-512 function to encrypt plaintext information to update the initial key, thereby enhancing the dependence of the key of the encryption method on the original image, so that the encryption method can effectively resist related cryptanalysis methods such as chosen plaintext attacks.
[0082] The present invention improves the correlation between plaintext and encryption structure in the overall encryption method by introducing methods such as image adaptive selection scrambling and mutual diffusion into the encryption method structure, so that the encryption method has an ideal encryption effect.
[0083] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.
Claims
1. An image adaptive scrambling encryption method based on chaotic mapping, characterized in that: include: Step S1, input an original grayscale image I of size M×N; Step S2, key update: based on the pixel information contained in the original grayscale image I, a hash value hash is generated using the SHA-512 function; then the updated keys x1, y1, a1, b1 are obtained using the initial keys x0, y0, a0, b0 and the hash value hash; Step S3, generation of related chaotic sequences and chaotic matrices: using the updated keys x1, y1, a1, b1 to substitute into the chaotic map, obtaining two chaotic sequences A1 and A2, performing multiple different processing on the generated two chaotic sequences A1 and A2, obtaining chaotic sequences A11, A22, A3, A4, A5, W1, W2 and chaotic matrices S1, S2; Step S4, image interactive diffusion: decompose each pixel in the original grayscale image I according to hexadecimal to obtain two image matrices P1 and P2; based on the obtained chaotic matrices S1 and S2, perform interactive diffusion encryption operations on P1 and P2 to obtain two encrypted images CP1 and CP2; Step S5, image adaptive selection scrambling: based on chaotic sequences A11, A22, A3, A4, A5; first use chaotic sequences A11, A22, A3, A4 combined with image CP2 to randomly scramble the rows / columns of image CP1 to obtain a scrambled image CP1 1; then use chaotic sequences A11, A22, A3, A5 combined with image CP1 1 to randomly scramble the rows / columns of image CP2 to obtain a scrambled image CP22; finally, recombine CP11 and CP22 to obtain an encrypted image C; Step S6, image bidirectional sequential diffusion: based on the chaotic sequence W1, the encrypted image C is sequentially diffused in the forward direction to obtain the diffusion array B; then, based on the chaotic sequence W2, the diffusion array B is sequentially diffused in the reverse direction to obtain the final encrypted image ENC; In step S3, the updated keys x1, y1, a1, and b1 are substituted into the chaotic map to obtain two chaotic sequences A1 and A2. The basic mathematical expression is: Among them, β=10 is the adjustment parameter of the chaotic mapping, a∈[0,1] and b∈[0,1] are the parameters of the system, and x n and n Indicates the nth iteration value; In step S3, the two generated chaotic sequences A1 and A2 are processed several times in different ways to obtain chaotic sequences A11, A22, A3, A4, A5, W1, W2 and chaotic matrices S1 and S2. The specific method of obtaining the chaotic sequences is as follows: first, the update keys x1, y1, a1, b1 are substituted into the chaotic map, the map is iterated 1000+M+2N+MN times, and then the first 1000 items are discarded to obtain the two chaotic sequences A1 and A2. Then after different processing, the chaotic sequence and chaotic matrix are obtained: Among them, A1(1:MN) means taking all elements from the first element to the MNth element in A1, floor means flooring function, reshape(A, [M, N]) means reconstructing A into an M×N array, [~, X]=sort(K) means sorting the elements in K in ascending order, and the return value X is an index sequence, which indicates the position index of the sorted elements in K; The method of image interactive diffusion encryption described in step S4 is: first, use images P1, P2 and chaotic matrix S2 to perform modular operation to obtain encrypted image CP2, then perform XOR operation on each pixel of image CP2 and each pixel of image P2 to obtain intermediate encrypted image NP, and finally use intermediate encrypted image NP, encrypted image CP2 and chaotic matrix S1 to perform modular operation encryption to obtain encrypted image CP1, the formula is as follows: Where bitxor means bitwise exclusive OR; The method for adaptively selecting and scrambling the image described in step S5 is as follows: first, scramble the CP1 image, wherein the chaotic sequence A3 is used to select the scrambling mode and position, and when the value of A3 is greater than M, select column scrambling, and the rest select row scrambling; then perform a cyclic shift operation on the selected row or column, wherein the chaotic sequences A5, A11, A22 and the image CP2 are used to determine the number of bits of each shift, and the specific formula is as follows: Finally, the scrambling is completed to obtain the image CP11; wherein A3(i) represents the i-th element in A3, circshift(A, K) represents cyclically shifting the elements in A by K positions, CP1(A3(i),:) represents taking the A3(i)-th row element of CP1, and CP1(:, j) represents taking the j-th column element of CP1; then, the image CP2 is adaptively scrambled in a similar way, at this time the chaotic sequence A4 is used to select the scrambling mode and position, the chaotic sequences A5, A11, A22 and the image CP11 are used to determine the number of bits of each shift, and the specific formula is as follows: Finally, the scrambling is completed and the image CP22 is obtained. Finally, the images CP11 and CP22 are recombined to obtain the final encrypted image C. C = CP11 × 16 + CP22; The method of bidirectional sequential diffusion of the image described in step S6 is: converting the image C into a one-dimensional array C1, performing modular operations on the elements in the array C1 and the chaotic sequence W1 in sequence to obtain an intermediate array B, and then performing modular operations on the chaotic sequence W2 and the elements in the intermediate array B in reverse order to obtain a final encrypted array C2, and finally converting the array C2 into an M×N final encrypted image ENC. The specific formula is as follows: ENC=reshape(C2,[M,N]).
2. The encryption method according to claim 1, wherein: The specific method of key update in step S2 is: encrypt the original grayscale image pixel information using SHA-512 to obtain a 512-bit hash value hash, and then divide the hash into 128 bytes and represent it as: k1, k2, k3, ..., k 128 , and finally combined with the initial key to obtain the updated key: Among them, mean{k1, k2} means finding the average value of k1 and k2, sum{k1, k2} means finding the sum of k1 and k2, and mod means the modulo operation.
Citation Information
Patent Citations
Image encryption method based on chaotic mapping and bit-level replacement
CN112084517A