Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

A sector fast encryption algorithm for color images based on one-dimensional composite sinusoidal chaos map

  • Ye Tao,

    Roles Writing – original draft, Writing – review & editing

    Affiliations School of Electronic and Information Engineering, University of Science and Technology Liaoning, Anshan, China, School of Computer Science and Software Engineering, University of Science and Technology Liaoning, Anshan, China, Key Laboratory of Intelligent Constriguction and Internet of Thinfigs Application Technology, Anshan, China

  • Wenhua Cui ,

    Roles Writing – review & editing

    taibeijack@126.com

    Affiliations School of Electronic and Information Engineering, University of Science and Technology Liaoning, Anshan, China, School of Computer Science and Software Engineering, University of Science and Technology Liaoning, Anshan, China, Key Laboratory of Intelligent Constriguction and Internet of Thinfigs Application Technology, Anshan, China

  • Shanshan Wang,

    Roles Writing – review & editing

    Affiliation China MCC22 Group Co., Ltd., Tangshan, China

  • Yayun Wang

    Roles Writing – review & editing

    Affiliations Anshan Normal University, Anshan, China, School of Materials and Metallurgy, University of Science and Technology Liaoning, Anshan, China

Abstract

Images are important information carriers in our lives, and images should be secure when transmitted and stored. Image encryption algorithms based on chaos theory emerge in endlessly. Based on previous various chaotic image fast encryption algorithms, this paper proposes a color image sector fast encryption algorithm based on one-dimensional composite sinusoidal chaotic mapping. The main purpose of this algorithm is to improve the encryption and decryption speed of color images and improve the efficiency of image encryption in the big data era. First, four basic chaos maps are combined in pairs and added with sine operations. Six one-dimensional composite sinusoidal chaos maps (CSCM) were obtained. Secondly, select the two best chaotic mappings LCS and SCS. The randomness of these two chaotic mappings was verified through Lyapunov index and NIST SP 800–22 randomness tests. Thirdly, the encryption process is carried out according to the shape of a traditional Chinese fan, and the diffusion and scrambling of each pixel of the image are performed in parallel. This greatly improves encryption speed. When diffusing, changing the value of one pixel can affect the values of multiple subsequent pixels. When scrambling, each pixel changes position with the three pixels before it according to the chaotic sequence. Finally, through many experiments, it is proved that the image encryption algorithm not only greatly improves the encryption and decryption speed, but also improves various indexes. The key space reached 2192, the average information entropy was 7.9994, the average NPCR was 99.6172, and the average UACI was 33.4646. The algorithm can also resist some common attacks and accidents, such as exhaustion attack, differential attack, noise attack, information loss and so on.

1 Introduction

Nowadays, with the rapid development of the Internet and information technology, multimedia data transmission has become increasingly prominent. Image is a description of the similarity and vividness of objective things. It is an important information carrier in our lives. With the wide application of digital images in various fields, image encryption technology is becoming more and more important. Image encryption technology is an effective means to protect image information. It ensures the security of images during transmission and storage. Aiming at the shortcomings of existing image encryption technologies, such as low encryption algorithm efficiency, low encryption strength, etc. This can no longer meet the application requirements of large amounts of data and high confidentiality. Therefore, it becomes particularly necessary to develop an efficient image encryption algorithm. Chaos-based image encryption technology has the advantages of large key space, fast encryption speed, and strong randomness. It has become a current research hotspot.

Recently, researchers have published some typical image encryption algorithms. Zhou et al. [1] proposed a novel image encryption scheme based on chaotic signals with finite-precision error. Zhou et al. [2] proposed a novel image encryption cryptosystem based on true random numbers and chaotic systems. Zhou et al. [3] proposed a novel image cryptosystem based on new 2D hyperchaotic map and dynamical chaotic S-box. Ye et al. [4] proposed a new chaotic circuit with multiple memristors and its application in image encryption. Ye et al. [5] proposed hidden oscillation and chaotic sea in a novel 3d chaotic system with exponential function. Tao et al. [6] proposed spatiotemporal chaos in multiple dynamically coupled map lattices and its application in a novel image encryption algorithm.

Due to the advent of the big data era, more and more large batches of images need to be encrypted. This requires increasingly higher encryption speeds. The fast image encryption algorithm based on chaos has been further studied and explored based on previous research. It not only improves the encryption speed, but also ensures the security and reliability of the encryption algorithm. This has broad application prospects for practical applications.

In recent years, for rapid image encryption based on chaos, various researchers have proposed various methods with diffusion algorithms (changing pixel values) and scrambling algorithms (changing pixel positions) as the core. Various methods have been used to improve image encryption. speed. Wang et al. [7] proposed a fast image encryption algorithm based on the logical dynamic Arnold coupled logical map lattice model. Lin et al. [8] proposed a fast image encryption algorithm that enhances the randomness of chaotic sequences. Hanis et al. [9] proposed a fast encryption algorithm for block images based on improved logical mapping and butterfly structure. Stalin et al. [10] proposed a fast image encryption algorithm that combines block encryption, four-dimensional logical mapping and DNA systems. Abdelfatah [11] proposed a fast image encryption scheme based on dual chaotic pseudo-random generators. Gupta et al. [12] proposed a fast symmetric image encryption algorithm based on session keys. Talhaoui et al. [13] proposed an efficient and high-speed image fast encryption scheme based on Boolean chaos mapping. Kang et al. [14] proposed a fast encryption algorithm for color images using programmable supplementary maximum length cellular automata. Gao et al. [15] proposed a multi-image fast encryption algorithm based on single-channel scrambling, diffusion and chaotic mapping. Brahim et al. [16] proposed a fast image compression encryption scheme based on compressed sensing and parallel blocks. Tang et al. [17] proposed a fast image encryption method based on one-dimensional composite sinusoidal chaotic mapping. Fouda et al. [18] proposed a method for fast image encryption based on 8-bit precision passwords. Zhang et al. [19] proposed a parallel multi-image encryption based on cross-plane DNA manipulation and a novel 2D chaotic system.

The above image fast encryption algorithm belongs to the scrambling-diffusion image encryption algorithm. Scrambling and diffusion are two independent processes. Generally, it takes several rounds to achieve a satisfactory level of safety. This increases the time and complexity of calculations. and reduces its advantages in online image and high-volume image protection. In addition, it is not conducive to resisting separate attacks of proliferation and scrambling. Based on this, some image encryption algorithms use scrambling and diffusion to encrypt at the same time. For example, Wang et al. [20] proposed an image encryption algorithm based on parallel arrangement and diffusion strategy. And the sub-key cross-fusion method is used to form different keys in different rounds. Li et al. [21] proposed an Image encryption based on a fractional-order hyperchaotic system and fast row-column-level joint permutation and diffusion. Ma et al. [22] proposed a fast hyperchaotic image encryption scheme. Although this image encryption algorithm improves the speed of image encryption and decryption to a certain extent, it resists diffusion and scrambling attacks respectively. However, evaluation indicators such as key sensitivity, plain sensitivity, and information entropy still need to be improved. And there is still room for improvement in encryption speed.

In order to further improve the speed of image encryption and decryption and improve various evaluation indicators, this paper proposes a fast image encryption algorithm based on one-dimensional composite chaos. The specific chapters of this article are arranged as follows. Section 1 introduces the current research status of fast image encryption algorithms based on chaos, including various types of image fast encryption algorithms that perform diffusion scrambling separately and diffusion scrambling simultaneously. Section 2 introduces one-dimensional compound sinusoidal chaotic systems and analyzes their chaotic performance. Section 3 introduces the process of image encryption and decryption using the two best-performing composite chaos to generate chaotic sequences. During the image encryption process, the image is encrypted in a fan-shaped manner with associated plain. Changing the value of one point can affect the changes of multiple point values, and the scrambling and diffusion operations are performed simultaneously. Section 4 introduces the experimental results, including the comparison of various image encryption indicators such as encryption and decryption speed, correlation coefficient, histogram, information entropy, key space, key sensitivity, plain sensitivity, and robustness. It is proved that while improving the encryption speed, this algorithm ensures good key space, key sensitivity and plaintext sensitivity, can effectively resist various common attacks, and meets the needs of practical applications. Therefore, this algorithm has broad application prospects.

2 One-dimensional composite sinusoidal chaos map (CSCM)

In this chapter, first, four existing one-dimensional chaotic maps are introduced as seed maps. Secondly, in view of the shortcomings of existing chaos maps in weak dynamic behavior, two new one-dimensional compound sine chaos maps are proposed based on the one-dimensional compound sine chaos map (CSCM) in the literature [17]. SCS (Sine-Cubic-Sine) and TCS (Tent-Cubic-Sine). Finally, LSS (Logistic-Sine-Sine), STS (Sine-Tent-Sine), TLS (Tent-Logistic-Sine), LCS (Logistic-Cubic-Sine) and SCS, The bifurcation diagram of TCS proves that LCS and SCS have stronger chaotic properties.

2.1 Four typical one-dimensional chaotic maps

Most researchers use chaotic systems to generate chaotic matrices, and then perform scrambling and diffusion calculations on the chaotic matrix and plain images. We can use one-dimensional chaotic systems and multi-dimensional chaotic systems to generate chaotic images. Currently, image encryption schemes based on multi-dimensional chaotic systems are widely used [2326]. However, due to the complex structure and numerous parameters of multi-dimensional chaotic systems, their hardware implementation becomes more difficult.

One-dimensional chaotic mapping may have the disadvantages of limited chaotic interval and uneven output state [27]. However, one-dimensional chaotic systems also have the advantages of simple structure, easy implementation, and low computational cost. In recent years, researchers have proposed a large number of image encryption algorithms based on one-dimensional chaos [2830]. Therefore, it is of great significance to study a one-dimensional composite chaotic system with good chaotic characteristics.

There are four most commonly used one-dimensional chaos maps, including Tent chaos map, Cubic chaos map, Sine chaos map and Logistic chaos map. The definitions of these four chaotic maps are as shown in Eqs (1)–(4).

(1)(2)(3)(4)

Eq (1) is the Tent chaos map, Eq (2) is the Cubic chaos map, Eq (3) is the Sine chaos map, and Eq (4) is the Logistic chaos map. || represents absolute value operation, x is the variable of chaos iteration, and a ∈ (0,1) is the chaos control parameter. The combination of these four common types of chaos maps can produce many types of composite chaos maps to enhance the performance of chaos.

2.2 One-dimensional composite sinusoidal chaos map (CSCM) definition

In [17], a new one-dimensional compound sine chaotic system (CSCS) is introduced. CSCS is shown in Eq (5). (5) where μ1(e, xn) and μ2(e, xn) are any two common chaotic maps introduced in Section 2.1. Chaos control parameters are e, f and β, θ ∈ [–1,1] is a variable. In the analysis of this article, the following values are set e = a, f = 1—a, θ = 0.5, and β > 0.

The four common chaotic maps in Section 2.1 are brought into Formula (5) and can form the following six combinations, among which LSS (Logistic-Sine-Sine), STS (Sine-Tent-Sine), TLS (Tent-Logistic-Sine), and LCS (Logistic-Cubic-Sine) are proposed by [16], as shown in Eqs (6)–(9), (6) (7) (8) (9)

In Eqs (6)–(9), in order to make the value of x in (0, 1), this article performs mod 1 operation on each formula, that is, finding the remainder after dividing by 1.

On this basis, this paper proposes SCS (Sine-Cubic-Sine) and TCS (Tent-Cubic-Sine). In Section 2.3, it is analyzed and compared with (6)-(9), as shown in Eqs (10)–(11) shown.

(10)(11)

The purpose of the mod 1 calculation is to normalize these chaotic maps for ease of comparison. Keep the value range of x between 0 and 1.

2.3 CSCS performance analysis

2.3.1 Bifurcation diagram.

This section tests and analyzes the performance of the six chaotic systems in Section 2.2 through bifurcation diagrams. The bifurcation diagram of a chaotic system is an important tool used to describe chaotic phenomena. It helps us see periodic and non-periodic behavior in chaotic systems as a parameter changes. In the bifurcation diagram, the abscissa represents the value of the system parameter. The ordinate represents a specific measurement value of the system state, such as position, angle, amplitude, etc.

By changing the control parameter β, we draw the bifurcation diagram of LSS, STS, TLS, LCS, SCS, and TCS generated by CSCS. Set 3 β values for each bifurcation diagram, which are 0.5, 50 and 200 respectively. Take the initial value x = 0.4. The value is from 0 to 1, incrementing by 0.001 each time. After 300 iterations, the chaotic transitional form was removed. Figs 16 shows the bifurcation diagrams of LSS, STS, TLS, LCS, SCS, and TCS when β = 0.5. Fig 712 shows the bifurcation diagram of LSS, STS, TLS, LCS, SCS, and TCS when β = 50. Fig 1318 shows the bifurcation diagram of LSS, STS, TLS, LCS, SCS, and TCS when β = 200.

thumbnail
Fig 1. Bifurcation diagram of LSS for β = 0.5.

https://doi.org/10.1371/journal.pone.0310279.g001

thumbnail
Fig 2. Bifurcation diagram of STS for β = 0.5.

https://doi.org/10.1371/journal.pone.0310279.g002

thumbnail
Fig 3. Bifurcation diagram of TLS for β = 0.5.

https://doi.org/10.1371/journal.pone.0310279.g003

thumbnail
Fig 4. Bifurcation diagram of LCS for β = 0.5.

https://doi.org/10.1371/journal.pone.0310279.g004

thumbnail
Fig 5. Bifurcation diagram of SCS for β = 0.5.

https://doi.org/10.1371/journal.pone.0310279.g005

thumbnail
Fig 6. Bifurcation diagram of TCS for β = 0.5.

https://doi.org/10.1371/journal.pone.0310279.g006

thumbnail
Fig 7. Bifurcation diagram of LSS for β = 50.

https://doi.org/10.1371/journal.pone.0310279.g007

thumbnail
Fig 8. Bifurcation diagram of STS for β = 50.

https://doi.org/10.1371/journal.pone.0310279.g008

thumbnail
Fig 9. Bifurcation diagram of TLS for β = 50.

https://doi.org/10.1371/journal.pone.0310279.g009

thumbnail
Fig 10. Bifurcation diagram of LCS for β = 50.

https://doi.org/10.1371/journal.pone.0310279.g010

thumbnail
Fig 11. Bifurcation diagram of SCS for β = 50.

https://doi.org/10.1371/journal.pone.0310279.g011

thumbnail
Fig 12. Bifurcation diagram of TCS for β = 50.

https://doi.org/10.1371/journal.pone.0310279.g012

thumbnail
Fig 13. Bifurcation diagram of LSS for β = 200.

https://doi.org/10.1371/journal.pone.0310279.g013

thumbnail
Fig 14. Bifurcation diagram of STS for β = 200.

https://doi.org/10.1371/journal.pone.0310279.g014

thumbnail
Fig 15. Bifurcation diagram of TLS for β = 200.

https://doi.org/10.1371/journal.pone.0310279.g015

thumbnail
Fig 16. Bifurcation diagram of LCS for β = 200.

https://doi.org/10.1371/journal.pone.0310279.g016

thumbnail
Fig 17. Bifurcation diagram of SCS for β = 200.

https://doi.org/10.1371/journal.pone.0310279.g017

thumbnail
Fig 18. Bifurcation diagram of TCS for β = 200.

https://doi.org/10.1371/journal.pone.0310279.g018

In Fig 1, when the control parameter β is small, such as β = 0.5, a small part of the entire data range can be randomly covered by the output of these bifurcation graphs. In Fig 2, when β takes a slightly larger value, such as β = 50, the entire data range can basically be randomly covered by the output of these bifurcation graphs. But there are a small number of output values that are relatively concentrated. In Fig 3, when β takes a large value, such as β = 200, the entire data range can basically be randomly covered by the output of these bifurcation graphs. The concentrated output values become smaller. The most scattered output values are Fig 3 (d) LCS and (e) SCS. These two images are basically flawless. Therefore, the encryption algorithm in this chapter uses the chaotic image generated by these two values as the encryption password.

2.3.2 Lyapunov index.

Lyapunov exponent is an important mathematical tool for describing the behavior of chaotic systems. It is used to measure the exponential growth rate between adjacent trajectories in dynamic systems [16]. The Lyapunov index can help us determine whether a system has chaotic behavior and how high the degree of chaos is. A Lyapunov exponent greater than 0 indicates that the system is highly sensitive to small changes in initial conditions, which is a typical feature of chaotic phenomena. The Lyapunov calculation formula is shown in Eq (12). (12) where | f ’ (xn) | is the absolute value of the derivative of the mapping function at point xn, and N is the number of iterations. A positive Lyapunov index indicates that the system is chaotic and extremely sensitive to initial conditions.

Analyze the Lyapunov exponent values of (9) LCS and (10) SCS. When β = 200, θ = 0.5, the Lyapunov exponent value is shown in Figs 19 and 20 are the Lyapunov exponent graphs of LCS and SCS respectively. All Lyapunov exponent values are greater than 0, satisfying the characteristics of chaos.

2.3.3 NIST SP 800–22 randomness test.

NIST SP 800–22 is a technical report published by the National Institute of Standards and Technology (NIST). The full name is "A Statistical Test Suite for Random and Pseudo-Random Number Generators for Cryptographical Applications". NIST SP 800–22 includes a series of statistical tests for evaluating the randomness and statistical properties of generated random number sequences. These tests cover a variety of different types of randomness detection, including uniformity, independence, frequency distribution, sequence, uniform distribution, long periodicity, etc. The results of the test can help determine whether the random number generator is secure and random enough [23]. All tests of NIST SP 800–22 are greater than 0.01, indicating that the randomness meets the standard. Based on the values of each key parameter in Section 2.2, draw a conclusion whether randomness is met. Table 1 shows the randomness detection values of LCS and SCS when β = 200, θ = 0.5, a = 0.5. It can be seen that all detection values P are greater than 0.01, indicating that the randomness reaches the standard.

thumbnail
Table 1. The randomness detection value of LCS and SCS.

https://doi.org/10.1371/journal.pone.0310279.t001

3 Image sector fast encryption and decryption algorithm based on LCS and SCS composite chaos

The overall flow chart of the image encryption algorithm designed in this chapter is shown in Fig 21. The encryption process is generally divided into three processes. First, generate the key. Second, the chaos matrix password is generated according to the LCS and SCS chaos formulas). Third, image sector encryption algorithm with two rounds of diffusion and scrambling simultaneously.

thumbnail
Fig 21. Image encryption algorithm flow chart.

https://doi.org/10.1371/journal.pone.0310279.g021

3.1 Key generator

Through the analysis in Section 2.3, this paper uses the chaos mapping of LCS and SCS with better performance, namely Eqs (10) and (11) to generate the chaos matrix. In order to distinguish each parameter and facilitate image encryption, these two formulas are rewritten, as shown in Eqs (13) and (14).

(13)(14)

The corresponding keys include a total of 8 keys for the chaos system, including 6 system control parameters a1 ∈ [0,1], a2 ∈ [0,1], β1 > 0, β2 > 0,θ1 ∈ [0,1], θ2 ∈ [0,1] and 2 system initial values x0 ∈ [0,1]. In order to expand the key space and enhance the ability of the image encryption algorithm to resist attacks, this article uses the SHA-256 function to generate keys. Specific steps are as follows.

Using the SHA-256 function based on the plain color image P, the 256-bit hash value K can be obtained. Then, K is divided into 32 ks, each k is 8 bits. As shown in Eq (15). 1 ≤ u ≤ 32.

(15)

Calculate the six system control parameters and K, as shown in Eqs (16)–(18).

(16)(17)(18)

The purpose of multiplying by 0.001 is to produce small changes in each control parameter. The purpose of the mod operation is to keep the control parameters within their respective value ranges. ⊕ is the XOR operation.

(3) Calculate 12 system initial values xi ∈ [0,1], i = 1, 2,…, 12. and the specific values of a based on ki and plain P. The specific method is in Section 3.2.

3.2 Chaos matrix password generator

This section uses LCS and SCS chaos mapping to generate 6 m × n pseudo-random matrices each as the chaos matrix password. Among them, P is the plain text color image, m is the length of P, n is the width of P, and let m = n. Specific steps are as follows.

(1) Use the parameter values a1, a2, β1, β2, θ1, θ2 calculated by Eqs (16)–(18) as the initial values of Eqs (13) and (14).

(2) In the plain text color image P, three images of red, green, and blue are separated according to the three primary colors principle, called R1, G1, and B1.

(3) Calculate i1, i2, i3, through Eq (19), and calculate j1, j2, j3, through Eq (20). (19) (20) where i1, i2, i3, j1, j2, j3 are used as the row number or column number of a pixel in R1, G1, B1.

(4)According to Eq (21), take out each value in R1, G1, and B1 respectively.

(21)

The purpose of multiplying all x values by 0.001 is to keep their values between 0 and 0.255. And select part of the key from the plain to ensure that the encryption key changes with the plain text each time, which can resist many common attacks.

(5) Put {x1, a1, β1, θ1}, {x2, a1, β1, θ1}, {x3, a1, β1, θ1}, {x4, a1, β1, θ1}, {x5, a1, β1, θ1}, {x6, a1, β1, θ1} respectively into Eq (13) and iterate r times. r = 300, skip the transition form of chaotic mapping. Continue to iterate m × n times to obtain 6 chaos matrix codes {X1}, {X2}, {X3}, {Y1}, {Y2}, {Y3}. Put {x7, a2, β2, θ2}, {x8, a2, β2, θ2}, {x9, a2, β2, θ2}, {x10, a2, β2, θ2}, {x11, a2, β2, θ2}, {x12, a2, β2, θ2} into Eq (14) and iterate r times, skip Transition form through chaotic mapping. Continue to iterate m × n times to obtain 6 chaos matrix codes {X4}, {X5}, {X6}, {Y4}, {Y5}, {Y6}.

3.3 Image sector fast encryption algorithm

The image sector encryption algorithm based on LCS and SCS chaotic mapping is shown in Figs 22 and 23.

thumbnail
Fig 22. First round of image sector fast encryption algorithm diagram.

https://doi.org/10.1371/journal.pone.0310279.g022

thumbnail
Fig 23. Second round of image sector fast encryption algorithm diagram.

https://doi.org/10.1371/journal.pone.0310279.g023

As can be seen in these two figures, the encryption process is like unfolding a traditional Chinese folding fan. Moreover, during the encryption process, diffusion and scrambling are performed alternately at the same time, which improves the encryption speed. Therefore, it is called the image sector fast encryption algorithm. Fig 22 shows the first round of encryption, starting from the upper left corner of the image and ending at the lower right corner, encrypting R1, G1, B1 to R2, G2, B2. Fig 23 shows the second round of encryption, starting from the lower right corner of the image and ending at the upper left corner, encrypting R2, G2, B2 to R3, G3, B3. The chaos matrix {X1}, {X2}, {X3}, {X4}, {X5}, {X6} generated through Section 3.2 is used for diffusion. The generated chaos matrix {Y1}, {Y2}, {Y3}, {Y4}, {Y5}, {Y6} is used for scrambling. Specific steps are as follows.

The first round of encryption starts from the upper left corner. R1(1,1) is diffused into R2(1,1) through Eq (22).

(22)

(2) If it is the first row element of the image, R1(1, j) is diffused into R2(1, j) through Eq (23). j = 2, 3,…, n.

(23)

The scrambling method of R2(1, j) is shown in Figs 24 and 25. Record the corresponding relationship between each pixel point at the same position of R2(1, j) and Y1(1, j), as shown in Fig 24. Arrange Y1(1, j) and its first three pixels in ascending order using the selection sort algorithm. Disorganize the pixels of R2(1, j) according to the position of the corresponding pixel of Y1(1, j), as shown in Fig 25.

If it is the first column element of the image, R1(i, 1) is diffused into R2(i, 1) through Eq (24). i = 2, 3,…, m.

(24)

The scrambling method of R2(i,1) is shown in Figs 26 and 27. Record the corresponding relationship between each pixel point at the same position of R2(i,1) and Y1(i,1), as shown in Fig 26. Arrange Y1(i,1) and its first three pixels in ascending order using the selection sort algorithm. Disorganize the pixels of R2(i,1) according to the position of the corresponding pixel of Y1(i,1), as shown in Fig 27.

If it is not the first row or column element of the image, R1(i, j) is diffused into R2(i, j) through Eq (25). i = 2, 3,…, m, j = 2, 3,…, n.

(25)

The scrambling method of R2(i, j) is shown in Figs 28 and 29. Record the corresponding relationship between each pixel point at the same position of R2(i, j), R2(i-1, j), R2(i, j-1), R2(i-1, j-1) and Y1(i, j), Y1(i-1, j), Y1(i, j-1), Y1(i-1, j-1) as shown in Fig 28. Arrange the four pixels of Y1(i, j), Y1(i-1, j), Y1(i, j-1), Y1(i-1, j-1) in ascending order using the selection sort algorithm. After sorting R2(i, j), R2(i-1, j), R2(i, j-1), R2(i-1, j-1) in ascending order of Y1(i, j), Y1(i-1, j), Y1(i, j-1), Y1(i-1, j-1) the position of the corresponding pixel is scrambled, as shown in Fig 29.

(8) (1)—(7) are the first round of encryption, the process of R1 turning into R2. The encryption process of G1 and B1 is similar to the encryption process of R1. Diffusion calculation of G1 and X2, scrambling calculation of G1 and Y2, diffusion calculation of B1 and X3, scrambling calculation of B1 and Y3, and G2, B2 is obtained.

(9) The second round of encryption starts from the lower right corner of R2. R2(m, n) is diffused into R3(m, n) through Eq (26).

(26)

(10) If it is the last row element of the image, R2(m, j) will be diffused into R3(m, j) through Eq (27). j = 2, 3,…, n.

(27)

(11) The scrambling method of R3(m, j) is the same as (3). R3(m, j) and Y4(m, j) are calculated. The specific method is the same as the calculation method of R2(1, j) and Y1(1, j) in Fig 7.

(12) If it is the last column element of the image, R2(i, n) is diffused into R3(i, n) through Eq (28). i = 2, 3,…, m.

(28)

(13) The scrambling method of R3(i, n) is the same as (5). R3(i, n) and Y4(i, n) are calculated. The specific method is the same as the calculation method of R2(i, 1) and Y1(i, 1) in Fig 8.

(14) If it is not the last row or column element of the image, R2(i, j) is diffused into R3(i, j) through Eq (29). i = 2, 3,…, m, j = 2, 3,…, n.

(29)

(15) The scrambling method of R3(i, j) is the same as (7). Calculate R3(i, j), R3(i+1, j), R3(i, j+1), R3(i+1, j+1) and R3(i, j), R3(i+1, j), R3(i, j+1), R3(i+1, j+1) the specific method is the same as the calculation method of each element in Fig 9.

(16) (9)—(15) is the second round of encryption, the process of R2 turning into R3. The encryption process of G2 and B2 is similar to the encryption process of R2. Diffusion calculation of G2 and X5, scrambling calculation of G2 and Y5, diffusion calculation of B2 and X6, scrambling calculation of B2 and Y6, and G3, B3 is obtained.

(17) Combine R3, G3, B3 into cipher C, and the encryption algorithm ends.

thumbnail
Fig 24. The corresponding relationship between R2(1, j) and Y1(1, j).

https://doi.org/10.1371/journal.pone.0310279.g024

thumbnail
Fig 25. R2(1, j) scrambles the pixels according to Y1(1, j).

https://doi.org/10.1371/journal.pone.0310279.g025

thumbnail
Fig 26. The corresponding relationship between R2(i, 1) and Y1(i, 1).

https://doi.org/10.1371/journal.pone.0310279.g026

thumbnail
Fig 27. R2(i, 1) scrambles the pixels according to Y1(i, 1).

https://doi.org/10.1371/journal.pone.0310279.g027

thumbnail
Fig 28. Correspondence between the four points of R2 and the four points of Y1.

https://doi.org/10.1371/journal.pone.0310279.g028

thumbnail
Fig 29. The four points of R2 scramble the pixels according to the four points of Y1.

https://doi.org/10.1371/journal.pone.0310279.g029

3.4 Image decryption algorithm

The flow chart of this image decryption algorithm is shown in Fig 30. Reverse the entire encryption process. Enter the cipher and key to get the plain. The specific process will not be explained in detail.

thumbnail
Fig 30. Image decryption algorithm flow chart.

https://doi.org/10.1371/journal.pone.0310279.g030

4 Experimental results and analysis

4.1 Experimental environment and results

4.1.1 Experimental environment.

(1) Hardware environment: Intel Core i9-12900H 14-core processor, main frequency is 2.50GHz. The memory is DDR5 4800MHz 32GB. 1TB SSD.

(2) Software environment: Windows 11 Home Edition, Matlab R2018b.

4.1.2 Experimental results.

The experimental images in this article use the USC-SIPI database. The URL of the database is http://sipi.usc.edu/database/. The experiment uses color images of 256×256 size. The encryption and decryption results of the Pepper image are shown in Figs 3142.

Fig 31 is colored plain text. Figs 3234 are the plain decomposed into three channels of red, green and blue, and Figs 3537 are the cipher after three-channel encryption. Fig 38 is the color cipher merged with the three-channel cipher. Figs 3941 are the plain after three-channel decryption. Fig 42 is the colored plain merged with plain after three-channel decryption. The following is a comparison of various indicators between the algorithm in this article and other fast image encryption algorithms.

4.2 Experimental performance analysis

4.2.1 Encryption and decryption speed.

The speed of image encryption and decryption based on chaos mapping depends on multiple factors, including the selected encryption algorithm, computer hardware performance, image size and complexity, etc. Here we introduce the experiments under the above-mentioned software and hardware configuration. After experimenting with 20 pictures, the average experimental results are compared with the encryption and decryption speeds of references, as shown in Table 2.

thumbnail
Table 2. Encryption and decryption time (unit: Seconds).

https://doi.org/10.1371/journal.pone.0310279.t002

As can be seen from Table 2, the encryption and decryption time of this algorithm is shorter. In the era of big data, image data sets are getting larger and larger. Algorithms with short encryption and decryption times have more application prospects.

About the time complexity of this algorithm. Assume that the size of the plain image is m×n. The chaotic system iteratively generates 12 chaotic sequences with a length of mn. The computational complexity is 12mn. Two rounds of diffusion + scrambling encryption process, each round generates 3 ciphers, and the computational complexity is 2×2×3×mn = 12mn. Overall, the time complexity of the algorithm in this chapter is O(24mn). This time complexity is acceptable.

4.2.2 Keys space.

In this encryption algorithm, the keys involved are a1, a1, a2, β1, β2, θ1, θ2, i1, i2, i3, j1, j2, j3, a total of 12 keys. The calculation of each key uses 2 value of k in Eq (15). Each k is 8 bits. Therefore, the key space is ((28)2)12 = 2192>2100, which is enough to resist exhaustive attacks. The comparison between the key space of this paper experiments and other literature is shown in Table 3. The key space of the algorithm in this chapter is not the largest. However, on the basis of resisting exhaustive attacks, a smaller key space can increase the encryption speed.

4.2.3 Correlation coefficient.

The correlation coefficient of chaos map image encryption is an indicator used to evaluate the performance of encryption algorithms. The correlation coefficient is often used to compare the similarity between plain and cipher to measure the quality of image encryption algorithms. The value of the correlation coefficient can provide a measure of the degree of encryption protection of an image.

The correlation coefficient is usually expressed as a value ranging from -1 to 1 and has the following meaning:

  1. If the correlation coefficient is equal to 1, it means that the original image and the encrypted image are exactly the same, there is no information loss, and the encryption is perfect.
  2. If the correlation coefficient is close to 1, it means that the original image and the encrypted image are very similar, but there may be some minor changes or noise.
  3. If the correlation coefficient is close to 0, it means that there is no obvious similarity between the original image and the encrypted image, and encryption leads to large information changes.
  4. If the correlation coefficient is close to -1, it means that the original image and the encrypted image are completely different, and encryption has caused serious information changes.

The correlation coefficient is calculated through Eqs (30)–(33).

(30)(31)(32)(33)

Among them, R represents the number of pixels in the picture. E (X), E (Y) represent the mathematical expectations of X, Y respectively. D (X), D (Y) represents the variance of X, Y. COV (X, Y) represents the covariance of X, Y. rXY represents the correlation coefficient of X, Y.

Through the calculation of Formulas (30) to (33), the pepper image is encrypted using the algorithm in this paper. The experimental results of the correlation coefficient of the image are shown in Table 4. Each value is rounded to four decimal places. The correlation coefficient of plain text images is close to 1. The correlation coefficient of the corresponding cipher image is close to 0. It shows that the algorithm in this paper eliminates the correlation between adjacent pixels. The average cipher correlation coefficient of the algorithm in this chapter and the comparative experimental results of different schemes are shown in Table 5. Compared with other algorithms, the cipher correlation coefficient of the algorithm proposed in this chapter is not inferior to other algorithms. Achieved better performance in image encryption effect. As can be seen from Table 4, the correlation coefficient of this algorithm is close to -1, which can reach the cipher standard. The correlation coefficient image of Pepper is shown in Figs 4360.

thumbnail
Table 4. The plain correlation coefficient of the algorithm.

https://doi.org/10.1371/journal.pone.0310279.t004

As can be seen from Figs 4360, there is a strong correlation between each pixel of the plain, while there is basically no correlation between each pixel of the cipher.

4.2.4 Histogram.

Chaos Map Image Encryption Histogram is a tool used to visualize the distribution of pixels in an image. It shows the frequency distribution of pixel values for each color channel in the image. It helps in understanding the brightness and contrast distribution of an image. In chaos map image encryption, histograms can be used to analyze the quality of the encrypted and decrypted images and whether there are abnormal or unusual distributions. The histogram of the pepper image in this algorithm experiment is shown in Figs 6166.

As can be seen from Figs 6166, the value of each pixel in the cipher histogram encrypted by this algorithm is relatively balanced. This can meet encryption requirements.

4.2.5 Information entropy.

The information entropy of chaos map image encryption is an indicator used to measure the quality of image encryption. Information entropy is a concept that measures the uncertainty or confusion of information. In image encryption, information entropy can be used to evaluate the randomness and information protection capabilities of encrypted images. Theoretically, the closer to the theoretical value 8, the stronger the randomness. Information entropy is calculated through Eq (34). (34) where H represents information entropy, L represents the number of grayscale levels of the image, and p(i) represents the probability of occurrence of grayscale value i.

Through the calculation of Equation (2.11), the information entropy of the plain and cipher images of the algorithm in this chapter is shown in Table 6. The information entropy value is accurate to four decimal places. The comparison between the average information entropy of this algorithm and other literature is shown in Table 7. It can be seen from the table that the information entropy of this algorithm is closer to the ideal value and can resist entropy attacks.

4.2.6 Key sensitivity.

The key sensitivity of chaos map image encryption refers to the sensitivity of the encryption process to small changes in the key. In a chaotic map, small changes in the key can lead to completely different encryption results. The greater the difference between the cipher, the better the performance of the encryption algorithm.

The detection of key sensitivity of this algorithm is shown in Figs 6769. Fig 67 is the cipher encrypted for the first time. Fig 68 shows the cipher when the key changes by 10−6. Fig 69 shows the difference between the two ciphers. As you can see, the two pictures are quite different.

thumbnail
Fig 68. The cipher when the key changes by 10−6.

https://doi.org/10.1371/journal.pone.0310279.g068

4.2.7 Plain sensitivity.

The plain sensitivity of chaotic map image encryption refers to the sensitivity to small changes in the plain image. During the encryption process, small changes in the plain image may lead to fundamental changes in the cipher image. The greater the difference between ciphers, the better the performance of the encryption algorithm, which can resist differential attacks or selected plain attacks. The plain sensitivity is calculated by Eqs (35)–(37).

(35)(36)(37)

In Eq (35), M represents the length of the two images, and N represents the width of the two images. NPCR represents the ratio of the number of different pixels in two different images P1 and P2 to the number of all pixels. Sign () is a sign function, and its meaning is shown in Eq (36). The theoretical NPCR value of the two images is 99.6094%.

In Eq (37), UACI represents the average of the ratio of the difference to the maximum difference between the pixels at the corresponding positions of two different images P1 and P2. The theoretical value is 33.4635%. σ is the maximum difference between the two images.

The plain sensitivity experiment randomly changes the plain of each graph by 10−8 and iterates 100 times. Through the calculation of Eqs (35)–(37), the average experimental results are shown in Table 8. Accurate to four decimal places. The comparison of the average NPCR and UACI values of the algorithm experiments in this chapter with other literature is shown in Table 9. The algorithm in this chapter has achieved satisfactory performance, and NPCR and UACI are close to ideal values. Therefore, the encryption algorithm in this chapter is very sensitive to small changes in the plain image. It can effectively resist known plain attacks, chosen plain attacks and differential attacks.

4.2.8 Robustness.

The robustness of chaos map image encryption refers to the ability of an encryption system to maintain its performance and protect image data in the face of various attacks and interferences. Robustness is one of the important indicators to measure the strength and reliability of encryption algorithms. This paper uses two methods, noise attack and loss of information, to test the performance of the image encryption algorithm.

In order to evaluate the robustness of the algorithm in this chapter, 0.1% and 0.3% salt and pepper noise were added to the cipher image respectively. Then the noisy cipher image was decrypted. After decryption, the approximate original image information can still be restored. This shows that the algorithm is effective. Figs 7073 show the result of adding noise to a cipher image and decrypted it.

The loss of information experiment is shown in Figs 74, 75, taking the pepper image as an example. Fig 74 shows the cipher with part of the information lost. Fig 75 shows the decrypted plain of Fig 74. After losing some information, the basic information of the image can still be retained. Experiments show that the algorithm in this paper has good robustness and can resist certain noise attacks and information loss.

thumbnail
Fig 74. The cipher after some information is lost.

https://doi.org/10.1371/journal.pone.0310279.g074

5 Conclusion

Image encryption algorithms based on chaos theory emerge in endlessly. Based on previous various chaotic image fast encryption algorithms, this paper proposes a color image sector fast encryption algorithm based on one-dimensional composite sinusoidal chaotic mapping. First, by combining four basic chaos maps in pairs and adding sine operations, six one-dimensional composite sinusoidal chaos maps (CSCM) are obtained. Second, select the two best chaotic mappings LCS and SCS, and verify the randomness of these two chaotic mappings through Lyapunov index and NIST SP 800–22 randomness tests. Third, the encryption process is unfolded according to the shape of a traditional Chinese fan, and the diffusion and scrambling of each pixel of the image are performed in parallel, greatly improving the encryption speed. When diffusing, changing the value of one pixel can affect the values of multiple subsequent pixels. When scrambling, each pixel changes position with the three pixels before it according to the chaotic sequence. Finally, multiple experiments have proven that this image encryption algorithm not only greatly improves the encryption and decryption speed, but also expands the key space, and can also meet the standards in terms of correlation coefficient, histogram, information entropy, key sensitivity, plain sensitivity, etc. The algorithm can also resist some common attacks and accidents, such as exhaustive attacks, differential attacks, entropy attack, noise attacks, information loss, diffusion or scrambling attack respectively, etc. The algorithm will continue to be optimized in the future. Strive to continue to improve the NPCR value and encryption speed of this algorithm.

References

  1. 1. Zhou S, Wang X, Zhang Y. Novel image encryption scheme based on chaotic signals with finite-precision error. Information Sciences, 2022, 621: 782–798.
  2. 2. Zhou S, Wang X, Zhang Y, et al. A novel image encryption cryptosystem based on true random numbers and chaotic systems. Multimedia Systems, 2022: 1–18.
  3. 3. Zhou S, Qiu Y, Wang X, et al. Novel image cryptosystem based on new 2D hyperchaotic map and dynamical chaotic S-box. Nonlinear Dynamics, 2023, 111(10): 9571–9589.
  4. 4. Ye X, Wang X, Gao S, et al. A new chaotic circuit with multiple memristors and its application in image encryption. Nonlinear Dynamics, 2020, 99: 1489–1506.
  5. 5. Ye X, Wang X. Hidden oscillation and chaotic sea in a novel 3d chaotic system with exponential function. Nonlinear Dynamics, 2023, 111(16): 15477–15486.
  6. 6. Tao Y, Cui W H, Zhang Z. Spatiotemporal chaos in multiple dynamically coupled map lattices and its application in a novel image encryption algorithm. Journal of Information Security and Applications, 2020, 55(1): 102650.
  7. 7. Wang X, Feng L, Li R, et al. A fast image encryption algorithm based on non-adjacent dynamically coupled map lattice model. Nonlinear Dynamics, 2019, 95(4): 2797–2824.
  8. 8. Lin Z, Liu J, Lian J, et al. A novel fast image encryption algorithm for embedded systems. Multimedia Tools and Applications, 2019, 78(14): 20511–20531.
  9. 9. Hanis S, Amutha R. A fast double-keyed authenticated image encryption scheme using an improved chaotic map and a butterfly-like structure. Nonlinear Dynamics, 2019, 95(1): 421–432.
  10. 10. Stalin S, Maheshwary P, Shukla P K, et al. Fast and Secure Medical Image Encryption Based on Non Linear 4D Logistic Map and DNA Sequences (NL4DLM_DNA). Journal of Medical Systems, 2019, 43(8): 267. pmid:31273461
  11. 11. Abdelfatah R I. A new fast double-chaotic based Image encryption scheme. Multimedia Tools and Applications, 2020, 79(1–2): 1241–1259.
  12. 12. Gupta M, Gupta K K, Shukla P K. Session key based fast, secure and lightweight image encryption algorithm. Multimedia Tools and Applications, 2021, 80(7): 10391–10416.
  13. 13. Talhaoui M Z, Wang X, Midoun M A. Fast image encryption algorithm with high security level using the Bülban chaotic map. Journal of Real-Time Image Processing, 2021, 18(1): 85–98.
  14. 14. Kang S W, Choi U S, Cho S J. Fast image encryption algorithm based on (n, m, k)—PCMLCA. Multimedia Tools and Applications, 2022, 81(1): 1209–1235.
  15. 15. Gao X, Mou J, Xiong L, et al. A fast and efficient multiple images encryption based on single-channel encryption and chaotic system. Nonlinear Dynamics, 2022, 108(1): 613–636.
  16. 16. Brahim A H, Pacha A A, Said N H. A new fast image compression–encryption scheme based on compressive sensing and parallel blocks. The Journal of Supercomputing, 2022, 79(8): 8843–8889.
  17. 17. Tang J, Zhang F, Ni H. A novel fast image encryption scheme based on a new one-dimensional compound sine chaotic system. The Visual Computer, 2022, 39(10): 4955–4983.
  18. 18. Eyebe Fouda J S A, Koepf W. An 8-bit precision cipher for fast image encryption. Multimedia Tools and Applications, 2022, 81(23): 34027–34046.
  19. 19. Zhang Z, Zhang J. Parallel multi-image encryption based on cross-plane DNA manipulation and a novel 2D chaotic system[J]. The Visual Computer, 2024: 1–23.
  20. 20. Wang X, Zhao H. Fast image encryption algorithm based on parallel computing system. Multimedia Tools and Applications, 2019, 486: 340–358.
  21. 21. Li T, Fan W, Wu J, et al. Image encryption based on a fractional-order hyperchaotic system and fast row-column-level joint permutation and diffusion[J]. Nonlinear Dynamics, 2024, 112(12): 10555–10581.
  22. 22. Ma X, Wang C, Qiu W, et al. A fast hyperchaotic image encryption scheme[J]. International Journal of Bifurcation and Chaos, 2023, 33(05): 2350061.
  23. 23. Cao C, Sun K, Liu W. A novel bit-level image encryption algorithm based on 2D-LICM hyperchaotic map. Signal Process. 2018, 143: 122–133.
  24. 24. Gan Z, Chai X, Han D, Chen Y. A chaotic image encryption algorithm based on 3-D bit-plane permutation. Neural Computing and Applications. 2019, 31(11): 7111–7130.
  25. 25. Liu H, Kadir A, Gong P. A fast color image encryption scheme using one-time S-Boxes based on complex chaotic system and random noise. Optics. Communications. 2015, 338: 340–347.
  26. 26. Zhu H, Dai L, Liu Y, Wu L. A three-dimensional bit-level image encryption algorithm with Rubik’s cube method. Mathematics and Computers in Simulation. 2021, 185: 754–770.
  27. 27. Chen Z, Yuan X, Yuan Y, et al. Parameter identification of chaotic and hyper-chaotic systems using synchronization-based parameter observer. IEEE Transactions on Biomedical Circuits and Systems. 2016, 63(9): 1464–1475.
  28. 28. Alawida M, Samsudin A, Teh J S, et al. A new hybrid digital chaotic system with applications in image encryption. Signal Process. 2019, 160: 45–58.
  29. 29. El-Latif A A, Niu X. A hybrid chaotic system and cyclic elliptic curve for image encryption. AEU-Inernational Journal of Electronics and Communications. 2013, 67(2): 136–143.
  30. 30. Wang G, Yuan F. Cascade chaos and its dynamic characteristics. ACTA Physical Sinica. 2013, 62(2): 111–120.