Abstract
This paper proposes a new one-dimensional Sine-Logistic chaotic system (SLCS). Compared with related chaotic systems, SLCS has a larger parameter range and better chaotic behavior, making it suitable for image encryption. Based on the new chaotic system, this paper proposes a secure and efficient image encryption algorithm. Firstly, the image is divided into blocks of equal size, and inter-block scrambling is performed using chaotic sequences generated by SLCS. Secondly, based on the chaotic sequences generated by SLCS, each block is subjected to intra-block scrambling using the dynamic Josephus algorithm. Then, the zigzag algorithm is applied to globally scramble the image once, resulting in a semi-encrypted image. Finally, the proposed diffusion formula is used to rapidly diffuse the image, further enhancing the encryption effect to obtain the final encrypted image. The initial values and control parameters of SLCS are designed and generated by combining the SHA-512 hash function with the plaintext image. This encryption algorithm can be extended to encrypt color images. Compared with some existing encryption algorithms, this encryption algorithm has better encryption effectiveness and higher time efficiency, while also being resistant to common attacks.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
In light of the rapid advancement of the Internet, an immense volume of information is incessantly transmitted on a daily basis. The complexity and openness of the Internet have posed significant threats to the security of information transmission. Digital images, serving as a ubiquitous information carrier, find widespread applications in various domains, including daily life, social media, and medical imaging, owing to their intuitive and straightforward nature [1,2,3,4]. Consequently, the security of digital image transmission has become paramount. To prevent unauthorized access or theft of images during transmission, encryption is commonly employed to safeguard the information contained within the image [5,6,7].
Chaotic systems exhibit characteristics such as randomness, sensitivity to initial values, and unpredictability, making them suitable for image encryption [8, 9]. These systems commonly used for image encryption can be categorized into low-dimensional chaotic systems and high-dimensional chaotic systems [10, 11]. Examples of low-dimensional chaotic systems include the classical one-dimensional Logistic map and Sine map [12,13,14]. On the other hand, high-dimensional chaotic systems encompass well-known models such as the two-dimensional Hénon map, three-dimensional Lorenz system, and Chen system [15,16,17,18,19]. Both low-dimensional and high-dimensional chaotic systems have their respective advantages and disadvantages. Due to their relatively simple mathematical models, low-dimensional chaotic systems are easy to realize and comprehend, with lower running time costs [20]. Conversely, high-dimensional chaotic systems may possess more intricate mathematical models, resulting in complex chaotic behavior that is challenging to implement and incurs relatively higher running time costs [21,22,23]. A comparison reveals that it is impractical to use a specific index to determine which dimension of a chaotic system is superior. In recent years, many scholars have proposed various improved one-dimensional chaotic mappings based on the Logistic map and Sine map, such as the Sine-logistic integrated map (SLIM) [24] and Logistic-Sine map [25]. These chaotic systems have shown some improvements compared to the Logistic map and Sine map in terms of performance. However, they still have some drawbacks. For example, SLIM has a relatively large periodic window, while Logistic-Sine map have a limited parameter range, thereby restricting their chaotic performance to some extent. Therefore, in order to further improve these shortcomings, this paper presents a new one-dimensional chaotic system. Compared with the aforementioned chaotic systems, through some performance analysis, it is concluded that this chaotic system has a larger parameter range and better chaotic behavior.
At present, mainstream encryption algorithms are generally categorized into two stages: scrambling and diffusion [26,27,28]. Scrambling is designed to make information in the image challenging to comprehend and analyze by perturbing the position of pixels. Classical scrambling algorithms encompass the Arnold transform [29,30,31], standard zigzag scrambling [32, 33], and the Fisher-Yates algorithm. While these algorithms exhibit different encryption effects, they each have inherent drawbacks. For instance, the Arnold transformation displays periodic characteristics, allowing the image to be restored to its original state after a certain number of transformations [34, 35], posing security risks in the encryption process. Standard zigzag scrambling, requiring multiple iterations, retains specific values in the matrix unchanged, resulting in prolonged processing times and incomplete data scrambling. Diffusion involves altering pixel values in the image to distribute information more evenly, thereby enhancing the overall encryption effect. The XOR operation is a standard method in the diffusion stage. Wang et al. [36] integrated chaotic sequences with the traditional Josephus sequence to enhance sequence randomness and confusion effectively. However, the unchanged step size of the Josephus algorithm imposes limitations on improving sequence randomness. Xie et al. [37] proposed an improved Josephus algorithm that dynamically selects different directions and step sizes in each iteration, significantly enhancing the randomness of the scrambling process but at the cost of longer encryption time. Wang et al. [38] designed and utilized a new dynamic Josephus permutation algorithm that recalculates random counting intervals each round and utilizes chaotic sequences generated by chaotic systems to obtain these intervals. Although randomness is guaranteed, it also faces the issue of prolonged permutation time. Setiadi et al. [39] performed permutation on all bit pixels based on Josephus sequences, where Josephus sequences are dynamically determined according to the pixel coordinate positions, reducing permutation time but with limited effectiveness. Through the aforementioned analysis, this paper proposes a more secure and efficient image encryption algorithm. Initially, the image is partitioned into uniform and appropriately sized blocks. The chaotic sequence generated by the chaotic system is sorted to create an index, which is then used for inter-block scrambling. Subsequently, the dynamic Josephus algorithm, guided by the chaotic sequence, is employed for in-block scrambling of each block. The standard zigzag algorithm is then applied for global scrambling of the image, resulting in a semi-encrypted image. Finally, the image undergoes rapid diffusion using the proposed diffusion formula to further enhance the encryption effect, producing the final encrypted image. This algorithm, combining block scrambling and the dynamic Josephus algorithm, reduces encryption time while achieving initial global scrambling of the entire image. The dynamic Josephus algorithm, an improvement over the traditional version, enhances scrambling randomness. Notably, the shortcomings affecting pixels in the original image's starting and ending positions do not impact subsequent standard zigzag scrambling, further enhancing the overall scrambling effect.
The main contributions of this paper are as follows:
-
1.
A new one-dimensional Sine-Logistic chaotic system(SLCS) is proposed, which has a more significant parameter range and better chaotic behavior.
-
2.
A new dynamic Josephus algorithm is proposed, which combines block scrambling and dynamic Josephus algorithm to scramble the entire image.
-
3.
A new diffusion formula is designed, which combines two chaotic sequences with control parameters and initial values to spread the image rapidly.
The remaining structure of this paper is as follows. Section 2 introduces the proposed chaotic system SLCS and analyzes its performance in detail. Section 3 describes the steps of the encryption and decryption algorithm based on SLCS. Section 4 is the simulation results of gray images and various security analyses. Section 5 gives the simulation results of color images and various security analyses. Section 6 is the conclusion.
2 SLCS and performance analysis
2.1 Logistic map
The Logistic Map is a one-dimensional discrete dynamical system proposed by biologist Robert May in 1976 [40], and it stands as one of the classic examples in chaos theory. This mapping describes a simple yet nonlinear dynamical system, commonly used to demonstrate chaotic behavior and the complex evolution of systems under parameter changes. The mathematical expression of the Logistic Map is as follows:
where xn ϵ (0, 1) and μ ϵ [0, 1]. When μ ϵ (0.8972,1], the Logistic map exhibits chaotic behavior. The bifurcation diagram of the Logistic map is shown in Fig. 1a.
2.2 Sine map
The Sine Map is also a classic one-dimensional chaotic system, known for its relatively simple structure. The mathematical expression of the Sine Map is as follows:
where xn ϵ (0, 1) and μ ϵ [0, 1]. When μ ϵ (0.8722, 1], the Sine map exhibits chaotic behavior. The bifurcation diagram of the Sine map is shown in Fig. 1b.
2.3 SLCS
By analyzing the bifurcation diagrams of the Logistic map and the Sine map, it can be inferred that their parameter ranges are relatively small, and their chaotic behaviors are relatively simple. Building upon the mathematical expressions of the Logistic map and the Sine map, this paper proposes a new one-dimensional Sine-Logistic chaotic system (SLCS). The mathematical expression of this chaotic system is as follows:
where μ is the control parameter. When μ ϵ (0, + ∞), SLCS is in a chaotic state. The values of the chaotic sequences generated by SLCS are uniformly distributed in the interval (0, 1).
2.4 Performance analysis of SLCS
To demonstrate the pseudo-randomness, unpredictability, and other chaotic properties of the output sequence of SLCS, several experiments were conducted to analyze its dynamic behavior. Tests include bifurcation diagrams, sensitivity analysis, Shannon entropy, and so on.
2.4.1 Bifurcation diagram
Bifurcation diagrams are typically used to illustrate how the periodic behavior of a chaotic system evolves with changes in a parameter, leading to bifurcations, chaos, or other complex chaotic behaviors. The better the performance of a chaotic system, the more uniform the distribution of the generated chaotic sequence, and there are almost no occurrences of periodic windows [41]. The bifurcation diagrams of SLCS and other chaotic systems are shown in Fig. 2. From Fig. 2a, it can be observed that SLCS does not exhibit any periodic windows, and the generated chaotic sequence is uniformly distributed in the interval (0, 1). To demonstrate that the control parameter μ of SLCS ranges from (0, + ∞), the upper limit of μ is set to 1000. The bifurcation diagram of SLCS obtained with this upper limit for μ is shown in Fig. 2b. Similarly, from Fig. 2b, it can be seen that SLCS exhibits good chaotic behavior.
2.4.2 Sensitivity analysis
Chaos systems are highly sensitive to initial conditions. In a good chaotic system, even small variations in initial values will lead to completely different chaotic sequences. The sensitivity of a chaotic system can be measured using Lyapunov Exponents (LE). It represents the numerical characteristic of the average exponential divergence rate of neighboring trajectories in phase space [42]. The Lyapunov exponent is calculated as follows:
where i represents the time series, and f(x) represents the equation of the chaotic system being used. When the value of LE is negative, it indicates that the system is in a contracting state. When the value of LE is positive, it indicates that the system is continuously folding and expanding. Therefore, the system is in a chaotic state only when LE is positive. The LE values of SLCS and other chaotic systems are shown in Fig. 3a. From the graph, it is evident that the LE value of SLCS is greater than that of other chaotic systems and is greater than 0. Furthermore, to demonstrate that the control parameter μ of SLCS can be stretched to infinity, Fig. 3b shows the chaotic state of SLCS with μ ranging within 1000. The LE value of SLCS is always greater than 0 and shows a continuous increasing trend. Therefore, when μ ϵ (0, + ∞), SLCS is chaotic.
In addition, to further evaluate the sensitivity of SLCS to initial values, the output sequences were compared based on the increase in the number of iterations. Two extremely close initial points were selected, and the trajectories of the two chaotic sequences Fn(x0) and Fn(x0 + 10–14) were plotted over 40 iterations (the first 1000 iterations were discarded to eliminate transient effects). The results are shown in Fig. 4. From the graph, it can be seen that when the control parameter remains constant, small variations in the initial values result in completely different chaotic sequences generated by SLCS. Therefore, SLCS exhibits a high sensitivity to initial values.
2.4.3 Shannon entropy
The Shannon entropy (SE) reflects the degree of chaos in the chaotic sequence generated by chaotic systems [43]. A higher SE value indicates a more complex and disordered chaotic sequence generated by the chaotic system, while a lower SE value suggests a simpler and more ordered sequence. Figure 5 illustrates a comparison of the Shannon entropy of SLCS with other chaotic systems. It is evident from the graph that the SE value of SLCS is higher and more stable, demonstrating its superior chaotic and stochastic properties, resulting in a more disorderly generated chaotic sequence.
2.4.4 The NIST SP800-22 test
To validate the applicability of the proposed chaotic system in designing image encryption algorithms, we conducted randomness tests on the output sequences of SLCS according to the National Institute of Standards and Technology (NIST) SP800-22 standard. The NIST SP800-22 standard comprises 15 sub-tests, each generating a P-value. We tested sequences with a length of 225 bits, aiming to generate P-values within the range [0.01, 1] to pass the corresponding sub-tests. The test results are presented in Table 1, demonstrating that the binary sequences generated by SLCS successfully passed all sub-tests. This indicates that SLCS can produce non-periodic output sequences with strong pseudo-randomness, thus making it suitable for image encryption.
3 Encryption algorithm and decryption algorithm
This section provides a detailed description of the steps involved in the encryption and decryption algorithms based on SLCS. The encryption algorithm is primarily divided into four stages. The first stage is key generation, where the SHA-512 hash function is employed to process the plaintext image, and the processed result is transformed to serve as the algorithm's key. The second stage involves block permutation, wherein the chaotic sequences generated by SLCS are utilized to perform inter-block permutation and intra-block dynamic Josephus permutation on the plaintext image. The third stage encompasses global permutation, utilizing the zigzag algorithm to perform a single global permutation on the image. The fourth stage is diffusion, employing the proposed diffusion formula to rapidly diffuse the semi-encrypted image to obtain the final ciphertext image. Figure 6 intuitively illustrates the entire encryption process.
3.1 Key generation
This paper selects the SHA-512 hash function as the primary method for key processing. The SHA-512 hash function possesses high resistance to decryption, with its forward operation being simple and efficient, while its reverse operation is extremely difficult. Regardless of the size of the input image, the output generated by SHA-512 is always 512 bits (64 bytes). The sensitivity of this function to the initial value implies that different image inputs will yield unique results. Consequently, the key generated by SHA-512 is closely related to the input plaintext, greatly enhancing the system's resistance to known-plaintext attacks and chosen-plaintext attacks. The initial values and control parameters of SLCS are determined by the key, and the block sizes m and n are also determined by the key. Using the plaintext image P as the input for the SHA-512 algorithm, a 128-bit hexadecimal string is generated, which is then converted to a 512-bit binary number K. K is divided equally into 16 groups k1-k16, each consisting of 32 bits. k1-k16 are processed according to Eq. (5)–(6), resulting in four sets of initial values and control parameters (x1, μ1), (x2, μ2), (x3, μ3), (x4, μ4). The block sizes m and n are obtained using Eq. (7)–(8).
where x ⊕ y represents the XOR operation between x and y, mod(x, y) represents the modular operation between x and y, and bi2de(x) represents the conversion of binary x to decimal number.
3.2 Encryption process
The encryption process is divided into two processes: scrambling and diffusion.
3.2.1 Scrambling process
The purpose of this process is to alter the pixel positions of the plaintext image. Let's assume the size of the plaintext image P is M × N. The specific permutation steps are as follows:
Step 1. To divide the plaintext image P into equally sized blocks, we pad P with pixels of value 300 to convert it into an image Pb of size Mb × Nb, where Mb and Nb are the minimum multiples of m and n, respectively. The calculation of Mb and Nb is shown as Eqs. (9)–(10).
Step 2. Calculate the number of row blocks mb and column blocks nb after partitioning Pb according to Eq. (11)-(12).
Step 3. Taking x1 and μ1 as the initial value and control parameter of SLCS, the chaotic sequence A1 is obtained by iterating the system mb × nb + 1000 times and discarding the first 1000 values (eliminating transient effects).
Step 4. Chaotic sequence A1 is processed according to Eq. (13) to obtain index sequence Q. Then inter-block index scrambling of image Pb is performed according to index sequence Q to get initial scrambled image P1, as shown in Algorithm 1.
Step 5. Take x2 and μ2 as the initial value and control parameter of SLCS, iterate the system Mb × Nb + 1000 times, and discard the first 1000 values (eliminate transient effects) to obtain chaotic sequence A2.
Step 6. The pixel values in each block of P1 are read into the one-dimensional sequence layer by layer, and the scrambled image P2 is obtained by dynamic Josephus scrambling according to the corresponding part Bi of chaotic sequence A2. Bi is calculated according to Eq. (14). The description of dynamic Josephus scrambling is shown in Algorithm 2.
Step 7. Remove the filled pixels in scrambled image P2 and resize the image to M × N. To further interfere with the pixel position of the image, a global zigzag scrambling is performed on image P2 to obtain the final scrambled image P3. The specific scrambling process is shown in Figs. 7 and 8.
3.2.2 Diffusion process
The diffusion operation is adopted to alter the pixel values in the image more effectively, thereby better concealing the plaintext information and enhancing resistance to attacks. The specific diffusion steps are as follows:
Step 1. Take x3 and μ3 as the initial values and control parameters of SLCS, iterate the system M × N + 1000 times, and discard the first 1000 values (eliminate transient effects) to obtain the chaotic sequence A3. Similarly, take x4 and μ4 as the initial values and control parameters of SLCS, iterate the system M × N + 1000 times, and discard the first 1000 values (eliminate transient effects) to obtain chaotic sequence A4.
Step 2. The two one-dimensional chaotic sequences A3 and A4 are transformed into two one-dimensional chaotic integer sequences a3 and a4 by Eqs. (15–16).
Step 3. The image P3 is converted into a one-dimensional sequence p. Then, a new one-dimensional sequence c is obtained by changing the size of the pixel values in p according to Eq. (17).
Step 4. The one-dimensional sequence c is adjusted to M × N, the same size as the plaintext image P, and the final ciphertext image C is obtained.
3.3 Decryption process
Image decryption is the inverse process of image encryption. During the decryption process, the key is sent along with the ciphertext image to the decryption party. The specific steps are as follows:
Step 1. As in the encryption process, the initial value and control parameters of SLCS are obtained by processing the known key, and then the chaotic sequences A1, A2, A3 and A4 required by the decryption process are obtained by iterating the system.
Step 2. Perform the inverse diffusion process on ciphertext image C according to the chaotic sequence A3 and A4 to obtain scrambled image P3.
Step 3. Perform a zigzag inverse scrambling on P3 to get P2. For P2, fill pixels with a pixel value size of 300 and adjust the image size to Mb × Nb. P2 is partitioned, and P1 is obtained by dynamic Josephus inverse scrambling according to chaotic sequence A2. Then, the index sequence Q is obtained according to the chaotic sequence A1, and the inverse process of index block scrambling of P1 is carried out according to Q, and Pb is obtained.
Step 4. Finally, remove the pixels filled in Pb and adjust the image size to M × N to get the plaintext image P.
4 Simulation results and security analysis of gray image
In this section, the effectiveness and performance of the image encryption algorithm in this paper are verified by the simulation results and security analysis of gray images. Security analysis includes key space and sensitivity analysis, multiple statistical analysis, differential attack analysis, robustness analysis, etc. In this paper, MATLAB R2023a was used for simulation experiments and deployed on a computer equipped with Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, 4GB RAM, and Windows 10 operating system.
4.1 Simulation results
The selected grayscale images include Boat, Baboon, Pepper, Black and White, and the size of five images is 512 × 512. The five plaintext images are encrypted and decrypted; the results are shown in Fig. 9.
4.2 Key space analysis
The key space refers to the total number of keys available for use in the algorithm. A larger key space provides greater resistance against brute force attacks, resulting in higher algorithm security. In the algorithm presented in this paper, the SHA-512 hash function is first used to generate the initial key. This function links the initial key to the plaintext image, producing an initial key K of 512 bits. The key space of the initial key K is 2512. Subsequently, the initial key K is used to generate the initial values and control parameters of SLCS, as well as the block size. Therefore, the key space of the algorithm proposed in this paper exceeds 2512, far greater than 2100, meeting the security requirements for key space.
4.3 Key sensitivity analysis
Highly secure image encryption algorithms are highly sensitive to the key. Even slight variations in the key can result in completely different decrypted images compared to those produced with the original key. Encrypting the grayscale image Boat using the original key and then decrypting the ciphertext image using both the correct key and a slightly altered incorrect key yields disparate results. In this algorithm, SLCS involves four initial values, x1, x2, x3, x4, and four control parameters, μ1, μ2, μ3, μ4. Taking x1 and μ1 as examples, two incorrect keys are generated by making minor changes to x1 and μ1. Figure 10a illustrates the result of decrypting the ciphertext image using the correct key, demonstrating that the correct key successfully decrypts the ciphertext image to produce the original image. Figure 10b, c depict the results of decrypting the ciphertext image using incorrect keys, showing that incorrect keys fail to properly decrypt the ciphertext image. Therefore, the algorithm presented in this paper meets the requirement for high sensitivity to the key.
4.4 Histogram analysis
Histograms provide an intuitive reflection of the distribution of different pixels in an image and are one of the important indicators for measuring the security of encryption algorithms. Typically, the pixel distribution in plaintext images is uneven. To enhance the resistance of encrypted images against statistical analysis attacks, making it difficult for attackers to extract useful information from the pixel value distribution, the pixels in the ciphertext should be distributed as evenly as possible. Therefore, the more uniform the distribution of the ciphertext histogram, the better the security of the encryption algorithm. Taking three selected grayscale images, Boat, Baboon, and Pepper, as examples, the histograms before and after encryption are analyzed. As shown in Fig. 11, it can be observed that the distributions of the plaintext histograms before encryption are uneven, while the distributions of the ciphertext histograms after encryption are relatively uniform. This demonstrates that the algorithm proposed in this paper can effectively resist statistical attacks.
4.5 Correlation analysis
In digital images, pixels do not exist independently; there exists a strong correlation between adjacent pixels. Correlation analysis is a crucial method for evaluating the quality of encryption algorithms, wherein the magnitude of correlation coefficients is one of the key indicators for measuring the algorithm's resistance to attacks. To enhance the resistance of ciphertext images against statistical attacks, it is essential to minimize the correlation between adjacent pixels in the image, aiming to approach a correlation coefficient close to zero. Equations (18)–(21) are used to calculate the correlation between adjacent pixels in the image.
where x and y are the gray values of two adjacent pixels. E(x), D(x), and cov(x, y) are the expectation, variance, and covariance, respectively.
Taking the selected grayscale images Boat, Baboon, and Pepper as examples, 5000 pairs of adjacent pixels were selected from both the plaintext and ciphertext images to test their correlation in horizontal, vertical, and diagonal directions. Figure 12 illustrates the distribution of adjacent pixels in the horizontal, vertical, and diagonal directions before and after encryption. In the figure, blue, orange, and yellow represent horizontal, vertical, and diagonal distributions, respectively. It can be observed from the figure that the distribution of adjacent pixels in the plaintext images is relatively concentrated in all three directions, whereas the distribution of adjacent pixels in the ciphertext images is more uniform in all three directions. Table 2 provides a more accurate comparison of correlation coefficients for different images and different algorithms. It is evident from the table that the correlation coefficients between adjacent pixels in the plaintext images are close to 1 in all three directions, indicating a very strong correlation. In contrast, the correlation coefficients between adjacent pixels in the ciphertext images are close to 0 in all three directions, indicating a very weak correlation. Furthermore, compared with algorithms from other literature, the algorithm proposed in this paper demonstrates better resistance against statistical attack analysis.
4.6 x2 test
The x2 test can further analyze whether the distribution of pixel values in the ciphertext image is uniform, and its value is calculated by Eq. (22).
where vi and v0 denote the actual and desired frequency of occurrence of pixel value i. The smaller the x2 value, the more uniform the distribution of pixel values. To make the ciphertext image more resistant to statistical attacks, the x2 value should be as small as possible. The significance level α is set to 0.05, \(x_{0.05}^{2}\) = 293.2478. For example, the five selected grayscale images, Boat, Baboon, Pepper, Black, and White, are subjected to the x2 test on their plaintext images and ciphertext images, and the results are shown in Table 3. The table shows that the x2 values of all ciphertext images are less than 293.2478, and all of them pass the x2 test. Therefore, the encryption algorithm proposed in this paper has good resistance to statistical attacks.
4.7 Information entropy analysis
Information entropy is an important index to measure the degree of confusion of an image, and the more significant the value, the higher the randomness and degree of confusion of an image. Equation (23) is the calculation formula of information entropy.
where N is the binary length of the pixel, and p(ei) represents the probability of the occurrence of pixel ei. In theory, when the value of information entropy is close to 8, the encrypted image has a higher degree of confusion and security because eight corresponds to a byte of complete information. To verify the influence of the proposed algorithm on the degree of image chaos, the information entropy of Boat, Baboon, Pepper, Black, and White of five grayscale images before and after encryption is listed in Table 4, and the results are compared with those in related literature. It can be observed from the table that the information entropy of the encrypted image increases significantly and is close to the ideal value of 8. This shows that the proposed algorithm can effectively improve the degree of image confusion. The comparison results with other algorithms show that the proposed algorithm is closer to the ideal value of 8 in terms of information entropy, proving that it has better security.
4.8 Pixel disparity analysis
Peak signal-to-noise ratio (PSNR) and mean square error (MSE) are usually used to test the pixel difference between plaintext images and ciphertext images and can be used as indicators to evaluate image quality. PSNR indicates the degree of image distortion. The smaller the PSNR value, the higher the degree of ciphertext image distortion. PSNR and MSE can be calculated by Eqs. (24) and (25).
where P(i, j) and C(i, j) are pixel values of plaintext and ciphertext images, respectively. When testing plaintext images and ciphertext images, the smaller the PSNR value and the larger the MSE value, the better the encryption effect of the algorithm. Table 5 lists the MSE and PSNR values of several gray-scale images and compares them with the results in related literature. It can be seen from the data in the table that the PSNR value of the encryption algorithm proposed in this paper is smaller, which proves that the encryption algorithm proposed in this paper has higher security.
4.9 Differential attack analysis
Differential attack is a very effective type of security attack. It modifies a pixel value of the plaintext image, encrypts the image, and then compares and analyzes the difference between the ciphertext image and the original ciphertext image to obtain the relevant information of the encryption algorithm. Pixel conversion ratio (NPCR) and uniform mean change intensity (UACI) are two indexes to measure the ability of an algorithm to resist differential attacks. NPCR and UACI can be calculated by Eqs. (26)–(28).
where C1 and C2 represent the ciphertext image before and after changing a pixel value, respectively, and M and N represent the size of the image.
\(N_{\alpha }^{*}\) and \(U_{\alpha }^{*}\) are the two critical values of NPCR and UACI, respectively. The algorithm passes the test if the NPCR value is more significant than \(N_{\alpha }^{*}\) and the corresponding UACI value is in the interval \((U_{\alpha }^{* - } ,\;U_{\alpha }^{* + } )\). Equations (29)–(30) can calculate these three critical values.
where \(\Phi^{ - 1} {(}{\text{.)}}\) is the inverse cumulative density function of the standard normal distribution N(0,1), and D represents the maximum supported pixel value.
Twenty-five gray-scale images of different sizes were selected from the USC-SIPI database for testing. The test and comparison results of NPCR and UACI for different images are presented in Tables 6 and 7 at significance level α = 0.05, respectively. The mean values of NPCR and UACI for this paper's algorithm are 99.6123% and 33.4614%, respectively, and all images passed the test. Compared with other algorithms, the standard deviation of this paper's algorithm is smaller. Therefore, the algorithm in this paper can effectively resist differential attacks and has high-security performance.
4.10 Robustness analysis
In the transmission process, ciphertext images are inevitably subject to various interference. Some attacks on ciphertext images can cause data loss, making decrypted images blurry or even unrecognizable. A robust encryption algorithm must be able to minimize the impact of these attacks on decrypted images. The common malicious attacks in the image transmission process mainly include clipping attacks and noise attacks, which this paper uses to test the algorithm's robustness.
Taking the selected grayscale image Boat as an example, different degrees of clipping attack and noise attack were tested, and the results were shown in Figs. 13 and 14. As can be seen from Fig. 13, most of the plaintext information can still be obtained after decryption of images clipped at different positions. As seen in Fig. 14, useful information can still be obtained from the decrypted image after different salt and pepper noise levels are used to disturb the ciphertext image. Table 8 gives the PSNR values and comparison results between decrypted images and plaintext images under different degrees of clipping and noise attacks. It can be seen from the table that the proposed algorithm has better PSNR values. Therefore, the proposed algorithm can resist clipping and noise attacks and has strong robustness.
4.11 Computational complexity analysis
In the process of image encryption, the time complexity of key generation is O(1), the time complexity of the scrambling stage is O(Mb × Nb), and the time complexity of the diffusion stage is O(M × N). M and N are the length and width of the plaintext image, respectively, while Mb and Nb are the length and width of the plaintext image after it is filled with pixels. Therefore, the total time complexity of this algorithm is O(Mb × Nb). Table 9 gives the encryption and decryption times of images of different sizes and compares them with other algorithms. It can be seen from the table that the algorithm in this paper has better time efficiency.
5 Simulation results and security analysis of color image
This section extends the encryption algorithm of this paper to color images and presents the simulation experimental results and security analysis of color images.
5.1 Simulation results
Color images consist of three channels: R (red), G (green), and B (blue). When encrypting a color image, each of these channels' grayscale images is encrypted separately. Subsequently, the encrypted versions of the three channels are combined to form the ciphertext image. The decryption process is the reverse of the encryption process. Taking color images Airplane, Baboon, and Pepper with a size of 512 × 512 as examples, the encryption and decryption results are shown in Fig. 15.
5.2 Histogram analysis
Figure 16 illustrates the histograms of the plaintext and ciphertext distributions for the color image Pepper across the R, G, and B channels. It can be observed from the figure that the distributions of the plaintext histograms in the three channels are uneven before encryption, while the distributions of the ciphertext histograms in the three channels are relatively uniform after encryption. Therefore, the proposed algorithm demonstrates effective encryption for color images as well.
5.3 Correlation analysis
Figure 17 presents the distribution of adjacent pixels in the R, G, and B channels of the color image Pepper across horizontal, vertical, and diagonal directions. It can be observed from the figure that the distribution of adjacent pixels in the plaintext images across the three channels is relatively concentrated in all three directions, while the distribution of adjacent pixels in the ciphertext images across the three channels is more uniform in all three directions. Therefore, the proposed algorithm can reduce the correlation between adjacent pixels in different channels, thus enhancing resistance against statistical attack analysis.
5.4 Robustness analysis
Figures 18 and 19 respectively display the results of cropping and noise attack tests on the color image Pepper. It can be seen from the figures that even after being subjected to different degrees of attacks, the proposed algorithm can still decrypt most of the information from the ciphertext image. Therefore, for color images, the proposed algorithm is also capable of resisting cropping and noise attacks.
5.5 Other analysis
This section conducted a series of common tests on the ciphertext images of the R, G, and B channels of the color image Pepper, including information entropy, NPCR, UACI, x2, MSE, and PSNR. The experimental results are respectively listed in Tables 10 and 11. Observing the data in the tables, it can be seen that the proposed algorithm performs close to the ideal values in the tests, highlighting the high security of the encrypted color images. The algorithm demonstrates excellent encryption performance for color images.
6 Conclusion
This paper proposes a novel one-dimensional Sine-Logistic chaotic system (SLCS). Through various testing metrics such as bifurcation diagram, sensitivity analysis, Shannon entropy, etc., the superiority of SLCS in randomness, sensitivity to initial values, and unpredictability is verified. Compared with related chaotic systems, SLCS exhibits a larger parameter range and better chaotic behavior, making it suitable for image encryption. Based on the new chaotic system, this paper proposes a secure and efficient image encryption algorithm. Firstly, the image is divided into appropriately sized and equal blocks, and chaos sequences generated by the chaotic system are sorted to create indices for inter-block scrambling. Secondly, based on the chaos sequences generated by the chaotic system, each block is subjected to intra-block scrambling using the dynamic Josephus algorithm. Then, a standard zigzag algorithm is applied to globally scramble the image once, resulting in a semi-encrypted image. Finally, a proposed diffusion formula is used to rapidly diffuse the image, further enhancing the encryption effect, and obtaining the final encrypted image. The initial values and control parameters of SLCS are designed and generated by combining the SHA-512 hash function with the plaintext image. Simulation results on grayscale and color images demonstrate that the proposed algorithm has a large key space, is highly sensitive to the key, and exhibits good encryption performance. Additionally, simulation experiments including statistical attack analysis, entropy analysis, pixel difference analysis, differential attack analysis, robustness analysis, and computational complexity analysis are conducted. Comparative analysis with other algorithms demonstrates that the proposed algorithm can effectively resist common attacks such as statistical attacks and differential attacks, with high security and time efficiency. In future research, we will further improve the chaotic system, increase the number of control parameters, enhance the complexity of key generation, and propose even more secure image encryption algorithms.
Data availability and access
Data will be made available on reasonable request. The manuscript has associated data in a data repository.
References
J. Anju, R. Shreelekshmi, A faster secure content-based retrieval for cloud. Expert Syst. Appl. 189, 116070 (2022)
M. Kaur, V. Kumar, A comprehensive review on image encryption techniques. Arch. Comput. Methods Eng. 27(1), 15–43 (2020)
Y. Pourasad, R. Ranjbarzadeh, A. Mardani, A new algorithm for digital image encryption based on chaos theory. Entropy 23(3), 341 (2021)
C. Xu, J.R. Sun, C.H. Wang, An image encryption algorithm based on random walk and hyperchaotic systems. Int. J. Bifurcat. Chaos 30(4), 2050060 (2020)
W.Q. Yu, Y. Liu, L.H. Gong, M.M. Tian, L.Q. Tu, Double-image encryption based on spatiotemporal chaos and DNA operations. Multimed. Tools Appl. 78(14), 20037–20064 (2019)
C.Y. Song, Y.L. Qiao, A novel image encryption algorithm based on DNA encoding and spatiotemporal chaos. Entropy 17(10), 6954–6968 (2015)
X.L. Chai, Z.H. Gan, K. Yuan, Y.R. Chen, X.X. Liu, A novel image encryption scheme based on DNA sequence operations and chaotic systems. Neural Comput. Appl. 31(1), 219–237 (2019)
C. Pak, L.L. Huang, A new color image encryption using combination of the 1D chaotic map. Signal Process. 138, 129–137 (2017)
L.F. Liu, S.X. Miao, Delay-introducing method to improve the dynamical degradation of a digital chaotic map. Inf. Sci. 396, 1–13 (2017)
X.Y. Wang, W.H. Xue, J.B. An, Image encryption algorithm based on Tent-dynamics coupled map lattices and diffusion of Household. Chaos Solitons Fractals 141, 110309 (2020)
X.Y. Wang, L. Feng, R. Li, F.C. Zhang, A fast image encryption algorithm based on non-adjacent dynamically coupled map lattice model. Nonlinear Dyn. 95(4), 2797–2824 (2019)
Y.Q. Luo, J. Yu, W.R. Lai, L.F. Liu, A novel chaotic image encryption algorithm based on improved baker map and logistic map. Multimed. Tools Appl. 78(15), 22023–22043 (2019)
A. Mansouri, X.Y. Wang, A novel one-dimensional sine powered chaotic map and its application in a new image encryption scheme. Inf. Sci. 520, 46–62 (2020)
R.Z. Li, Q. Liu, L.F. Liu, Novel image encryption algorithm based on improved logistic map. IET Image Proc. 13(1), 125–134 (2019)
N. Jiang, X. Dong, H. Hu, Z.X. Ji, W.Y. Zhang, Quantum image encryption based on henon mapping. Int. J. Theor. Phys. 58(3), 979–991 (2019)
P. Ping, F. Xu, Y.C. Mao, Z.J. Wang, Designing permutation-substitution image encryption networks with Henon map. Neurocomputing 283, 53–63 (2018)
Y.J. Xian, X.Y. Wang, Fractal sorting matrix and its application on chaotic image encryption. Inf. Sci. 547, 1154–1169 (2021)
B. Wang, B.F. Zhang, X.W. Liu, An image encryption approach on the basis of a time delay chaotic system. Optik 225, 165737 (2021)
X.Y. Wang, X. Chen, An image encryption algorithm based on dynamic row scrambling and Zigzag transformation. Chaos Solitons Fractals 147, 110962 (2021)
Y.C. Zhou, L. Bao, C.L.P. Chen, A new 1D chaotic system for image encryption. Signal Process. 97, 172–182 (2014)
D.S. Malik, T. Shah, Color multiple image encryption scheme based on 3D-chaotic maps. Math. Comput. Simul 178, 646–666 (2020)
A. Kadir, M. Aili, M. Sattar, Color image encryption scheme using coupled hyper chaotic system with multiple impulse injections. Optik 129, 231–238 (2017)
F.Y. Sun, S.T. Liu, Z.W. Lü, Image encryption using high-dimension chaotic system. Chin. Phys. 16(12), 3616–3623 (2007)
S.A. Gebereselassie, B.K. Roy, Comparative analysis of image encryption based on 1D maps and their integrated chaotic maps. Multimed. Tools Appl. 83, 1–23 (2024)
A. Alanezi, B. Abd-El-Atty, H. Kolivand, A.A. Abd El-Latif, B. Abd El-Rahiem, S. Sankar et al., Securing digital images through simple permutation-substitution mechanism in cloud-based smart city environment. Secur. Commun. Netw. 2021, 1–17 (2021)
X.Y. Wang, L. Feng, H.Y. Zhao, Fast image encryption algorithm based on parallel computing system. Inf. Sci. 486, 340–358 (2019)
X.Y. Wang, S. Gao, Image encryption algorithm based on the matrix semi-tensor product with a compound secret key produced by a Boolean network. Inf. Sci. 539, 195–214 (2020)
F.Y. Sun, S.T. Liu, Z.Q. Li, Z.W. Lü, A novel image encryption scheme based on spatial chaos map. Chaos Solitons Fractals 38(3), 631–640 (2008)
T.G. Pan, D.Y. Li, Image encryption algorithm based on 3D Arnold cat and Logistic map. Adv. Mater. Res. 317, 1537–1540 (2011)
W. Chen, X.D. Chen, Optical image encryption using multilevel Arnold transform and noninterferometric imaging. Opt. Eng. 50(11), 117001 (2011)
L.F. Liu, S.X. Miao, A new simple one-dimensional chaotic map and its application for image encryption. Multimed. Tools Appl. 77(16), 21445–21462 (2018)
X.Y. Wang, J.J. Zhang, G.H. Cao, An image encryption algorithm based on ZigZag transform and LL compound chaotic system. Opt. Laser Technol. 119, 105581 (2019)
X.Y. Wang, N.N. Guan, A novel chaotic image encryption algorithm based on extended Zigzag confusion and RNA. Opt. Laser Technol. 131, 106366 (2020)
X.Y. Wang, Y.N. Su, Color image encryption based on chaotic compressed sensing and two-dimensional fractional Fourier transform. Sci. Rep. 10(1), 18556 (2020)
G.D. Ye, X.L. Huang, An efficient symmetric image encryption algorithm based on an intertwining logistic map. Neurocomputing 251, 45–53 (2017)
X.Y. Wang, L. Liu, Application of chaotic Josephus scrambling and RNA computing in image encryption. Multimed. Tools Appl. 80(15), 23337–23358 (2021)
H.W. Xie, Y.J. Gao, H. Zhang, An image encryption algorithm based on novel block scrambling scheme and Josephus sequence generator. Multimed. Tools Appl. 82(11), 16431–16453 (2023)
X.L. Wang, L. Teng, D.H. Jiang, Z.Y. Leng, X.Y. Wang, Triple-image visually secure encryption scheme based on newly designed chaotic map and parallel compressive sensing. Eur. Phys. J. Plus 138(2), 156 (2023)
D.I.M. Setiadi, E.H. Rachmawanto, R. Zulfiningrum, Medical image cryptosystem using dynamic Josephus sequence and Chaotic-hash scrambling. J. King Saud Univ. Comput. Inf. Sci. 34(9), 6818–6828 (2022)
Z.H. Gan, X.L. Chai, D.J. Han, Y.R. Chen, A chaotic image encryption algorithm based on 3-D bit-plane permutation. Neural Comput. Appl. 31(11), 7111–7130 (2019)
O. Mirzaei, M. Yaghoobi, H. Irani, A new image encryption method: parallel sub-image encryption with hyper chaos. Nonlinear Dyn. 67(1), 557–566 (2012)
A. Sinha, K. Singh, A technique for image encryption using digital signature. Opt. Commun. 218(4–6), 229–234 (2003)
X.Y. Wang, P.B. Liu, A new image encryption scheme based on a novel one-dimensional chaotic system. IEEE Access 8, 174463–174479 (2020)
H.Q. Huang, S.Z. Yang, R.S. Ye, Image encryption scheme combining a modified Gerchberg-Saxton algorithm with hyper-chaotic system. Soft. Comput. 23(16), 7045–7053 (2019)
S.T. Geng, T. Wu, S.D. Wang, X.C. Zhang, Y.F. Wang, Image encryption algorithm based on block scrambling and finite state machine. IEEE Access 8, 225831–225844 (2020)
Z.Y. Liang, Q.X. Qin, C.J. Zhou, An image encryption algorithm based on Fibonacci Q-matrix and genetic algorithm. Neural Comput. Appl. 34(21), 19313–19341 (2022)
M. Alawida, J.S. Teh, A. Samsudin, W.H. Alshoura, An image encryption scheme based on hybridizing digital chaos and finite state machine. Signal Process. 164, 249–266 (2019)
Z.X. Guan, J.X. Li, L.Q. Huang, X.M. Xiong, Y. Liu, S.T. Cai, A novel and fast encryption system based on improved Josephus scrambling and chaotic mapping. Entropy 24(3), 384 (2022)
Y. Zhang, The fast image encryption algorithm based on lifting scheme and chaos. Inf. Sci. 520, 177–194 (2020)
Z.Y. Hua, Y.C. Zhou, Image encryption using 2D Logistic-adjusted-Sine map. Inf. Sci. 339, 237–253 (2016)
X.S. Li, Z.L. Xie, J. Wu, T.Y. Li, Image encryption based on dynamic filtering and bit cuboid operations. Complexity 2019, 7485621 (2019)
X.Y. Wang, J.J. Yang, A novel image encryption scheme of dynamic S-boxes and random blocks based on spatiotemporal chaotic system. Optik 217, 164884 (2020)
A.U. Rehman, A. Firdous, S. Iqbal, Z. Abbas, M.M.A. Shahid, H.W. Wang et al., A color image encryption algorithm based on one time key, chaos theory, and concept of rotor machine. IEEE Access 8, 172275–172295 (2020)
X.J. Wu, H.B. Kan, J. Kurths, A new color image encryption scheme based on DNA sequences and multiple improved 1D chaotic maps. Appl. Soft Comput. 37, 24–39 (2015)
X.Y. Wang, M.C. Zhao, An image encryption algorithm based on hyperchaotic system and DNA coding. Opt. Laser Technol. 143, 107316 (2021)
M.X. Wang, X.Y. Wang, C.P. Wang, S. Zhou, Z.Q. Xia, Q. Li, Color image encryption based on 2D enhanced hyperchaotic logistic-sine map and two-way Josephus traversing. Digit. Signal Process. 132, 103818 (2023)
Acknowledgements
This work is supported by the National Natural Science Foundation of China (Nos: 61701070), the Fundamental Research Funds for the Central Universities (Nos: 3132024261), China Postdoctoral Science Foundation (No: 2020M680933).
Author information
Authors and Affiliations
Contributions
Yang Liu: Conceptualization, Data curation, Writing—original draft, Visualization, Methodology. Lin Teng: Data curation, Supervision, Writing—review & editing, Investigation.
Corresponding author
Ethics declarations
Competing interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Ethical and informed consent for data used
Not applicable.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Liu, Y., Teng, L. An image encryption algorithm based on a new Sine-Logistic chaotic system and block dynamic Josephus scrambling. Eur. Phys. J. Plus 139, 554 (2024). https://doi.org/10.1140/epjp/s13360-024-05349-y
Received:
Accepted:
Published:
DOI: https://doi.org/10.1140/epjp/s13360-024-05349-y