A hierarchical image scrambling encryption method based on chaotic mapping
By employing a chaotic mapping-based image layered scrambling encryption method, which utilizes 2D-ICM and 1DCLC for pixel diffusion and layered scrambling, and combines the SHA-256 function to generate the key, the problem of balancing security and efficiency in image encryption is solved, achieving a high-security and high-efficiency encryption effect.
Patent Information
- Application Number
- CN202210904543.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Existing image encryption methods struggle to balance security and execution efficiency, with traditional algorithms exhibiting either low encryption efficiency or insufficient security.
An image hierarchical scrambling encryption method based on chaotic mapping is adopted. 2D-ICM and 1DCLC discrete chaotic mapping are used for pixel diffusion and hierarchical scrambling. The SHA-256 function is combined to generate an initialization key, and encryption is performed through XOR operation.
It improves encryption security and execution efficiency, reduces dependence on device computing power, enhances resistance to plaintext attacks, and balances security performance with execution efficiency.
Smart Images

Figure CN115170380B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to an image layered scrambling encryption method based on chaotic mapping. Background Technology
[0002] With the rapid development of network technology, the forms of modern information exchange and storage have undergone tremendous changes. Because images carry richer and more intuitive information than text, they play a crucial role in modern information exchange and storage. However, images are highly vulnerable to malicious attacks during transmission and storage, leading to the leakage of sensitive information. Therefore, the security of digital images has become a significant issue in the field of information security. Traditional data encryption methods, such as AES and DES algorithms, suffer from drawbacks such as low encryption efficiency when applied to image encryption.
[0003] Because chaotic systems possess strong internal randomness, ergodicity, and nonlinearity, they are well-suited for building highly secure image encryption systems.
[0004] In recent years, researchers have proposed many image encryption algorithms based on bit-plane decomposition. Xu et al. proposed an encryption algorithm based on bit-plane decomposition, which achieved good encryption results but suffered from slow encryption speed. Zhang et al. also proposed an encryption scheme based on bit-plane decomposition, which improved encryption speed compared to Xu et al.'s scheme, but did not achieve ideal security.
[0005] Therefore, how to provide an image hierarchical scrambling encryption method based on chaotic mapping that can achieve both high security and high execution efficiency has become an important issue. Summary of the Invention
[0006] To address the problems existing in the prior art, the purpose of this invention is to provide an image layered scrambling encryption method based on chaotic mapping, which can achieve both high security and high execution efficiency.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A hierarchical scrambling encryption method for images based on chaotic mapping includes the following steps:
[0009] Step 1: Convert the M×N grayscale image into an image matrix P of equal size;
[0010] Step 2: Generation of initial conditions: Use the SHA-256 function in conjunction with the image matrix P to generate a hash value, and then use... With the pre-set initial conditions Calculate the initialization conditions for 2D-ICM and 1DCLC ;
[0011] The 2D-ICM is a two-dimensional discrete chaotic mapping; the 1DCLC is a one-dimensional discrete chaotic mapping.
[0012] Step 3, Pixel Diffusion: Based on the initialization conditions in Step 2, obtain two chaotic sequences Y and Z corresponding to 2D-ICM. After processing, obtain new sequences A1 and A2. Use the A1 sequence combined with the diffusion method to perform pixel diffusion on the image matrix P to obtain the diffused image matrix P1.
[0013] Step 4, Pixel-level scrambling: Based on the initialization conditions in Step 2, obtain the chaotic sequence X corresponding to 1DCLC, and process it to obtain a new sequence A3; divide the image matrix P1 into a high-level image matrix P11 and a low-level image matrix P12, and sort the sequences A3 and A2 in descending order to generate corresponding index sequences b3 and b2 respectively; use the index matrices b3 and b2 to scramble the pixels of the high-level image matrix P11 and the low-level image matrix P12 respectively, and recombine the scrambled high-level image matrix and the low-level image matrix to obtain the layered scrambling image matrix H;
[0014] Step 5, Pixel Diffusion: Based on the chaotic sequences A1, A2 and A3 mentioned above, the image matrix H is diffused to obtain the encrypted image C.
[0015] The mathematical definition of 2D-ICM is:
[0016] ,
[0017] in, and It is the nth iteration value of the system, σ and ρ are the system control parameters, and σ≠0, ρ≠0;
[0018] The mathematical definition of the 1DCLC is:
[0019] ,
[0020] in, It is the value of the nth iteration of the system, and α and β are the system control parameters.
[0021] The specific calculation method for generating the initialization conditions in step two is as follows: A 256-bit hash value is generated using the SHA-256 function combined with the image matrix P. The generated hash value is then divided into groups of four bits, and each group of four bits is converted into a decimal number, resulting in 64 decimal numbers k1, k2, ..., k. 64 Initialization conditions The calculation method is as follows:
[0022]
[0023]
[0024] Where mod is the modulo function and mean is the average function. These are the pre-set initial conditions.
[0025] The sequence generation method in step three is as follows: Initialization conditions... Substitute into 2D-ICM, iterate Next, discard the previous one. The terms yield sequence Y and sequence Z, which, after processing, result in sequences A1 and A2:
[0026]
[0027] Where floor represents the floor function. It is the number of items discarded in the sequence.
[0028] The method for generating the chaotic sequence in step four is as follows:
[0029] Initialization conditions Substitute into 1DCLC and iterate. Next, discard the previous one. Item, to obtain sequence X, after processing to obtain sequence ;
[0030] The image layering method in step four is as follows:
[0031] Since the pixel value range of an 8-bit grayscale image is usually [0, 255], all pixels of the image are decomposed into hexadecimal values, and the entire image can be divided into two planes. The higher plane holds the high four bits of the pixel decomposition, resulting in the higher image matrix P11, and the lower plane holds the low four bits of the pixel decomposition, resulting in the lower image matrix P12.
[0032] The specific method for image scrambling is as follows:
[0033] The high-level image matrix P11 is scrambled according to the index sequence b3 to obtain the intermediate sequence H1, and the low-level image matrix P12 is scrambled according to the index sequence b2 to obtain the intermediate sequence H2. , , The obtained H1 and H2 are recombined and converted into an image matrix to obtain the scrambled image matrix H.
[0034] The diffusion methods in steps three and five both employ bitwise XOR diffusion operations.
[0035] The method for generating the image matrix P1 in step three is as follows:
[0036] ;
[0037] The method for generating the encrypted image matrix C in step five is as follows:
[0038] Construct chaotic sequence B using chaotic sequences A1, A2, and A3: Transform sequence B into a matrix B1 of size M×N, then XOR matrix B1 with image matrix H to obtain encrypted image matrix C:
[0039] .
[0040] The advantages of the present invention are:
[0041] 1. A new one-dimensional discrete chaotic mapping is constructed by combining the traditional Logistic mapping with the cosine function, which improves the chaotic behavior of the mapping and the key space, thereby enhancing the security of encryption.
[0042] 2. By using two low-dimensional discrete chaotic mappings for image encryption, the execution efficiency of the encryption algorithm is improved, and the dependence on the computing power of the algorithm execution device is reduced.
[0043] 3. By using the SHA-256 function in combination with the image matrix to generate a hash value as part of the initialization key, the algorithm's ability to resist chosen-plaintext attacks is improved.
[0044] 4. By using the image layer scrambling method, the safety performance and execution efficiency of the scrambling algorithm are balanced. Attached Figure Description
[0045] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0046] Figure 1 This is a flowchart of an image layered scrambling encryption method based on chaotic mapping according to the present invention.
[0047] Figure 2 This is a schematic diagram of the encryption process of an image layered scrambling encryption method based on chaotic mapping according to the present invention.
[0048] Figure 3 This is a schematic diagram of the overall encryption process of the present invention.
[0049] Figure 4 This invention tests grayscale images.
[0050] Figure 5This is an image showing the encrypted result of the test image of this invention.
[0051] Figure 6 This is the decrypted image tested in this invention. Detailed Implementation
[0052] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that the invention will be thorough and complete, and the concept of the exemplary embodiments will be fully conveyed to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and therefore their detailed description will be omitted.
[0053] The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of the invention. However, those skilled in the art will recognize that the invention can be practiced without one or more of the specific details described, or other methods, components, materials, etc. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring various aspects of the invention.
[0054] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.
[0055] like Figure 1 As shown, this invention discloses an image hierarchical scrambling encryption method based on chaotic mapping, which includes the following steps:
[0056] Step 1: Convert the M×N grayscale image into an image matrix P of equal size;
[0057] Step 2: Generation of initial conditions: Use the SHA-256 function in conjunction with the image matrix P to generate a hash value, and then use... With the pre-set initial conditions Calculate the initialization conditions for 2D-ICM and 1DCLC ;
[0058] Step 3, Pixel Diffusion: Based on the initialization conditions in Step 2, obtain two chaotic sequences Y and Z corresponding to 2D-ICM. After processing, obtain new sequences A1 and A2. Use the A1 sequence combined with the diffusion method to perform pixel diffusion on the image matrix P to obtain the diffused image matrix P1.
[0059] Step 4, Image Layer Scrambling: Based on the initialization conditions in Step 2, obtain the chaotic sequence X corresponding to 1DCLC, and process it to obtain a new sequence A3; divide the image matrix P1 into a high-level image matrix P11 and a low-level image matrix P12, and sort the sequences A3 and A2 in descending order to generate corresponding index sequences b3 and b2 respectively; use the index matrices b3 and b2 to scramble the pixels of the high-level image matrix P11 and the low-level image matrix P12 respectively, and recombine the scrambled high-level image matrix and the low-level image matrix to obtain the layered scrambling image matrix H.
[0060] Step 5, Pixel Diffusion: Based on the chaotic sequences A1, A2 and A3 mentioned above, the image matrix H is diffused to obtain the encrypted image C.
[0061] The 2D-ICM is a two-dimensional discrete chaotic mapping, and its mathematical definition is:
[0062] ,
[0063] in, and It is the nth iteration value of the system, σ and ρ are the system control parameters, and σ≠0, ρ≠0;
[0064] The 1DCLC is a one-dimensional discrete chaotic mapping, and its mathematical definition is:
[0065] ,
[0066] in, It is the value of the nth iteration of the system, and α and β are the system control parameters.
[0067] Based on the above steps, refer to Figure 1 and Figure 2 The detailed implementation steps of the encryption of the present invention are as follows.
[0068] The specific calculation method for the initialization conditions in step two is as follows: A 256-bit hash value is generated using the SHA-256 function combined with the image matrix P. The generated hash value is then divided into groups of four bits, and each group of four bits is converted into a decimal number, resulting in 64 decimal numbers k1, k2, ..., k. 64 Initialization conditions for:
[0069]
[0070]
[0071] Where mod is the modulo function and mean is the average function. These are the pre-set initial conditions.
[0072] The specific method for sequence generation in step three is as follows: Initialization conditions... Substitute into 2D-ICM, iterate Next, discard the previous one. The terms yield sequence Y and sequence Z, which, after processing, result in sequences A1 and A2:
[0073]
[0074] Where floor represents the floor function. It means abandoning the project.
[0075] The specific method for generating the image matrix P1 through diffusion in step three is as follows:
[0076] ;
[0077] The specific method for generating the chaotic sequence in step four is as follows:
[0078] Initialization conditions Substitute into 1DCLC and iterate in the same way. Next, discard the previous one. Item, to obtain sequence X, after processing to obtain sequence ;
[0079] The specific method for image layering in step four is as follows:
[0080] Since the pixel value range of an 8-bit grayscale image is usually [0, 255], all pixels of the image are decomposed into hexadecimal values, and the entire image can be divided into two planes. The higher plane holds the high four bits of the pixel decomposition, resulting in the higher image matrix P11, and the lower plane holds the low four bits of the pixel decomposition, resulting in the lower image matrix P12.
[0081] The specific method for image scrambling in step four is as follows:
[0082] The high-level image matrix P11 is scrambled according to the index sequence b3 to obtain the intermediate sequence H1, and the low-level image matrix P12 is scrambled according to the index sequence b2 to obtain the intermediate sequence H2. , , The obtained H1 and H2 are recombined and converted into an image matrix to obtain the scrambled image matrix H.
[0083] The specific method for generating the encrypted image matrix C in step five is as follows:
[0084] Construct chaotic sequence B using chaotic sequences A1, A2, and A3: ;
[0085] Transform sequence B into a matrix B1 of size M×N, then XOR matrix B1 with image matrix H to obtain encrypted image matrix C:
[0086] .
[0087] To better explain the encryption process of the image hierarchical scrambling encryption method based on chaotic mapping of the present invention, please refer to the detailed steps described above. Figure 3 , Figure 3 This is a schematic diagram of the overall encryption of an image layered scrambling encryption method based on chaotic mapping according to the present invention.
[0088] The decryption method described is the reverse process of the original encryption method, which will not be elaborated further.
[0089] Combine Figures 4 to 6 This invention uses MATLAB 2020b software, sets the initial conditions (x0, y0, z0, α0, β0, σ0, ρ0) = (0.2, 0.2, 0.2, 12, 0.3264, 12, 0.3264), and uses a hash function combined with the hash value generated from the plaintext image and the set initial conditions as the key for simulation experiments. Figure 4 It is the original input image. Figure 5 It is the ciphertext image obtained by encrypting the original image using the aforementioned encryption algorithm. Figure 6 It is the decrypted image obtained by decrypting the ciphertext image using the reverse process of the encryption algorithm.
[0090] The advantages of the present invention are:
[0091] 1. A new one-dimensional discrete chaotic mapping is constructed by combining the traditional Logistic mapping with the cosine function, which improves the chaotic behavior of the mapping and the key space, thereby enhancing the security of encryption.
[0092] 2. By using two low-dimensional discrete chaotic mappings for image encryption, the execution efficiency of the encryption algorithm is improved, and the dependence on the computing power of the algorithm execution device is reduced.
[0093] 3. By using the SHA-256 function in combination with the image matrix to generate a hash value as part of the initialization key, the algorithm's ability to resist chosen-plaintext attacks is improved.
[0094] 4. By using the image layer scrambling method, the safety performance and execution efficiency of the scrambling algorithm are balanced.
[0095] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0096] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.
[0097] A program product for implementing the above-described method according to embodiments of the present invention is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0098] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0099] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0100] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0101] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0102] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0103] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0104] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0105] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
Claims
1. A hierarchical scrambling encryption method for images based on chaotic mapping, characterized in that: Includes the following steps: Step 1: Convert the M×N grayscale image into an image matrix P of equal size; Step 2: Generation of initial conditions: Use the SHA-256 function in conjunction with the image matrix P to generate a hash value, and then use... With the pre-set initial conditions Calculate the initialization conditions for 2D-ICM and 1DCLC ; The 2D-ICM is a two-dimensional discrete chaotic mapping; the 1DCLC is a one-dimensional discrete chaotic mapping. Step 3, Pixel Diffusion: Based on the initialization conditions in Step 2, obtain two chaotic sequences Y and Z corresponding to 2D-ICM. After processing, obtain new sequences A1 and A2. Use the A1 sequence combined with the diffusion method to perform pixel diffusion on the image matrix P to obtain the diffused image matrix P1. Step 4, Pixel-level scrambling: Based on the initialization conditions in Step 2, obtain the chaotic sequence X corresponding to 1DCLC, and process it to obtain a new sequence A3; divide the image matrix P1 into a high-level image matrix P11 and a low-level image matrix P12, and sort the sequences A3 and A2 in descending order to generate corresponding index sequences b3 and b2 respectively; use the index matrices b3 and b2 to scramble the pixels of the high-level image matrix P11 and the low-level image matrix P12 respectively, and recombine the scrambled high-level image matrix and the low-level image matrix to obtain the layered scrambling image matrix H; Step 5, Pixel Diffusion: Based on the chaotic sequences A1, A2 and A3 mentioned above, the image matrix H is diffused to obtain the encrypted image C; The mathematical definition of 2D-ICM is: , in, and It is the nth iteration value of the system, σ and ρ are the system control parameters, and σ≠0, ρ≠0; The mathematical definition of the 1DCLC is: , in, It is the value of the nth iteration of the system, and α and β are the system control parameters.
2. The image hierarchical scrambling encryption method based on chaotic mapping as described in claim 1, characterized in that: The specific calculation method for generating the initialization conditions in step two is as follows: A 256-bit hash value is generated using the SHA-256 function combined with the image matrix P. The generated hash value is then divided into groups of four bits, and each group of four bits is converted into a decimal number, resulting in 64 decimal numbers k1, k2, ..., k. 64 Initialization conditions The calculation method is as follows: Where mod is the modulo function and mean is the average function. These are the pre-set initial conditions.
3. The image hierarchical scrambling encryption method based on chaotic mapping as described in claim 1, characterized in that: The sequence generation method in step three is as follows: Initialization conditions... Substitute into 2D-ICM, iterate Next, discard the previous one. The terms yield sequence Y and sequence Z, which, after processing, result in sequences A1 and A2: Where floor represents the floor function. It is the number of items discarded in the sequence.
4. The image hierarchical scrambling encryption method based on chaotic mapping as described in claim 1, characterized in that: The method for generating the chaotic sequence in step four is as follows: Initialization conditions Substitute into 1DCLC and iterate. Next, discard the previous one. Item, to obtain sequence X, after processing to obtain sequence .
5. The image hierarchical scrambling encryption method based on chaotic mapping as described in claim 1, characterized in that: The image layering method in step four is as follows: Based on the pixel value range of an 8-bit grayscale image [0, 255], all pixels of the image are decomposed into hexadecimal values, and the entire image can be divided into two planes. The higher plane holds the high four bits of the pixel decomposition, resulting in the higher image matrix P11, and the lower plane holds the low four bits of the pixel decomposition, resulting in the lower image matrix P12.
6. The image hierarchical scrambling encryption method based on chaotic mapping as described in claim 1, characterized in that: The specific method for image scrambling is as follows: The high-level image matrix P11 is scrambled according to the index sequence b3 to obtain the intermediate sequence H1, and the low-level image matrix P12 is scrambled according to the index sequence b2 to obtain the intermediate sequence H2. , , The obtained H1 and H2 are recombined and converted into an image matrix to obtain the scrambled image matrix H.
7. The image layered scrambling encryption method based on chaotic mapping as described in claim 1, characterized in that: The diffusion methods in steps three and five both employ bitwise XOR diffusion operations.
8. The image hierarchical scrambling encryption method based on chaotic mapping according to claim 7, characterized in that: The method for generating the image matrix P1 in step three is as follows: 。 9. The image hierarchical scrambling encryption method based on chaotic mapping according to claim 7, characterized in that: The method for generating the encrypted image matrix C in step five is as follows: Construct chaotic sequence B using chaotic sequences A1, A2, and A3: ; Transform sequence B into a matrix B1 of size M×N, then XOR matrix B1 with image matrix H to obtain encrypted image matrix C: 。