Image encryption method based on chaotic mapping and globally arranged generalized knight tour

CN122994431APending Publication Date: 2026-10-27NAVAL UNIV OF ENG PLA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511803110.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0020]相较于现有技术,本发明的有益效果在于:本发明通过将二维Logistic混沌映射与全局排列广义骑士巡游相结合,实现了像素位置置乱与像素值扩散的双重加密机制。其中,混沌映射生成的伪随机序列动态控制骑士巡游路径,克服了传统分块置乱的块效应问题,实现了真正的全局加密;同时,利用另一混沌序列生成的扩散矩阵对置乱后的像素值进行混淆,彻底改变了图像的统计特征。该方案在保证加密安全性的同时,通过优化巡游路径生成算法显著提高了运算效率,能够有效抵抗统计分析和暴力破解等多种攻击手段。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994431A_ABST
    Figure CN122994431A_ABST
Patent Text Reader

Abstract

The application provides an image encryption method based on chaotic mapping and global permutation generalized knight tour, which comprises the following steps: reading in a plaintext image and converting it into a pixel matrix, numbering each pixel point in the pixel matrix in column or row priority order; selecting a key to iterate a chaotic system to obtain a first integer pseudo-random sequence and a second integer pseudo-random sequence; using the first integer pseudo-random sequence, using a global permutation generalized knight tour algorithm to scramble the numbered pixel matrix to obtain a scrambled matrix; converting the second integer pseudo-random sequence into a chaotic matrix, and performing an exclusive or operation on the chaotic matrix and the scrambled matrix to obtain a ciphertext image. The application dynamically controls a tour path through chaotic mapping, combines a double encryption mechanism of scrambling and diffusion, significantly improves security while ensuring operation efficiency, can effectively resist multiple attack methods such as statistical analysis, differential attack and brute force cracking, and provides reliable protection for image data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image encryption technology, and in particular to an image encryption method based on chaotic mapping and global permutation generalized knight's roaming. Background Technology

[0002] In the digital age of rapid information technology evolution, images, as a multimedia carrier with high information density, strong intuitiveness, and high relevance, have been widely used in areas such as internet data transmission, mobile communication terminal interaction, and multimedia system storage and presentation. However, their content security also faces severe challenges. Traditional image encryption methods (such as improved versions of DES and AES algorithms based on symmetric cryptosystems, or simple row and column permutation techniques) are gradually showing significant limitations in dealing with increasingly sophisticated and diverse attack methods (such as differential attacks, statistical attacks, and chosen-plaintext attacks). First, the encryption strength is insufficient. Some methods are difficult to resist high-level attacks due to the small key space or the predictability of the scrambling logic. Secondly, the key management mechanism is complex, and in multi-user, multi-scenario image encryption systems, the key generation, distribution and updating processes are prone to security vulnerabilities. Third, computational efficiency is low. Some encryption algorithms involve complex mathematical transformations or multi-level iterative operations, resulting in significant time delays when processing high-resolution images, making it difficult to meet real-time encryption requirements.

[0003] The Knight's Walk image encryption algorithm (see reference 1) is a core branch of the spatial domain pixel scrambling technology system. On the one hand, this algorithm can significantly improve its resistance to brute-force attacks by generating a massive number of independent walk paths and constructing a large-scale key space. On the other hand, its scrambling path based on "L-shaped steps" has strong randomness and discontinuity, which can effectively break the spatial correlation of original image pixels and weaken the attacker's basis for attacks based on statistical features. Due to these characteristics, the Knight's Walk image encryption algorithm has gained widespread attention in the field of image encryption in recent years, providing an important technical approach to solving the limitations of traditional encryption methods.

[0004] In early research, Hou Qibin et al. (see reference 2) proposed an image scrambling algorithm based on wavelet transform and knight's circumvention, significantly improving the scrambling effect by performing wavelet decomposition on the image and scrambling coefficients according to the circumvention path. Lei Zhongkui's team (see reference 3) made a series of improvements based on this, proposing a scrambling method based on the knight's circumvention-like matrix, a block-level progressive scrambling strategy, and a composite algorithm combined with Arnold transform, effectively expanding the key space and enhancing the scrambling effect. Sun Qiuyan (see reference 4) systematically studied the improvement mechanism of knight's circumvention transform and proposed two scrambling degree evaluation formulas, further enriching the algorithm system in this direction. Mou Yufei et al. combined fractal coding with knight's circumvention to construct a fractal-knight's circumvention joint compression encryption method, using the circumvention path to guide the fractal coding process, maintaining the quality of the decrypted image while ensuring compression efficiency. Lan Hong et al. (see reference 5) achieved global encryption and statistical property perturbation by dividing the image into cell arrays and fusing Arnold transform and knight's circumvention iterations.

[0005] In recent years, the Knight's Tour encryption algorithm has been further combined with advanced computing technologies. Gao et al. (see reference 6) combined BP neural networks with multi-image hybrid encryption, using Knight's Tour to scramble multiple images. However, the neural network training is time-consuming and sensitive to image type, limiting its universality. Khan et al. (see reference 7) introduced quantum random walks to improve the randomness and unpredictability of the key; Zhang et al. (see reference 8) proposed a distributed backtracking algorithm, which significantly reduced the computational complexity of tour path generation; Chen et al. (see reference 9) used graph neural networks to achieve intelligent pruning and dynamic adjustment of path search. These studies have not only deepened the understanding of the combinatorial properties of Knight's Tour, but also provided new methods for high-performance image encryption.

[0006] However, while existing research on image encryption using the Knight's Parade scrambling method has made some good progress, it has gradually revealed the following shortcomings with the development of the times and the advancement of science and technology: Significant block effect: Some related studies adopt a block processing strategy and use the knight's roaming matrix to scramble the block images. This method has strict constraints on image size and results in a significant block effect in the encrypted image.

[0007] High computational complexity: Some studies combine the Knights Parade with other scrambling algorithms, resulting in relatively complex encryption and decryption processes, which increases computational complexity and has a significant impact on encryption and decryption speed.

[0008] Insufficient security: Some studies have optimized the Knight's Roaming Scrambling algorithm, which can change the spatial distribution of pixels better, but it ignores the diffusion processing of pixel values, resulting in the grayscale histograms of the images before and after encryption remaining completely consistent. Its encryption security still needs to be further improved.

[0009] Based on the above-mentioned shortcomings, there is an urgent need to propose an image encryption method that eliminates block artifacts, has low computational complexity, and strong security.

[0010] The references are as follows: [1] Bai Sen, Cao Changxiu, Cao Longhan, et al. Digital image detail hiding technique based on knight's walk transform [J]. Journal of Image and Graphics, 2001, 6(11): 52-56. [2] Hou Qibin, Yang Xiaofan, Liu Qihe, et al. An image scrambling algorithm based on wavelet transform and knight's roaming [J]. Computer Research and Development, 2004, 41(2):272-277. [3] Lei Zhongkui, Sun Qiuyan, Ning Xuanxi. Application of the Horse Stance Hamiltonian Circle (Knight's Parade) in Image Scrambling Encryption Method [J]. Small and Micro Computer Systems, 2010, 31(5): 984-989. [4] Sun Qiuyan. Image scrambling algorithm and evaluation method based on knight's roaming transform [D]. Nanjing: Nanjing University of Aeronautics and Astronautics, 2007. [5] Lan Hong, Fang Yi. An improved encryption algorithm for knight parade images based on Arnold transform [J]. Communication Technology, 2018, 51(7):1663-1670. [6] Gao XY, Mou Y, Banerjee S, et al. Color-Gray multi-Image hybridcompression–encryption scheme based on BP neural network and knight tour[J]. IEEE Transactions on Cybernetics, 2023,53(8):5037-5047. [7] Khan M, et al. Quantum-inspired knight's tour-Based image encryption[J]. IEEE Access,2018,6:53478-53489. [8] Zhang Y, et al. Distributed backtracking for knight's tour on GPUclusters[J]. IEEE Transactions on Parallel and Distributed Systems, 2021, 32(6): 1321-1335. [9] Chen L, et al. Graph neural network-guided heuristic search forhamiltonian path problems[C] / / Advances in Neural Information ProcessingSystems.2023:10845-10858.

[10] Pan Yingli, He Bing, Wang Ying. An improved image encryption algorithm based on knight patrol [J]. Computer and Digital Engineering, 2016, 44(01):136-140.

[11] Mao Ning. Research on Image Encryption Algorithm Based on Chaos and Lifting Wavelet Transform Optimization [D]. Harbin Institute of Technology, 2023.

[12] Chen Shanxue, Yang Yajuan, Yin Xiuxuan. An improved algorithm for digital image encryption based on knight patrol and bitwise operation[J]. Small and Microcomputer Systems, 2015, 36(7):1607-1612.

[13] Jiang Delei, Bai Sen, Dong Wenming. Bit-plane image scrambling algorithm based on generalized knight patrol [J]. Progress in Natural Science, 2009, 19(06):691-696.

[14] Mao Ning. Research on Image Encryption Algorithm Based on Chaos and Lifting Wavelet Transform Optimization [D]. Harbin Institute of Technology, 2023.

[15] Bai Sen, Cao Changxiu. A new digital image scrambling and hiding algorithm [J]. Computer Engineering, 2001, 27(11):3-5.

[16] Du Jian, Li Fei, Dai Ming, et al. Traffic image encryption scheme based on triangular chaotic mapping and compressed sensing [J]. Electronic Design Engineering, 2025, 33(9):154-162. Summary of the Invention

[0011] This invention proposes an image encryption method based on chaotic mapping and global permutation generalized knight's roaming, which solves the problems of significant block artifacts, high computational complexity, and insufficient security of existing image encryption methods.

[0012] The technical solution of this invention is implemented as follows: The first aspect of this invention provides an image encryption method based on chaotic mapping and global permutation generalized knight's roaming, comprising the following steps: Read in plaintext images and convert them into M × N The pixel matrix is ​​numbered according to either column-major or row-major order; Select Key K By iterating through the chaotic system, the first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence ,right , Integerization is performed to obtain the first integer pseudo-random sequence. Second integer pseudo-random sequence ; Using the first integer pseudo-random sequence, the global permutation generalized knight's roaming algorithm is used to scramble the numbered pixel matrix, resulting in a scrambled matrix. A ; Transform the second integer pseudo-random sequence into M × N Chaotic matrix L Chaotic matrix L With scrambling matrix A Perform an XOR operation to obtain the encrypted image.

[0013] Specifically, the following two-dimensional Logistic chaotic system is used to generate chaotic pseudo-random sequences: ; in, Indicates the first i The state variables obtained in the next iteration , , , These are the system parameters of a chaotic system; Select Key The two-dimensional Logistic chaotic system is iterated multiple times to obtain a chaotic sequence. The first 500 terms of the chaotic sequence are discarded, and the sequence is truncated starting from the 501st term. M × N The first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence .

[0014] Furthermore, the chaotic pseudo-random sequence is integerized using the following formula: ; in, , ; , ; This represents the floor function.

[0015] Specifically, the global permutation generalized knight's roaming algorithm includes the following steps: S1, Determine the next location for the knight's patrol: ; ; in, Indicates the Knights' number k The location of the next parade Represents the first integer pseudo-random sequence The first in k Value mod represents the modulo function; modulus Indicates the Knights' number k The total number of pixels in the pixel matrix that have not been traversed during the second tour; S2, Pixel matrix number update: Maintain the pixel index value in the pixel matrix less than The pixel numbers remain unchanged, and the numbers greater than 10 are... Decrease the pixel number value by 1; S3, Repeat steps S1 and S2 until all pixels in the pixel matrix have been traversed, and the path of the knight's procession is determined. ; S4, scramble the pixel matrix according to the determined roaming path, and change the position determined in the previous step each time you move. The corresponding original pixel is moved to the currently determined position. Finally, the position The corresponding original pixel is moved to the starting cruise position. The scrambling matrix is ​​obtained. A .

[0016] Specifically, the second integer pseudo-random sequence is transformed into... M × N Chaotic matrix L The method is as follows: For the second integer pseudo-random sequence Each element in the array is modulo 256: ; in, Chaotic matrix L The first in i One element, For the second integer pseudo-random sequence The first in iOne element, ; One-dimensional sequence Reshape into column-major or row-major order M × N Two-dimensional chaotic matrix L .

[0017] The second aspect of this invention provides an image decryption method based on chaotic mapping and global permutation generalized knight's roaming. The method uses an integer pseudo-random sequence in the image encryption method to decrypt the ciphertext image to obtain a plaintext image. The decryption process of the ciphertext image is the inverse process of the plaintext image encryption process.

[0018] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the image encryption method.

[0019] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image encryption method.

[0020] Compared to existing technologies, the advantages of this invention are as follows: By combining a two-dimensional Logistic chaotic mapping with a global permutation generalized knight's roaming, this invention achieves a dual encryption mechanism of pixel position scrambling and pixel value diffusion. Specifically, the pseudo-random sequence generated by the chaotic mapping dynamically controls the knight's roaming path, overcoming the block effect problem of traditional block scrambling and achieving true global encryption. Simultaneously, a diffusion matrix generated by another chaotic sequence obfuscates the scrambled pixel values, completely altering the statistical characteristics of the image. This scheme, while ensuring encryption security, significantly improves computational efficiency by optimizing the roaming path generation algorithm, effectively resisting various attack methods such as statistical analysis and brute-force attacks. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of the plaintext image encryption process in an embodiment of the present invention.

[0023] Figure 2 This is a flowchart illustrating the global permutation generalized knight's roaming algorithm in an embodiment of the present invention.

[0024] Figure 3 This is a schematic diagram of the encrypted image decryption process in an embodiment of the present invention.

[0025] Figure 4 This is a comparison diagram of plaintext image, ciphertext image, and decrypted image in an embodiment of the present invention; Figure 4 middle,( a ) is a plaintext image, ( b ) is a ciphertext image, ( c () is the decrypted image.

[0026] Figure 5 This is a comparison chart of key sensitivity test results in an embodiment of the present invention; Figure 5 middle,( a The image is decrypted using the correct key. b (Image decrypted using an incorrect key)

[0027] Figure 6 is a histogram of the plaintext image and the ciphertext image in an embodiment of the present invention; in Figure 6, ( a ) is the histogram of the plaintext image, ( b () is the histogram of the encrypted image.

[0028] Figure 7 This is a comparison diagram of the correlation between adjacent pixels of the plaintext image and the ciphertext image in an embodiment of the present invention; Figure 7 middle,( a This is a schematic diagram illustrating the correlation between adjacent pixels in the horizontal direction of a plaintext image; b This is a schematic diagram illustrating the correlation between adjacent pixels in the horizontal direction of the encrypted image; c This is a schematic diagram illustrating the correlation between adjacent pixels in the vertical direction of a plaintext image; d This is a schematic diagram illustrating the correlation between adjacent pixels in the vertical direction of the encrypted image; e This is a schematic diagram illustrating the correlation between adjacent pixels in the diagonal direction of a plaintext image; f ( ) is a schematic diagram of the correlation between adjacent pixels in the diagonal direction of the encrypted image. Detailed Implementation

[0029] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0030] Reference Figure 1The first aspect of this invention provides an image encryption method based on chaotic mapping and a global permutation generalized knight's roaming. It utilizes a chaotic pseudo-random sequence generated by chaotic mapping to control the global scrambling of image pixels, determining the next pixel to be accessed within the entire image range, thus making the pixel arrangement more chaotic and disordered. This global permutation method breaks the limitations of traditional roaming rules, greatly increasing the difficulty for attackers to predict and crack the roaming path, thereby improving the image scrambling effect and the security of the encryption algorithm. The method includes the following steps: Read in the plaintext image (this example uses a grayscale image; if it is a color image, it can be converted to grayscale via three channels before processing) and convert it into... M × N The pixel matrix, ordered by column priority or row priority from Number each pixel in the pixel matrix (i.e., image preprocessing); This embodiment takes column-major order as an example. The element table for numbering the pixel matrix is ​​shown in Table 1 below: Table 1. Pixel matrix element table numbered in column-major order

[0031] Select Key K By iterating through the chaotic system, the first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence ,right , Integerization is performed to obtain the first integer pseudo-random sequence. Second integer pseudo-random sequence ; Using the first integer pseudo-random sequence, the global permutation generalized knight's roaming algorithm is used to scramble the numbered pixel matrix, resulting in a scrambled matrix. A ; Transform the second integer pseudo-random sequence into M × N Chaotic matrix L Chaotic matrix L With scrambling matrix A Perform an XOR operation to obtain the ciphertext matrix. C ciphertext matrix C The output is a ciphertext image.

[0032] Specifically, the following two-dimensional Logistic chaotic system is used to generate chaotic pseudo-random sequences: ; in, Indicates the first i The state variables obtained in the next iteration , , , Here are the system parameters of the chaotic system; the system parameters of the two-dimensional Logistic chaotic system satisfy the following range of values: ; ; ; ; , ; When the system parameters of a two-dimensional Logistic chaotic system satisfy the above value range, the system is in a chaotic state. Compared to the one-dimensional Logistic mapping, the two-dimensional Logistic chaotic mapping introduces more parameters and variables, and the variables... and The interactions between them form a coupled chaotic mapping, which can generate more complex sequences and avoid simple periodicity. This makes the dynamic behavior of the system more complex and diverse, and can produce richer chaotic characteristics.

[0033] Select Key The two-dimensional Logistic chaotic system is iterated multiple times to obtain a chaotic sequence. The first 500 terms of the chaotic sequence are discarded, and the sequence is truncated starting from the 501st term. M × N The first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence .

[0034] Furthermore, the chaotic pseudo-random sequence is integerized using the following formula: ; in, , ; , ; This represents the floor function.

[0035] Specifically, such as Figure 2 As shown, the global permutation generalized knight's roaming algorithm includes the following steps: S1, Determine the next location for the knight's patrol: ; ; in, Indicates the Knights' number k The location of the next parade Represents the first integer pseudo-random sequence The first in k Value mod represents the modulo function; modulus Indicates the Knights' number k The total number of pixels in the pixel matrix that have not been traversed during the second tour; S2, Pixel matrix number update: Maintain the pixel index value in the pixel matrix less than The pixel numbers remain unchanged, and the numbers greater than 10 are... Decrease the pixel number value by 1; S3, Repeat steps S1 and S2 until all pixels in the pixel matrix have been traversed, and the path of the knight's procession is determined. ; S4, scramble the pixel matrix according to the determined roaming path, and change the position determined in the previous step each time you move. The corresponding original pixel is moved to the currently determined position. Finally, the position The corresponding original pixel is moved to the starting cruise position. The scrambling matrix is ​​obtained. A .

[0036] Specifically, the second integer pseudo-random sequence is transformed into... M × N Chaotic matrix L The method is as follows: For the second integer pseudo-random sequence Each element in the array is modulo 256: ; in, Chaotic matrix L The first in i One element, For the second integer pseudo-random sequence The first in i One element, ; One-dimensional sequence Reshape into column-major or row-major order M × N Two-dimensional chaotic matrix L .

[0037] like Figure 3 As shown, the second aspect of this invention provides an image decryption method based on chaotic mapping and global permutation generalized knight's roaming. The method utilizes an integer pseudo-random sequence in the image encryption method to decrypt the ciphertext image, obtaining a plaintext image. The decryption process of the ciphertext image is the inverse process of the plaintext image encryption process. The decryption process steps are as follows: First step, select a key K By iterating through the chaotic system, the first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence ,right , Integerization is performed to obtain the first integer pseudo-random sequence. Second integer pseudo-random sequence ; Select Key The two-dimensional Logistic chaotic system is iterated multiple times to obtain a chaotic sequence. The first 500 terms of the chaotic sequence are discarded, and the sequence is truncated starting from the 501st term. M × N The first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence .

[0038] The chaotic pseudo-random sequence is integerized using the following formula: ; in, , ; , ; This represents the floor function.

[0039] The second step is to transform the second integer pseudo-random sequence into... M × N Chaotic matrix L For the second integer pseudo-random sequence Each element in the array is modulo 256: ; in, Chaotic matrix L The first in i One element, For the second integer pseudo-random sequence The first in i One element, ; One-dimensional sequence Reshape into column-major or row-major order M × N Two-dimensional chaotic matrix L .

[0040] The third step is to convert the chaotic matrix L With ciphertext matrix C Performing an XOR operation to complete the inverse diffusion yields the scrambling matrix. A .

[0041] The fourth step is to use the first integer pseudo-random sequence. Substitute the values ​​into the scrambling matrix to perform the inverse scrambling of the global permutation generalized knight's roaming, obtain the plaintext matrix, and output the plaintext matrix as a plaintext image.

[0042] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the image encryption method.

[0043] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the image encryption method.

[0044] This embodiment uses MATLAB R2023b software to comprehensively analyze the algorithm's performance, combining performance indicators such as key sensitivity, and compares the algorithm with existing algorithms to verify its superiority. The specific operating environment is as follows: AMD Ryzen 7 5800H processor with Radeon Graphics, clock speed 3.20GHz, 16.0GB of memory, and 64-bit Windows 11 operating system.

[0045] Experimental subject: A standard Lena image used for testing, with an image size of 512×512 pixels. The image was encrypted and decrypted using the method proposed in this invention. The encrypted and decrypted image is shown below. Figure 4 As shown, from Figure 4 It is evident that the encrypted image exhibits the characteristics of random noise, the ciphertext image is completely unrelated to the plaintext image, and the decrypted image is identical to the plaintext image, indicating that the image encryption and decryption algorithm proposed in this invention can effectively achieve image encryption and decryption.

[0046] 1) Key sensitivity analysis

[0047] Key sensitivity is one of the important indicators for measuring the security of encryption algorithms. To test the key sensitivity of the encryption method designed in this invention, the correct key input during encryption was used respectively. K Error key with slightly altered key components For example, the encrypted image in the figure is decrypted using two sets of keys, and the results are as follows: Figure 5 As shown.

[0048] Among them, the correct key Incorrect key ; As can be seen from the decryption comparison images, even a slight change in the key results in a completely different image after decryption compared to the correct image. Further calculations were performed on each image. The pixel change rate (RNPC) and uniform average change intensity (UACI) values ​​were 99.6048% and 33.5073%, respectively, for the key. K The pixel change rate (NPCR) and uniform average change intensity (UACI) of each component were calculated and analyzed, and the results are shown in Table 2 below: Table 2 Key Sensitivity Comparison Table

[0049] As can be seen from Table 2 above, the encryption method of the present invention is highly sensitive to key changes, which helps to resist attackers' attempts to crack the encryption through key trial and error, and effectively improves the security of image encryption protection.

[0050] 2) Key space analysis

[0051] The key space size refers to the number of keys that can be used for encryption or decryption in cryptography. The initial value of the two-dimensional Logistic mapping set in the encryption method of this invention is... The parameters are These six values ​​are all independent. Since the pixel values ​​are data types of double-precision floating-point numbers in the simulation environment, and are analyzed with 8 bits and 16 significant digits, the precision of all parameters during the simulation is... Then the key space is This far exceeds the current limit of key space achievable through brute force cracking. This means that under current conditions, the system parameters and keys used cannot be found through brute-force attacks, effectively resisting exhaustive attacks. A comparison of the key spaces of different algorithms is shown in Table 3 below: Table 3. Comparison of Key Spaces for Different Algorithms

[0052] As shown in Table 3, the algorithm of this invention has the feature of a large key space, and is significantly superior to many algorithms in terms of key space. It can effectively resist brute-force attacks and has higher image encryption security.

[0053] 3) Histogram analysis

[0054] A grayscale histogram provides a clear view of the distribution of pixel values. If the distribution is uneven, attackers can analyze it to obtain image information. Therefore, an excellent image encryption algorithm needs to ensure that the grayscale histogram is evenly distributed.

[0055] By comparing the grayscale histograms of the plaintext and encrypted images in Figure 6, it is evident that the original image's grayscale histogram exhibits a significant non-uniform distribution. This could allow attackers to deduce information from the original image using statistical analysis and other attack methods. In contrast, the encrypted image's grayscale histogram shows a more uniform distribution, with a relatively balanced distribution of pixel grayscale values. This significant change indicates that the encryption method effectively disrupts the distribution pattern of grayscale values ​​in the original image, achieving a good diffusion effect. This makes the grayscale value distribution of the encrypted image more random, enhancing the security of image encryption and effectively resisting attack methods based on the statistical characteristics of grayscale values, such as differential attacks and statistical analysis attacks.

[0056] 4) Correlation analysis of adjacent pixels

[0057] In image encryption, the correlation between adjacent pixels is used to measure the security of the encryption algorithm; the closer the absolute value of the adjacency coefficient between adjacent pixels is to 0, the better.

[0058] To comprehensively evaluate the security of the image encryption method of this invention, the correlation between adjacent pixels in the images before and after encryption is analyzed from three dimensions: horizontal, vertical, and diagonal. By selecting pixel pairs in the above three directions, a comparison chart of adjacent pixel correlation is drawn to intuitively show the changes in pixel correlation before and after encryption.

[0059] from Figure 7 It can be seen that the correlation between adjacent pixels in plaintext images is very high, while the correlation between adjacent pixels in ciphertext images is very low.

[0060] To further evaluate the correlation between adjacent pixels in the method of this invention, the correlation coefficients of adjacent pixels in the horizontal, vertical, and diagonal directions of the plaintext and ciphertext images were calculated respectively. The correlation coefficients of the algorithm of this invention were compared with those of other algorithms, and the results are shown in Table 4 below: Table 4. Comparison of Correlation Coefficients Between Adjacent Pixels

[0061] As can be seen from Table 3, the correlation coefficient of adjacent pixels in the encrypted image obtained by the method of the present invention is much lower than that of the plaintext image, and is generally lower than the correlation coefficient of other literature, thus demonstrating superior performance in image encryption.

[0062] 5) Information Entropy Analysis

[0063] Information entropy, a key concept in information theory, is primarily used to quantify the degree of uncertainty or randomness of information. In the field of image encryption, information entropy is a crucial indicator for evaluating the security of encryption algorithms. A good image encryption algorithm should have an information entropy value close to 8. The closer the information entropy is to 8, the less information the image contains, and the better the image encryption.

[0064] The information entropy of the encrypted image obtained by the encryption algorithm of this invention is compared with that of the Lena color plaintext image and other related image encryption algorithms in literature. The information entropy comparison results are shown in Table 5 below: Table 5 Information Entropy Comparison Table

[0065] As can be seen from Table 5, the information entropy of the algorithm of the present invention is closer to the ideal value of 8. Therefore, the image pixel scrambling effect of the encryption algorithm of the present invention is better and the performance is superior.

[0066] 6) Time Complexity Analysis

[0067] The time complexity of an algorithm represents the growth trend of its execution time as the input size increases, and is a key indicator for measuring the performance of an algorithm.

[0068] Analyzing the complexity of the traditional knight's quest algorithm reveals that it requires constant searching, checking, and backtracking when scrambling each pixel. Since each step involves eight possible points, this complexity becomes significant. M × N The time complexity of this algorithm is O(n log n). This process incurs significant system overhead. The algorithms in references [5-6], lacking optimization of the knight's patrol path, still exhibit exponential time complexity, making them inefficient for handling large-scale data. High time complexity.

[0069] The improved algorithm proposed in this invention, by leveraging the rapid iteration of chaotic systems and optimizing the Knight's Roaming algorithm itself, reduces the time complexity to [missing value]. Compared to the original algorithm, it has achieved a significant improvement in time performance and can handle large-scale data processing tasks more efficiently.

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

Claims

1. An image encryption method based on chaotic mapping and global permutation generalized knight's roaming, characterized in that, Includes the following steps: Read in plaintext images and convert them into M × N The pixel matrix is ​​numbered according to either column-major or row-major order; Select Key K By iterating through the chaotic system, the first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence ,right , Integerization is performed to obtain the first integer pseudo-random sequence. Second integer pseudo-random sequence ; Using the first integer pseudo-random sequence, the global permutation generalized knight's roaming algorithm is used to scramble the numbered pixel matrix, resulting in a scrambled matrix. A ; Transform the second integer pseudo-random sequence into M × N Chaotic matrix L Chaotic matrix L With scrambling matrix A Perform an XOR operation to obtain the encrypted image.

2. The image encryption method based on chaotic mapping and global permutation generalized knight's roaming as described in claim 1, characterized in that, The following two-dimensional Logistic chaotic system is used to generate chaotic pseudo-random sequences: ; in, Indicates the first i The state variables obtained in the next iteration , , , These are the system parameters of a chaotic system; Select Key The two-dimensional Logistic chaotic system is iterated multiple times to obtain a chaotic sequence. The first 500 terms of the chaotic sequence are discarded, and the sequence is truncated starting from the 501st term. M × N The first chaotic pseudo-random sequence is obtained. Second chaotic pseudo-random sequence .

3. The image encryption method based on chaotic mapping and global permutation generalized knight's roaming as described in claim 2, characterized in that, The chaotic pseudo-random sequence is integerized using the following formula: ; in, , ; , ; This represents the floor function.

4. The image encryption method based on chaotic mapping and global permutation generalized knight's roaming as described in claim 1, characterized in that, The global permutation generalized knight's roaming algorithm includes the following steps: S1, Determine the next location for the knight's patrol: ; ; in, Indicates the Knights' number k The location of the next parade Represents the first integer pseudo-random sequence The first in k Value mod represents the modulo function; modulus Indicates the Knights' number k The total number of pixels in the pixel matrix that have not been traversed during the second tour; S2, Pixel matrix number update: Maintain the pixel index value in the pixel matrix less than The pixel numbers remain unchanged, and the numbers greater than 10 are... Decrease the pixel number value by 1; S3, Repeat steps S1 and S2 until all pixels in the pixel matrix have been traversed, and the path of the knight's procession is determined. ; S4, scramble the pixel matrix according to the determined roaming path, and change the position determined in the previous step each time you move. The corresponding original pixel is moved to the currently determined position. Finally, the position The corresponding original pixel is moved to the starting cruise position. The scrambling matrix is ​​obtained. A .

5. The image encryption method based on chaotic mapping and global permutation generalized knight's roaming as described in claim 1, characterized in that, Transform the second integer pseudo-random sequence into M × N Chaotic matrix L The method is as follows: For the second integer pseudo-random sequence Each element in the array is modulo 256: ; in, Chaotic matrix L The first in i One element, For the second integer pseudo-random sequence The first in i One element, ; One-dimensional sequence Reshape into column-major or row-major order M × N Two-dimensional chaotic matrix L .

6. An image decryption method based on chaotic mapping and global permutation generalized knight's roaming, characterized in that, The ciphertext image is decrypted using the integer pseudo-random sequence in the image encryption method described in any one of claims 1 to 5 to obtain the plaintext image. The decryption process of the ciphertext image is the reverse process of the plaintext image encryption process.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the image encryption method as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the image encryption method as described in any one of claims 1 to 5.