Next Article in Journal
An Overview of Technologies for Improving Storage Efficiency in Blockchain-Based IIoT Applications
Previous Article in Journal
Method for Direct Localization of Multiple Impulse Acoustic Sources in Outdoor Environment
Previous Article in Special Issue
Research on the Effectiveness of Cyber Security Awareness in ICS Risk Assessment Frameworks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Color Image Encryption Algorithm Based on Dynamic Block Zigzag Transformation and Six-Sided Star Model

School of Information and Control Engineering, China University of Mining and Technology, Xuzhou 221116, China
*
Author to whom correspondence should be addressed.
Electronics 2022, 11(16), 2512; https://doi.org/10.3390/electronics11162512
Submission received: 18 July 2022 / Revised: 5 August 2022 / Accepted: 8 August 2022 / Published: 11 August 2022
(This article belongs to the Special Issue Security Governance & Information Security Management Systems)

Abstract

:
As a result of the rise in network technology, information security has become particularly important. Digital images play an important role in network transmission. To improve their security and efficiency, a new color image encryption algorithm is proposed. The proposed algorithm adopts a classical scrambling–diffusion framework. In the scrambling stage, the dynamic block Zigzag transformation is designed by combining the chaotic sequence with the standard Zigzag transformation, which can dynamically select the transformation range and the number of times. It is used to scramble the pixel positions in the R, G, and B components. In the diffusion stage, the six-sided star model is established by combining the chaotic sequence and the six-sided star structure characteristics, which can store the 24 bits of the pixel in a defined order to realize bit-level diffusion operation. Experimental analyses indicate that our algorithm has the characteristics of high key sensitivity, large key space, high efficiency, and resistance to plaintext attacks, statistical attacks, etc.

1. Introduction

As information security has fully entered the digital age, digital images have become an important form of information transmission. Images are more vivid and intuitive, and the amount of information is larger compared with traditional text information. From the perspective of countries or enterprises, a large amount of sensitive information, such as scientific research, and financial and military secrets, is extremely vulnerable to attack or theft. From a personal point of view, images are an important medium for people to record their personal lives and daily communications. If measures are not taken to prevent them, cyber attackers can exploit network vulnerabilities to steal private information [1]. Therefore, the protection of digital image information is very important in theory and practice. The most intuitive means of protection is encrypting the plain image. However, the encryption efficiency of traditional encryption schemes used to encrypt images is low [2,3]. Therefore, it is crucial to study secure and efficient algorithms.
In recent years, the algorithms proposed by scholars for image encryption have been mainly based on chaos theory, optical transformation, DNA encoding, and compressed sensing. These theories are used to design various image encryption algorithms to change the pixel positions and values. Munazah et al. proposed an image encryption method based on double chaotic maps. The chaotic sequence generated by the chaotic system is used to change the image pixel positions [4]. Wang et al. designed an optical image cryptosystem. The quadratic phase and double phase methods are firstly applied to generate the phase-only hologram, and then it is encrypted. The encrypted image is finally obtained by learning the probability distribution [5]. Younes et al. proposed an image encryption algorithm based on genetic operations and chaotic DNA encoding, which applied the biological DNA theory to the algorithm, and designed a unique encoding method to change pixel values [6]. Yang et al. proposed an image encryption scheme based on compressive sensing, which firstly compresses the image and then encrypts it. To a certain extent, the space occupied by the image transmission is reduced to improve the scheme’s efficiency [7]. Although many image encryption algorithms have been proposed to date, most of them take a single grayscale image as the research object, and the security and efficiency of the algorithm cannot be guaranteed. In this paper, a new algorithm is proposed to improve security and efficiency.
The chaotic system has the advantages of being sensitive to the initial value, having good randomness, and is not easily cracked, all of which are consistent with the requirements of cryptography [8]. The chaotic system has been widely used and studied in image encryption [9,10,11]. In 1989, the mathematician Matthews firstly introduced chaos into encryption systems, and proposed and explained the concept of chaotic cryptography [12]. Compared with the traditional image encryption methods, the encryption method based on the chaotic system has higher encryption efficiency. Therefore, image encryption schemes based on chaotic systems have been proposed by more researchers [13,14,15]. Wang et al. used the improved one-dimensional (1D) Logistic map to scramble pixel positions [16]. Naskar P. K. et al. used the Logistic map for the diffusion operation [17]. However, at the same time, the cracking technology of illegal hackers is also becoming increasingly mature. If only a single chaotic system is used in the encryption algorithm, the cipher can be easily deciphered by illegal attackers. Therefore, designing an efficient and secure image encryption algorithm needs to combine the chaotic system with other encryption methods. The Sine-Exponent-Tent (SET) chaotic system [18] is used to obtain the chaotic sequence, and the parameters of the SET chaotic system are viewed as the master key in this paper. The SET chaotic system is secure for image encryption and is a well-known system due to its complex dynamic characteristic.
The standard Zigzag transformation is a scrambling method that starts from the upper-left corner of the elements in the matrix [19]. This transformation uses a “Z”-shaped path to store the scanned elements in a 1D array, and the 1D array is converted into a two-dimensional (2D) matrix in a particular manner. Many scholars have used the Zigzag transformation to realize the scrambling operation [20,21,22]. In the algorithm proposed by Chai et al., the 2D Zigzag transformation requires multiple global loops [23]. In the algorithm by Li et al., the 2D Zigzag transformation only has one starting point [24]. Zhang et al. proposed a new Zigzag transform algorithm [25]. To break the limitations of the square matrix, Wang et al. applied the Zigzag transformation to the non-square matrix to expand its scope of application [26]. To solve the problem of the single starting point, Wang et al. extended the starting point from the upper-left corner to the other three corners [27]. Although the standard Zigzag transformation can effectively scramble pixel positions, some adjacent values in special positions of the image cannot be scrambled, and the obvious horizontal texture characteristics and the high correlation coefficient lie in the horizontal direction. Therefore, the dynamic block Zigzag transformation is proposed in the scrambling stage.
The color image encryption (CIE) algorithm usually encrypts the three components of R, G, and B separately and then combines them into a color image [28]. Alternatively, a large grayscale image is combined by breaking up the three components, which encrypt and restore the original size [29]. Zhang et al. proposed a CIE algorithm based on image hashing, six-dimensional hyper chaos, and dynamic DNA encoding. Firstly, the color image is preprocessed, and the hash sequence is extracted by the hash algorithm, which is used as the initial value and control parameter of the chaotic system. Secondly, the three components of the color image R, G, and B are combined into a 2D matrix, followed by pixel replacement, DNA dynamic coding, and arithmetic operations. Finally, the encrypted image can be obtained by combining the three components [30].
Wang et al. proposed a CIE scheme based on a hash function, the discrete wavelet transform, and chaotic mapping. In this algorithm, the wavelet transform is used to decompose the three components in the plaint image into four sub-bands. These sub-bands are scrambled, reduced, inverted, and exchanged, and the image reconstructed by inverse discrete wavelet transform is further analyzed. Then, the encrypted images obtained by the three components are combined and recombined to obtain the required encrypted images [31]. Zhang et al. proposed an image-encrypting algorithm based on 3D Zigzag transformation and view planes, which adopted the classical scrambling–diffusion framework [32]. The chaotic sequences are generated by the pseudo-random number generator system to achieve the encrypted process. The pixel positions are changed by 3D Zigzag transformation and the pixel values are diffused by the view planes. After continuous research by countless scholars, CIE technology has gradually taken shape. By combining the chaotic system and the scrambling method, the scrambling–diffusion framework can meet most of the encryption needs. However, some space for improvement remains in the existing encryption algorithms.
To improve the security and efficiency, a new CIE algorithm is proposed. The main contributions of this paper are described as follows: (1) Combining the block principle and the standard Zigzag transformation, the dynamic block Zigzag transformation is proposed to change the pixel position in the R, G, and B components; (2) Inspired by the six-sided star, the six-sided star model is established to replace pixel values. This transformation can effectively realize pixel replacement and eliminate the correlation between pixels. A CIE algorithm is devised based on dynamic block Zigzag transformation and the six-sided star model, which can encrypt the color image. Our algorithm uses the classical scrambling–diffusion framework; (3) Experimental results and algorithm analyses verify the feasibility and superiority of the proposed algorithm.The remainder of this paper is arranged as follows: Section 2 presents definitions and theories. Section 3 proposes a new CIE algorithm. Section 4 presents the experimental results and analyses. Conclusions are drawn in Section 5.

2. Preliminary Works

The encrypted image is obtained through the encryption key and the encryption algorithm. The encrypted image is transmitted to the receiving end through the communication channel, and the key is transmitted through the secure channel. After the receiving finally obtains the encrypted image, the decryption algorithm and the decryption key are used to decrypt the encrypted image to obtain the plain images. During the transmission of the image, even if the encrypted image is attacked, it is difficult for the attacker to obtain the real information of the image without the decryption algorithm and decryption key. The encryption algorithm is designed based on the scrambling and diffusion operations, and the decryption algorithm is the inverse process of the encryption algorithm. The frame diagram is shown in Figure 1.

2.1. SET Chaotic System

The SET chaotic system can produce chaotic phenomena [17]. Its iterative formula is:
x i + 1 = a sin ( π x i ) ln ( 2 b min { x i , 1 - x i } + c ) ,
where i is the number of iterations, and a, b, are the control parameters. When a = 1.01, b ( 0 , 1 ) and c ( 2 , 3 ) , the SET chaotic system is in the chaotic state.
The bifurcation diagram of the SET chaotic system is drawn in Figure 2 when the parameter c = 2.8316, and b ranges from 0 to 1. Figure 3 shows the bifurcation diagram when the parameter b = 0.8512, and c ranges from 2 to 3. This chaotic system behaves well and can be used for encryption algorithms.

2.2. Standard Zigzag Transformation

In the field of image encryption, the Zigzag transformation is a scrambling method for pixel dislocation. It is simple and its key period is large. The standard Zigzag transformation starts from the upper-left corner, and it is suitable for the square matrix [20]. The two matrices of 4 × 4 are illustrated in Figure 4 to represent the matrices before and after the standard Zigzag transformation.

2.3. Dynamic Block Zigzag Transformation

2.3.1. Algorithm Description

Multiple small-area dynamic block Zigzag transformation is designed to replace the standard Zigzag transformation for the entire image. The transformation performs several rounds in succession and the specific processes are described as follows.
Step 1: Generating scrambled blocks
The chaotic sequence is used to generate the coordinate values to limit the transformation blocks’ region range. The algorithm performs several rounds of transformation in succession. Each round has two pairs of coordinate values, which represents the scope of the Zigzag transformation in each round of blocks. When generating the point range, it is necessary to ensure that all points in the entire image can participate in at least one transformation.
A total of 4v numbers are taken from the chaotic sequence and converted into integers. According to Equations (2) and (3), they are changed into an integer stream in the range of [1, 1024], which is used to generate a coordinate of the limiting transform region range.
L = f l o o r ( L ( 1 : 4 v ) × 1 0 8 ) ,
X = mod ( L ( 1 : v ) , 1024 ) + 1 Y = mod ( L ( v + 1 : 2 v ) , 1024 ) + 1 Z = mod ( L ( 2 v + 1 : 3 v ) , 1024 ) + 1 W = mod ( L ( 3 v + 1 : 4 v ) , 1024 ) + 1 ,
where 4v >max (m, n).
In the i-th round of transformation, the numbers xi, yi, zi, and wi are taken from X, Y, Z, and W respectively. Two pairs of coordinates are generated using Equations (4) and (5), which represent the coordinates of the upper-left corner and the lower-right corner of the Zigzag transformation area, respectively. To ensure that the edge part can participate in the transformation, when the abscissa and ordinate values are less than or equal to 256, the value is 1, and when the value is greater than or equal to 768, the value is 512. The specific values are realized by the maximum and minimum functions.
x i = min max x i - 256 , 1 , 512 y i = min max y i - 256 , 1 , 512 z i = min max z i - 256 , 1 , 512 w i = min max w i - 256 , 1 , 512 ,
l i = min x i , z i r i = max x i , z i u i = min y i , w i o i = max y i , w ,
where i is the number of the dynamic block Zigzag transformation rounds.
Step 2: Markup after scrambling
The Zigzag transformation is achieved about the area from (li, ui) as the upper-left corner to (ri, oi) as the lower-right corner. An all-zero matrix Count of size m × n is used to mark each point participating in the transformation. Each time a region is scrambled, the value of all points in this region changes from 0 to 1.
Step 3: Judging and generating next round coordinates
The two pairs of coordinates for the next transformation are chosen from the coordinates outside the area. To judge whether Count (li+1, ui+1) and Count (ri+1, oi+1) are all 0, assuming C o u n t l i + 1 ,   u i + 1 0 or C o u n t r i + 1 ,   o i + 1 0 , take point (li+1, ui+1) or (ri+1, oi+1) as the center, and search for points that are not 0 by circle diffusion in turn; this point is defined as the most recent point that has not been traversed.
Step 4: Stop scrambling
When all areas have participated in the transformation, that is, the sum of all coordinate points of the Count matrix is equal to m × n, the scrambling stops. The scrambled image can be obtained after transformation. The Algorithm 1 shows the scrambling process.
Algorithm 1: Image scrambling
Input: Image I, sequence L
Output: Scrambled image P
1:  P = I
2:  count = zeros(size(I))
3:  L′ = floor(L(1:4v) × 108)
4:  X = mod(L′(1:v), 1024) + 1
5:  Y = mod(L′(v + 1:2v), 1024) + 1
6:  Z = mod(L′(2v + 1:3v), 1024) + 1
7:  W = mod(L′(3v + 1:4v), 1024) + 1
8:  cur = 1
9:  while sum(count)! = m × n do
10:   xi′ = min(max(X(cur) − 256, 1), 512)
11:   yi′ = min(max(Y(cur) − 256, 1), 512)
12:   zi′ = min(max(Z(cur) − 256, 1), 512)
13:   wi′ = min(max(W(cur) − 256, 1), 512)
14:    li = min(xi′, zi′)
15:    ri = max(xi′, zi′)
16:    ui = min(yi′, wi′)
17:    oi = max(yi′, wi′)
18:    P(li : ri : ui : oi) = zigzag(P(li : ri : ui : oi))
19:    count(li : ri : ui : oi) = 1
20:    cur + +
21:  end while

2.3.2. Examples

(a) Finding the nearest not-traversed point
Taking the sixth-order matrix in Figure 5 as an example, search for the nearest points around point 15 that have not been traversed, and then search for point sets (8, 9, 10, 14, 16, 20, 21, 22), point sets (1, 2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 25, 26, 27, 28, 29), and point sets (6, 12, 18, 24, 30, 31, 32, 33, 34, 35, 36) to determine if a point marked as 0 is the most recent point that has not been traversed.
Assuming that the nearest untraversed points of (li+1, ui+1) and (ri+1, oi+1) are (li+1, ui+1) and (ri+1, oi+1), respectively, these two points are substituted into Step 2 for the next round of scrambling.
(b) The dynamic block Zigzag transformation
Taking a sixth-order matrix as an example, the specific process of five rounds transformation is shown in Figure 6.
Step 1: The first round of transformation
The first round of transformation randomly generates point ranges (2, 2) and (3, 4), then Zigzag transformation is executed on the point set (8, 9, 10, 14, 15, 16) in this range to obtain the point set (8, 9, 14, 15, 10, 16).
Step 2: The second round of transformation
The second round of transformation randomly generates point ranges (3, 3) and (5, 5), then Zigzag transformation is executed on the point set (10, 16, 17, 21, 22, 23, 27, 28, 29) in this range to obtain the point set (10, 16, 21, 27, 22, 17, 23, 28, 29).
Step 3: The third round of transformation
The third round of transformation randomly generates point ranges (1, 1) and (2, 5), then Zigzag transformation is executed on the point set (1, 2, 3, 4, 5, 7, 8, 9, 14, 11) in this range to obtain the point set (1, 2, 7, 8, 3, 4, 9, 14, 5, 11).
Step 4: The fourth round of transformation
The fourth round of transformation randomly generates point ranges (2, 1) and (6, 3), then Zigzag transformation is executed on the point set (4, 9, 14, 13, 15, 10, 19, 20, 27, 25, 26, 23, 31, 32, 33) in this range to obtain the point set (4, 9, 13, 19, 15, 14, 10, 20, 25, 31, 26, 27, 23, 32, 33).
Step 5: The fifth round of transformation
The fifth round of transformation randomly generates point ranges (1, 5) and (6, 6), then Zigzag transformation is executed on the point set (3, 6, 11, 12, 21, 18, 17, 24, 29, 30, 35, 36) in this range to obtain the point set (3, 6, 11, 21, 12, 18, 17, 29, 24, 30, 35, 36).
After the above five rounds of transformation, all points of the original sixth-order matrix participate in the transformation. Due to the constant position of the four points in the upper-left and lower-right corners of Zigzag transformation, some points in the sixth-order matrix are not changed, but this phenomenon is significantly alleviated after extending to images of commonly used sizes and can be ignored.
One round of the dynamic block Zigzag transformation and ordinary Zigzag transformation is performed on an image of peppers, and the obtained scrambled image is shown in Figure 7. The correlation coefficients of its R, G, and B components are shown in Table 1. The comparison shows that the dynamic block Zigzag transformation can greatly reduce the correlation of the transformed image, especially in the horizontal direction.

2.4. Six-Sided Star Model

The six-sided star model is used in the diffusion stage to change image pixel values [33]. Each pixel has three components, R, G, and B; that is, each pixel has a total of 24 bits. The 24 bits are marked as 1 to 24 in the order of R, G, B, and then from high to low, and they are arranged in the six-sided star model in the order of Figure 8. The six-sided star model can be divided into six regions. The specific diffusion process is described by Equation (6):
B 1 = A 1 , 2 , 4 , 5 B 2 = A 3 , 8 , 12 , 10 B 3 = A 18 , 16 , 19 , 14 B 4 = A 24 , 23 , 21 , 20 B 5 = A 22 , 17 , 13 , 15 B 6 = A 7 , 9 , 6 , 11 ,
where A is the 24-bit value, and B1, B2, …, B6 are 4-bit values for the six regions.
B1, B2, …, B6 are calculated as follows:
C 1 = D B 1 C 2 = C 1 B 2 C 3 = C 2 B 3 C 4 = C 3 B 4 C 5 = C 4 B 5 C 6 = C 5 B 6 ,
where ⊕ indicates the exclusive or (XOR) operation, D is a 4-bit chaotic value, and the values of B1, B2, …, B6 are changed to obtain C1, C2, …, C6. The encrypted pixels can be obtained by restoring 24 bits of C to three components. In this way, the high-order and low-order bits inside the pixel are disturbed to realize the change in the pixel value. Algorithm 2 shows the six-sided star diffusion process.
Algorithm 2: Six-sided star diffusion
Input: Pixel A of 24 bits, squence D
Output: Transformed pixel C
1:   B1 = A.bitplaneof (1, 2, 4, 5),
2:   B2 = A.bitplaneof (3, 8, 12, 10),
3:   B3 = A.bitplaneof (18, 16, 19,14),
4:   B4 = A.bitplaneof (24, 23, 21, 20),
5:   B5 = A.bitplaneof (22,17, 13, 15),
6:   B6 = A.bitplaneof (7, 9, 6, 11),
7:   C1 = DB1
8:   C2 = C1B2
9:   C3 = C2B3
10:  C4 = C3B4
11:  C5 = C4B5
12:  C6= C5B6
Taking the pixels on the color image as an example, the pixel value of the R, G and B components are 108, 53, and 206. The values on the three components are converted to 24-bit binary numbers and stored in the six-sided star model. The six-sided star diffusion process is shown in Figure 9.

3. Proposed CIE Algorithm

The proposed CIE algorithm in this paper includes three stages. The first stage is the pre-encryption process to generate chaotic sequences. The second stage is the encryption process. The color plain image can be changed to the encrypted image. The third stage is the decryption process.

3.1. Pre-Encryption Process

Step 1: Generating the hexadecimal sequence
Let the original color image be Im×n. Its R, G, and B components are IR, IG, and IB, respectively. The 256-bit hash values corresponding to IR, IG, and IB are calculated through the SHA-256 algorithm, and these hash values are converted into three 64-bit hexadecimal sequences SR, SG, and SB, respectively.
Step 2: Generating the control values
The parameters b, c are generated with SR, SG, and SB.
b 1 = h e x 2 d e c ( S R 1 : 4 , S G ( 1 : 4 ) , S B ( 1 : 4 ) , S R 5 : 8 , S G ( 5 : 8 ) , S B ( 5 : 8 ) ) b 2 = h e x 2 d e c ( S R 9 : 12 , S G ( 9 : 12 ) , S B ( 9 : 12 ) , S R 13 : 16 , S G ( 13 : 16 ) , S B ( 13 : 16 ) ) ,
c 1 = h e x 2 d e c ( S R 17 : 20 , S G ( 17 : 20 ) , S B ( 17 : 20 ) , S R 21 : 24 , S G ( 21 : 24 ) , S B ( 21 : 24 ) ) c 2 = h e x 2 d e c ( S R 25 : 28 , S G ( 25 : 28 ) , S B ( 25 : 28 ) , S R 29 : 32 , S G ( 29 : 32 ) , S B ( 29 : 32 ) ) ,
b s = f l o o r mod b 1 + b 2 , 1 0 15 c s = f l o o r mod c 1 + c 2 , 1 0 15 ,
b = mod b s b 0 / 2 48 , 1 c = mod c s c 0 / 2 48 , 0.8 + 2 ,
where b 0 , c 0 ( 0 , 1 ) are external parameters, mod (·) denotes the modulus operation after division, floor (·) is the rounding toward negative infinity function, and hex2dec (·) denotes the conversion text representation of a hexadecimal number to a decimal number.
Step 3: Generating chaotic sequence
The control parameters b1, c1 and the initial values x0 are generated in Step 2, and they are random values. Iteration is performed 1000 + 4v + m × n times according to Equation (1) and the first 1000 sequence values are discarded. A chaotic sequence L = {li} with the length m × n × 3 can be obtained.

3.2. Encryption Process

The preprocess generates the chaotic sequence by the color plain image. Then, the scrambled matrix is obtained by the dynamic block Zigzag transformation, and the cipher images are obtained by the six-sided star diffusion. Figure 10 shows the CIE flowchart, and the specific steps are described as follows.
Step 1: Dynamic block Zigzag transformation
L′ of 4v numbers are taken 4v from the chaotic sequence L to achieve the dynamic block Zigzag transformation, and the scrambled image P can be obtained after transformation.
Step 2: Generating chaos diffusion matrix
The subsequence L″ of length m × n from the chaotic sequence L is taken. L″ is transformed into an integer sequence, and then it is reshaped into an image matrix C with the size of m × n by Equation (13).
L = L [ 4 v + 1 : 4 v + 1 + m × n ] ,
C = reshape ( mod ( f l o o r ( L × 10 8 ) , 16 ) , m , n ) ,
C = d e c 2 b i n ( C ) ,
where dec2bin (·) denotes the conversion text representation of a decimal number to a binary number. Each value of C′ consists of four binary digits.
Step 3: Rearrangement of bits
The R, G and B components of Pi, j are connected in order on the bits, and a 24-bit sequence is obtained. Pi, j is stored in the six-sided star model in order and divided into six parts, namely, F1i, j, F2i, j, …, F6i, j. Specifically, they are shown in Equation (15).
F i , j 1 = P i , j 1 , 2 , 4 , 5 F i , j 2 = P i , j 3 , 8 , 12 , 10 F i , j 3 = P i , j 18 , 16 , 19 , 14 F i , j 4 = P i , j 24 , 23 , 21 , 20 F i , j 5 = P i , j 22 , 17 , 13 , 15 F i , j 6 = P i , j 7 , 9 , 6 , 11 ,
where i = 1, 2, …, m; j = 1, 2, …, n.
Step 4: Six-sided star model diffusion
The corresponding bits in Ri, j are calculated according to Section 2.4, as shown in Equation (16).
R i , j 1 = C i , j F i , j 1 R i , j 2 = F i , j 2 R i , j 1 R i , j 3 = F i , j 3 R i , j 2 R i , j 4 = F i , j 4 R i , j 3 R i , j 5 = F i , j 5 R i , j 4 R i , j 6 = F i , j 6 R i , j 5 ,
where ⊕ indicates the XOR operation, and the encrypted matrix E can be obtained by restoring 24 bits of Ri, j to three components. The size is m × n × 3. Algorithm 3 shows the Encryption process.
Algorithm 3: Encryption process
Input: Plain image I, hash sequences, SR, SG, and SB
Output: Cipher image E
1:   b1 = hex2dec([SR(1:4),SG(1:4),SB(1:4),SR(5:8),SG(5:8),SB(5:8)])
2:   b2 = hex2dec([SR(9:12),SG(9:12),SB(9:12),SR(13:16),SG(13:16),SB(13:16)])′
3:   c1 = hex2dec([SR(17:20),SG(17:20),SB(17:20),SR(21:24),SG(21:24),SB(21:24)])
4:   c2 = hex2dec([SR(25:28),SG(25:28),SB(25:28),SR(29:32),SG(29:32),SB(29:32)])′
5:   bs = floor(mod(b1 + b2,1015))
6:   cs = floor(mod(c1 + c2,1015))′
7:   b = mod(bs×b0/248, 1)
8:   c = mod(cs×c0/248, 0.8) + 2′
9:   L = SET(1, b, c, 1000:1000 + mn + 4v)
10:  L′ = L(1:4v)
11:  for t = 1 to 3 do:
12:  P(:,:,t) = Image scrambling (I(:,:,t),floor(L(1000 + (t−1)*200:1000 + t×200)))
13:  end for
14:  L″ = L(4v + 1:4v + mn)
15:  C = reshape(mod(floor(L″×108),16), m, n)
16:  C′ = dec2bin(C)
17:  R = Six-sided star diffusion (P, C′)
18:  E = reshape (R, m, n,3)

3.3. Decryption Process

The decryption process is the inverse process of image encryption. The decryption flowchart is shown in Figure 11. The plain image I can be obtained according to the key and E by the inverse process. C and E are subjected to the XOR operation and the inverse XOR operation according to Equations (12)–(16) to obtain the scrambled image P. The dynamic block Zigzag inverse transformation is performed to restore the original image I.

4. Simulation Experiments and Results

4.1. Simulation Experiments and Results

The encryption algorithm was run on MATLAB R2018b. The hardware environment was a 1.20 CPU processor and 8GB memory. The software environment was the 64-bit Windows 10 operating system. The external parameters were b0 = 0.7391, c0 = 0.4183. The initial value was x0 = 0.6715, and the control parameters were b = 0.7928, c = 2.3841. The color plain images were converted into encrypted images through the proposed algorithm. Some color plain images having the size of 512 × 512 were selected to achieve the experiments of the CIE algorithm, including Peppers, Baboon, Airplane, House, Penguin, Sky, Railway, Sea, Water, and Building. These were taken from the SIPI image database of the University of Southern California (http://sipi. usc.edu/database (accessed on 2 May 2022)). The Universal Resource Locator (URL) of the images can be seen in Table 2. Figure 12a–j shows the color plain images. Figure 13a–j shows the encrypted images of the color plain images. Figure 14a–j shows the decrypted images.

4.2. Algorithm Analyses

In this section, we analyzed a variety of indicators in detail, and compared some indicators with other references. These include image encryption algorithms based on chaos and AES.

4.2.1. Key Space Analysis

For an encryption system, the key space of the system is necessary, and is a critical indicator to verify the algorithm security. The system of large key space can effectively resist the brute-force attack. The key space of this algorithm is about 1014×2 × 2256 ≈ 2435, including the 256-bit hash values and b0, c0. It is much larger than the required value 2100 [34]. It can be shown that the key space is large enough to effectively resist the brute-force attack. Table 3 shows the comparison of the key space with that of other references.

4.2.2. Key Sensitivity Analysis

Key sensitivity analysis is an important indicator that can be used to verify the algorithm security. The encrypted images using different sets of keys to decrypt the results are completely different. Figure 15a shows the decrypted image of Peppers with the correct key. Figure 15b–d shows the decrypted image of Peppers with the incorrect key.
One number in the key changes slightly and the others remain the same. Figure 15b only changes the value of x0 = 0.6715 to 0.6715 + 10−14. Figure 15c only changes the value of b0 = 0.7391 to 0.7391 + 10−14. Figure 15d only changes the value of c0 = 0.4183 to 0.4183 + 10−14. The decrypted images show that the image decrypted with the wrong key has no relationship with the plain image, and Table 4 shows the difference between the incorrectly decrypted image and the plain image. Therefore, the keys are highly sensitive in our algorithm.

4.2.3. Histogram Analysis

The unvarying dissemination is necessary for an excellent CIE algorithm. Otherwise, some information of the plain image cannot resist common statistical attacks [40]. An image histogram shows the number of pixels for each intensity value [41].
Figure 16 shows the pixel value histogram of each of the ten images in the experiment, and Figure 17 shows the histogram of each encrypted image corresponding to the plain image. The histograms of the plain images show large fluctuations and obvious characteristics. The histograms of the encrypted images are uniform. Therefore, the attacker cannot use the histogram distribution characteristics of the image to analyze the information characteristics of the image, and our algorithm can effectively resist statistical attacks.

4.2.4. The Plain Image Sensitivity Analysis

The principle of differential attack is that the attacker uses the encryption algorithm to process two different original images, and then obtains two cipher images [42,43].
To prevent the differential attack, a secure algorithm should ensure that the cipher images are completely different. The Number of Pixels Change Rate (NPCR) reflects the number of changed pixels in the cipher image after the plain image is changed. It is defined by:
N P C R = 1 m × n × i = 1 m j = 1 n D i , j × 100 % ,
D ( i , j ) = 0 C ( i , j ) = C ( i , j ) 1 C ( i , j ) C ( i , j ) ,
where C (i, j) is the unmodified plain image, and only one pixel is different between C′(i, j) and C (i, j).
The Unified Average Changing Intensity (UACI) measures the average difference intensity of pixel values between two cipher images, which correspond to the original image and the changed original image. It is defined by:
U A C I = 1 255 × m × n × i = 1 m j = 1 n C i , j C i , j × 100 % .
The Blocked Average Changing Intensity (BACI) was used to quantitatively evaluate the difference between two images of the same size. It is defined by:
B A C I ( P 1 , P 2 ) = 1 ( m 1 ) ( n 1 ) i = 1 ( m 1 ) ( n 1 ) m i 255 .
To evaluate the sensitivity of our algorithm to plain images, NPCR, UACI and BACI were used. Their ideal values are 99.61%, 33.46%, and 26.77%, respectively [44,45].
For the color plain image Peppers in Figure 12a, the pixel values of five different positions in the R, G and B components were changed, and the NPCR, UACI, and BACI of the cipher image were calculated when one pixel was changed and not changed. The results and statistical analyses are listed in Table 5, Table 6, Table 7, Table 8 and Table 9, respectively. It can be seen from these tables that a small change in the plain image will lead to a huge difference in the cipher image. Both NPCR and UACI tests passed the hypothesis test, and the BACI value was also close to the ideal value. Therefore, the proposed algorithm can effectively resist differential attacks.

4.2.5. Correlation of Adjacent Pixels

The correlation coefficient is defined by [49]:
r x , y = E ( ( x E ( x ) ) ( y E ( y ) ) ) D ( x ) D ( y ) ,
E ( x ) = 1 N i = 1 N x i ,
D ( x ) = 1 N i = 1 N ( x i E ( x ) ) 2 ,
where x and y are the adjacent pixel values, and D(x) and E(x) are the variance and mathematical expectation of x, respectively.
Figure 18 and Figure 19 show the correlation diagrams of adjacent pixels in the horizontal, vertical, and diagonal directions of the R component of each plain image and its corresponding cipher image. It can be seen from Figure 18 that the points in all directions of the plain image are concentrated near the diagonal line, that is, the adjacent pixel values are very close, showing a high correlation. In Figure 19, the correlation graph of the cipher image shows an even distribution in the entire plane, which proves that the encryption algorithm can successfully eliminate the correlation between adjacent pixels in the plain image.
The correlation coefficient results between the plain image and the corresponding cipher image are shown in Table 10. The correlation coefficient values of the plain image in three directions are all close to 1, indicating that the adjacent pixels of the plain image are strongly correlated. The correlation coefficient values of the cipher image in the three directions are all close to 0, and the correlation is very weak. In addition, from the comparison results in Table 11, it can be seen that the performance of the proposed algorithm is better than that of other algorithms.

4.2.6. Information Entropy Analysis

The entropy of a digital image is a random estimate used to measure the sharpness of the histogram peaks [32,40]. Its mathematical definition is described by:
H I = i = 0 255 p m i log 2 1 p m i ,
where p(mi) denotes the pixel gray level mi.
The ideal value of H(I) is 8. The value the closer to 8, the more secure the image information. Table 12 lists the entropy values of four plain images in Figure 12a–j and corresponding ciphers.
Table 13 shows that the information entropy values of the proposed algorithm and the comparative literatures are close to 8. Therefore, the proposed algorithm is secure in terms of entropy.

4.2.7. Occlusion Attack Analysis

An ideal cryptosystem should protect against data loss attacks during transmission and storage [50]. To measure the ability of this algorithm to resist data loss during transmission and storage, this subsection tested the algorithm’s robustness against clipping attacks. As shown in Figure 20a–c, 12.5%, 25%, and 50% of the Peppers cipher image was deleted, respectively.
The corresponding decrypted images are shown in Figure 20d–f. Despite the noise caused by information loss, the outline and main information of the original image can still be seen from the decrypted image. Therefore, our algorithm has the ability to resist data clipping attacks.

4.2.8. Chosen-Plaintext Attack

In an encryption system, the chosen-plaintext attack is highly threatening to the encryption system. Therefore, an image encryption system must have the ability to resist the analysis of the chosen-plaintext attack [51]. The result in Figure 21 indicates the proposed algorithm is reliable.

4.2.9. Randomness Test

The NIST test suite includes 15 tests, where different test items describe the difference between the sequence to be tested and the true random sequence from different perspectives [52]. The p-values of each test are calculated and if the p-value obtained after the experiment is greater than 0.01 in all experiments, the encryption result is credible. Table 14, Table 15 and Table 16 show the NIST test results of the cipher image. It can be seen from the table that the proposed algorithm passed the NIST tests. The obtained cipher image has desirable randomness and is a qualified noisy image.

4.2.10. Computational Complexity and Encryption Time Analysis

The encryption efficiency analysis is divided into two parts: computational complexity analysis and encryption time analysis.
In our algorithm, the processing object is a color image. The algorithm processing time is mainly allocated to two major parts. The first part is the series of operations of the chaotic sequence. This part generates four sequences by iterating an improved SET chaotic system, whose maximum length is about m×n + 4v; thus, the complexity of the generation algorithm is O (m × n). The second part is base operations, including the dynamic block Zigzag transformation and the six-sided star diffusion. Its complexity is also O (48×m×n). In total, the computational complexity in this paper is O (48×m×n).
An efficient algorithm should encrypt images in the short time. The experiments in this subsection used a standard color test image of different sizes. To accurately measure the encryption time, the encryption program of the algorithm proposed in this paper was repeatedly run 100 times, and the average value was taken as the final result. The results comparising with other studies are shown in Table 17.

5. Conclusions

To protect the content of color images, this paper proposes a new CIE algorithm. The specific advantages of our algorithm are reflected in the following aspects: (1) inspired by the standard Zigzag transformation, the proposed dynamic block Zigzag transformation can improve the horizontal correlation of ordinary Zigzag transformation and have obvious texture features; (2) the six-sided star model is designed to realize the bit operation, and high security is obtained; and (3) a new CIE algorithm is proposed and experimental results and analyses indicate that this algorithm is secure and efficient. Therefore, our algorithm can be applied to ensure image security in the fields of medical, military, etc.

Author Contributions

Conceptualization, X.Z.; methodology, M.L.; software, J.T.; validation, Z.G.; investigation, M.L.; resources, X.Z.; data curation, M.L.; writing—original draft preparation, X.Z., M.L., J.T. and Z.G.; writing—review and editing, M.L.; visualization, Z.G.; supervision, X.Z.; funding acquisition, M.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

Authors would like to express their sincere thanks to the anonymous reviewers for their constructive comments and suggestions.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Wang, X.; Zhao, M. An image encryption algorithm based on hyperchaotic system and DNA coding. Opt. Laser Technol. 2021, 143, 107316. [Google Scholar] [CrossRef]
  2. Wang, C.; Wang, X. Image description with polar harmonic fourier moments. IEEE Trans. Circ. Syst. Vid. 2020, 30, 4440–4452. [Google Scholar] [CrossRef]
  3. Asgari, C. A novel image encryption algorithm based on polynomial combination of chaotic maps and dynamic function generation. Signal Process. 2019, 157, 1–13. [Google Scholar] [CrossRef]
  4. Munazah, L.; Parsa, S.; Shabir, A.P. Adaptive image encryption based on twin chaotic maps. Multimed. Tools Appl. 2022, 2, 1–20. [Google Scholar]
  5. Wang, F.; Ni, R.; Wang, J.; Zhu, Z.; Hu, Y. Invertible encryption network for optical image cryptosystem. Opt. Lasers Eng. 2022, 149, 106784. [Google Scholar] [CrossRef]
  6. Younes, Q.; Abdeltif, J.; Mohamed, E.; Abdelhamid, B. Image encryption algorithm based on genetic operations and chaotic DNA encoding. Soft Comput. 2021, 9, 1–10. [Google Scholar]
  7. Yang, C.; Pan, P.; Ding, Q. Image encryption scheme based on mixed chaotic bernoulli measurement matrix block compressive sensing. Entropy 2022, 2, 273. [Google Scholar] [CrossRef] [PubMed]
  8. Wang, X.; Su, Y. Security enhancement of image encryption method based on Fresnel diffraction with chaotic phase. Opt. Commun. 2022, 506, 127544. [Google Scholar] [CrossRef]
  9. Chen, Y.; Xie, S.; Zhang, J. A hybrid domain image encryption algorithm based on improved Henon map. Entropy 2022, 24, 287. [Google Scholar] [CrossRef] [PubMed]
  10. Zhou, W.; Wang, X. A new combination chaotic system and its application in a new Bit-level image encryption scheme. Opt. Lasers Eng. 2022, 149, 10–32. [Google Scholar] [CrossRef]
  11. Lai, Q.; Zhang, H. Analysis and implementation of no-equilibrium chaotic system with application in image encryption. Appl. Intell. 2022, 16, 26–39. [Google Scholar] [CrossRef]
  12. Matthews, R. On the derivation of a chaotic encryption algorithm. Cryptologia 1989, 13, 29–42. [Google Scholar] [CrossRef]
  13. Zaid, B.F.; Asim, A.M.; Muhamad, A.K.; Muhammad, E.U.-H.; Waqar, A. Highly dispersive substitution box (S-box) design using chaos. ETRI J. 2020, 42, 619–632. [Google Scholar]
  14. Ying, N.; Zheng, Z.; Zhang, X. An image encryption approach based on chaotic maps and genetic operations. Multimed. Tools Appl. 2020, 79, 13–33. [Google Scholar]
  15. Attaullah, T.S.; Sajjad, S.J. An improved chaotic cryptosystem for image encryption and digital watermarking. Wirel. Pers Commun. 2020, 110, 1429–1442. [Google Scholar] [CrossRef]
  16. Wang, W.; Guan, N.; Yang, J. Image encryption algorithm with random scrambling based on one-dimensional logistic self-embedding chaotic map. Chaos Soliton Fract. 2021, 150, 111–129. [Google Scholar] [CrossRef]
  17. Naskar, P.; Surojit, B.; Kailash, C.M.; Krishna, G.D.; Atal, C. An efficient block-level image encryption scheme based on multi-chaotic maps with DNA encoding. Nonlinear Dynam. 2021, 105, 3673–3698. [Google Scholar] [CrossRef]
  18. Hua, Z.; Zhou, Y. Exponential chaotic model for generating robust chaos. IEEE Trans. 2021, 51, 3713–3724. [Google Scholar] [CrossRef]
  19. Sara, F.; Alexan, H.H. Triple-layer image security using a zigzag embedding pattern. CommNet 2019, 1, 1–8. [Google Scholar]
  20. Chai, X.; Gan, Z. A visually secure image encryption scheme based on compressive sensing. Signal Process. 2017, 134, 35–51. [Google Scholar] [CrossRef]
  21. Wang, X.; Zhang, J. An image encryption algorithm based on Zigzag transform and LL compound chaotic system. Opt. Laser Technol. 2019, 12, 1–20. [Google Scholar]
  22. Bakhshandeh, A. An authenticated image encryption scheme based on chaotic maps and memory cellular automata. Opt. Laser Technol. 2013, 51, 665–673. [Google Scholar] [CrossRef]
  23. Chai, X.; Zhou, X. An image encryption algorithm based on chaotic system and compressive sensing. Signal Process. 2018, 148, 124–144. [Google Scholar] [CrossRef]
  24. Li, S.; Zhao, L. Medical image encryption based on 2D Zigzag confusion and dynamic diffusion. Secur. Commun. Netw. 2020, 20, 27–44. [Google Scholar] [CrossRef]
  25. Lone, M.A.; Qureshi, S. RGB image encryption based on symmetric keys using Arnold transform, 3D chaotic map and affine hill cipher. Optik 2021, 26, 1–13. [Google Scholar]
  26. Wang, X.; Guan, N. A novel chaotic image encryption algorithm based on extended Zigzag confusion and RNA operation. Opt. Laser Technol. 2020, 13, 66–84. [Google Scholar] [CrossRef]
  27. Wang, X.; Chen, X. An image encryption algorithm based on dynamic row scrambling and Zigzag transformation. Chaos Soliton Fract. 2021, 147, 1–18. [Google Scholar] [CrossRef]
  28. Hosny, K. Novel encryption for color images using fractional-order hyperchaotic system. J. Amb. Intel. Hum. Comp. 2022, 6, 973–988. [Google Scholar] [CrossRef] [PubMed]
  29. Patel, S.; Thanikaiselvan, V.; Pelusi, D.; Nagaraj, B.; Arunkumar, R.; Amirtharajan, R. Colour image encryption based on customized neural network and DNA encoding. Neural Comput Appl. 2021, 33, 14533–14550. [Google Scholar] [CrossRef]
  30. Zhang, Q.; Han, J. A novel color image encryption algorithm based on image hashing, 6D hyperchaotic and DNA coding. Multimed. Tools Appl. 2021, 80, 13841–13864. [Google Scholar] [CrossRef]
  31. Wang, K.; Wu, X.; Wang, H.; Kan, H.; Kurths, J. New color image cryptosystem via SHA-512 and hybrid domain. Multimed. Tools Appl. 2021, 80, 18875–18899. [Google Scholar] [CrossRef]
  32. Zhang, X.; Gong, Z. Color image encryption algorithm based on 3D Zigzag transformation and view planes. Multimed. Tools Appl. 2022, 4, 1–25. [Google Scholar] [CrossRef]
  33. Manzo, M.; Rozza, A. DOPSIE: Deep-order proximity and structural information embedding. Mach. Learn. Knowl. Extr. 2019, 1, 684–697. [Google Scholar] [CrossRef]
  34. Zhang, X.; Hu, Y. Multiple-image encryption algorithm based on the 3D scrambling model and dynamic DNA coding. Opt. Laser Technol. 2021, 30, 1–16. [Google Scholar] [CrossRef]
  35. Sridevi, S. On Chaos based duo confusion duo diffusion for color images. Multimed. Tools Appl. 2022, 81, 16987–17014. [Google Scholar] [CrossRef]
  36. Sha, Y. Cross-plane color image encryption scheme based on BST model and chaotic map. Eur. Phys. J.-Spec. Top. 2022, 4, 1–15. [Google Scholar]
  37. Mohamed, A.; Wang, X.; Mohamed, Z. A sensitive dynamic mutual encryption system based on a new 1D chaotic map. Opt. Lasers Eng. 2021, 139, 106485. [Google Scholar]
  38. Temadher, A.; Iqtadar, H.; Amir, A.; Muhammad, T.M. A image encryption algorithm based on chaotic Lorenz system and novel primitive polynomial S-boxes. Multimed. Tools Appl. 2021, 2, 24801–24822. [Google Scholar]
  39. Belqassim, B.; Camel, T.; Said, S. Novel image encryption algorithm based on new 3-d chaos map. Multimed. Tools Appl. 2021, 80, 25583–25605. [Google Scholar]
  40. Zhang, X.; Wang, X. Remote-sensing image encryption algorithm using the advanced encryption standard. Appl. Sci. 2018, 9, 1540. [Google Scholar] [CrossRef]
  41. Mahdi, S.; Mohammad, J.; Mahdi, E. Proposing a novel Dynamic AES for image encryption using a chaotic map key management approach. Optik 2021, 246, 167779. [Google Scholar]
  42. Wang, X. Image encryption based on compressed sensing and DNA encoding. Signal Process. 2021, 95, 333–350. [Google Scholar] [CrossRef]
  43. Joshi, A.; Kumar, D. Triple color image encryption based on 2D multiple parameter fractional discrete Fourier transform and 3D Arnold transform. Opt. Lasers Eng. 2020, 133, 1–13. [Google Scholar] [CrossRef]
  44. Wang, T.; Wang, M. Hyperchaotic image encryption algorithm based on bit-level permutation and DNA encoding. Opt. Laser Technol. 2020, 132, 106355. [Google Scholar] [CrossRef]
  45. Zhang, Y. The unified image encryption algorithm based on chaos and cubic S-Box. Inf. Sci. 2018, 450, 361–377. [Google Scholar] [CrossRef]
  46. Wang, X.; Zhang, M. An image encryption algorithm based on new chaos and diffusion values of a truth table. Inf. Sci. 2021, 57, 128–149. [Google Scholar] [CrossRef]
  47. Yadollahi, M.; Enayatifa, R. A novel image security technique based on nucleic acid concepts. J. Inf. Secur. Appl. 2020, 53, 102505. [Google Scholar] [CrossRef]
  48. Basha, M. Bit level color image encryption using Logistic-Sine-Tent-Chebyshev (LSTC) map. Optik 2022, 259, 1–14. [Google Scholar]
  49. Peyman, A.; Saeed, S.; Amir, M.R. Deterministic chaos game: A new fractal based pseudo-random number generator and its cryptographic application. J. Inf. Secur. Appl. 2020, 52, 1–20. [Google Scholar]
  50. Tanveer, H.; Tariq, S. Algebra-chaos amalgam and DNA transform based multiple digital image encryption. J. Inf. Secur. Appl. 2020, 54, 102592. [Google Scholar]
  51. Zhu, C.; Gan, Z. An image encryption algorithm based on 3-D DNA level permutation and substitution scheme. Multimed. Tools Appl. 2020, 79, 7227–7258. [Google Scholar] [CrossRef]
  52. Dania, S.M.; Tariq, S. Color multiple image encryption scheme based on 3D-chaotic maps. Math. Comput. Simulat. 2020, 178, 646–666. [Google Scholar]
Figure 1. Frame diagram.
Figure 1. Frame diagram.
Electronics 11 02512 g001
Figure 2. Bifurcation of the SET chaotic system when c = 2.8316.
Figure 2. Bifurcation of the SET chaotic system when c = 2.8316.
Electronics 11 02512 g002
Figure 3. Bifurcation of the SET chaotic system when b = 0.8512.
Figure 3. Bifurcation of the SET chaotic system when b = 0.8512.
Electronics 11 02512 g003
Figure 4. Standard Zigzag transformation for the 4 × 4 matrix.
Figure 4. Standard Zigzag transformation for the 4 × 4 matrix.
Electronics 11 02512 g004
Figure 5. Finding the nearest not-traversed point (The blue block is the starting point, and the orange, red and yellow parts are scanned separately).
Figure 5. Finding the nearest not-traversed point (The blue block is the starting point, and the orange, red and yellow parts are scanned separately).
Electronics 11 02512 g005
Figure 6. Dynamic block Zigzag transformation (The red part is the dynamic selected transformation range, and the blue part is the value after each round of transformation. Arrows mean that the values in the red part are replaced by the blue part.).
Figure 6. Dynamic block Zigzag transformation (The red part is the dynamic selected transformation range, and the blue part is the value after each round of transformation. Arrows mean that the values in the red part are replaced by the blue part.).
Electronics 11 02512 g006
Figure 7. Permuted images using two different Zigzag transformations: (a) Peppers; (b) dynamic block Zigzag transformation; (c) standard Zigzag transformation.
Figure 7. Permuted images using two different Zigzag transformations: (a) Peppers; (b) dynamic block Zigzag transformation; (c) standard Zigzag transformation.
Electronics 11 02512 g007
Figure 8. Six-sided star model (When the XOR operation is performed subsequently, the corresponding operation is performed according to the color).
Figure 8. Six-sided star model (When the XOR operation is performed subsequently, the corresponding operation is performed according to the color).
Electronics 11 02512 g008
Figure 9. The six-sided star model diffusion process (The model is divided by red boxes, in which corresponding operations are performed by colors.).
Figure 9. The six-sided star model diffusion process (The model is divided by red boxes, in which corresponding operations are performed by colors.).
Electronics 11 02512 g009
Figure 10. CIE flowchart.
Figure 10. CIE flowchart.
Electronics 11 02512 g010
Figure 11. Flowchart of image decryption process.
Figure 11. Flowchart of image decryption process.
Electronics 11 02512 g011
Figure 12. Color plain images: (a) Peppers; (b) Baboon; (c) Airplane; (d) House; (e) Penguin; (f) Sky; (g) Railway; (h) Sea; (i) Water; (j) Building.
Figure 12. Color plain images: (a) Peppers; (b) Baboon; (c) Airplane; (d) House; (e) Penguin; (f) Sky; (g) Railway; (h) Sea; (i) Water; (j) Building.
Electronics 11 02512 g012
Figure 13. Color encrypted images: (a) Peppers; (b) Baboon; (c) Airplane; (d) House; (e) Penguin; (f) Sky; (g) Railway; (h) Sea; (i) Water; (j) Building.
Figure 13. Color encrypted images: (a) Peppers; (b) Baboon; (c) Airplane; (d) House; (e) Penguin; (f) Sky; (g) Railway; (h) Sea; (i) Water; (j) Building.
Electronics 11 02512 g013
Figure 14. Color decrypted images: (a) Peppers; (b) Baboon; (c) Airplane; (d) House; (e) Penguin; (f) Sky; (g) Railway; (h) Sea; (i) Water; (j) Building.
Figure 14. Color decrypted images: (a) Peppers; (b) Baboon; (c) Airplane; (d) House; (e) Penguin; (f) Sky; (g) Railway; (h) Sea; (i) Water; (j) Building.
Electronics 11 02512 g014
Figure 15. Key sensitivity analysis: (a) the correct key; (b) x0 is 0.6715 + 10−14; (c) b0 is 0.7391 + 10−14; (d) c0 is 0.4183 + 10−14.
Figure 15. Key sensitivity analysis: (a) the correct key; (b) x0 is 0.6715 + 10−14; (c) b0 is 0.7391 + 10−14; (d) c0 is 0.4183 + 10−14.
Electronics 11 02512 g015
Figure 16. The histograms of plain images: (a) histogram of Peppers; (b) histogram of Baboon; (c) histogram of Airplane; (d) histogram of House; (e) histogram of Penguin; (f) histogram of Sky; (g) histogram of Railway; (h) histogram of Sea; (i) histogram of Water; (j) histogram of Building (The red, green and blue part represent the pixel distribution of R, G and B channels respectively).
Figure 16. The histograms of plain images: (a) histogram of Peppers; (b) histogram of Baboon; (c) histogram of Airplane; (d) histogram of House; (e) histogram of Penguin; (f) histogram of Sky; (g) histogram of Railway; (h) histogram of Sea; (i) histogram of Water; (j) histogram of Building (The red, green and blue part represent the pixel distribution of R, G and B channels respectively).
Electronics 11 02512 g016aElectronics 11 02512 g016b
Figure 17. The histograms of encrypted images: (a) histogram of encrypted Peppers; (b) histogram of encrypted Baboon; (c) histogram of encrypted Airplane; (d) histogram of encrypted House; (e) histogram of encrypted Penguin; (f) histogram of encrypted Sky; (g) histogram of encrypted Railway; (h) histogram of encrypted Sea; (i) histogram of encrypted Water; (j) histogram of encrypted Building (Red, green and blue represent the pixel distribution of the three channels respectively).
Figure 17. The histograms of encrypted images: (a) histogram of encrypted Peppers; (b) histogram of encrypted Baboon; (c) histogram of encrypted Airplane; (d) histogram of encrypted House; (e) histogram of encrypted Penguin; (f) histogram of encrypted Sky; (g) histogram of encrypted Railway; (h) histogram of encrypted Sea; (i) histogram of encrypted Water; (j) histogram of encrypted Building (Red, green and blue represent the pixel distribution of the three channels respectively).
Electronics 11 02512 g017aElectronics 11 02512 g017b
Figure 18. Correlation analysis of plain images: (a) correlation of Peppers; (b) correlation of Baboon; (c) correlation of Airplane; (d) correlation of House; (e) correlation of Penguin; (f) correlation of Sky; (g) correlation of Railway; (h) correlation of Sea; (i) correlation of Water; (j) correlation of Building.
Figure 18. Correlation analysis of plain images: (a) correlation of Peppers; (b) correlation of Baboon; (c) correlation of Airplane; (d) correlation of House; (e) correlation of Penguin; (f) correlation of Sky; (g) correlation of Railway; (h) correlation of Sea; (i) correlation of Water; (j) correlation of Building.
Electronics 11 02512 g018aElectronics 11 02512 g018b
Figure 19. Correlation analysis of encrypted images: (a) correlation of encrypted Peppers; (b) correlation of encrypted Baboon; (c) correlation of encrypted Airplane; (d) correlation of encrypted House; (e) correlation of encrypted Penguin; (f) correlation of encrypted Sky; (g) correlation of encrypted Railway; (h) correlation of encrypted Sea; (i) correlation of encrypted Water; (j) correlation of encrypted Building.
Figure 19. Correlation analysis of encrypted images: (a) correlation of encrypted Peppers; (b) correlation of encrypted Baboon; (c) correlation of encrypted Airplane; (d) correlation of encrypted House; (e) correlation of encrypted Penguin; (f) correlation of encrypted Sky; (g) correlation of encrypted Railway; (h) correlation of encrypted Sea; (i) correlation of encrypted Water; (j) correlation of encrypted Building.
Electronics 11 02512 g019aElectronics 11 02512 g019b
Figure 20. Simulation results of the occlusion attack: (a) 12.5% occlusion; (b) 25% occlusion; (c) 50% occlusion; (d) decryption image of (a); (e) decryption image of (b); (f) decryption image of (c).
Figure 20. Simulation results of the occlusion attack: (a) 12.5% occlusion; (b) 25% occlusion; (c) 50% occlusion; (d) decryption image of (a); (e) decryption image of (b); (f) decryption image of (c).
Electronics 11 02512 g020aElectronics 11 02512 g020b
Figure 21. Simulation results of the special images: (a) all-black image; (b) encrypted image of (a); (c) all-white image; (d) encrypted image of (c).
Figure 21. Simulation results of the special images: (a) all-black image; (b) encrypted image of (a); (c) all-white image; (d) encrypted image of (c).
Electronics 11 02512 g021
Table 1. Correlation coefficients of neighboring pixels after different Zigzag transformations (The bold part is the relevant value of the proposed algorithm.).
Table 1. Correlation coefficients of neighboring pixels after different Zigzag transformations (The bold part is the relevant value of the proposed algorithm.).
TransformationComponentHorizontalVerticalDiagonal
Dynamic block Zigzag transformationR0.06880.06530.0541
G0.05500.05410.0495
B0.03050.03090.0208
Standard Zigzag transformationR0.95860.09570.0946
G0.97090.16530.1640
B0.94820.05680.0552
Table 2. The URL of the plain images.
Table 2. The URL of the plain images.
NameURL
Peppershttp://sipi. usc.edu/database/4.2.07 (accessed on 2 May 2022)
Baboonhttp://sipi. usc.edu/database/4.2.03 (accessed on 2 May 2022)
Airplanehttp://sipi. usc.edu/database/4.2.05 (accessed on 2 May 2022)
Househttp://sipi. usc.edu/database/house (accessed on 2 May 2022)
Penguinhttp://sipi. usc.edu/database/4.2.04 (accessed on 2 May 2022)
Skyhttp://sipi. usc.edu/database/2.1.01 (accessed on 2 May 2022)
Railwayhttp://sipi. usc.edu/database/2.1.02 (accessed on 2 May 2022)
Seahttp://sipi. usc.edu/database/2.1.03 (accessed on 2 May 2022)
Waterhttp://sipi. usc.edu/database/2.1.04 (accessed on 2 May 2022)
Buildinghttp://sipi. usc.edu/database/2.1.05 (accessed on 2 May 2022)
Table 3. Key space comparison.
Table 3. Key space comparison.
AlgorithmProposedRef. [31]Ref. [35]Ref. [36]Ref. [37]Ref. [38]Ref. [39]
Key space2435234922562128239123662192
Table 4. Difference between decryption results from slightly modified keys.
Table 4. Difference between decryption results from slightly modified keys.
FigureDecrypted KeyPixel Difference Ratios
Figure 15athe correct key0.0%
Figure 15b0.6715 + 10−1499.6193%
Figure 15c0.7391 + 10−1499.6374%
Figure 15d0.4183 + 10−1499.6502%
Table 5. Results of NPCR, UACI and BACI at different locations in the Peppers image.
Table 5. Results of NPCR, UACI and BACI at different locations in the Peppers image.
Position(1,1,1)(1,128,1)(128,256,2)(256,384,1)(384,512,3)
Changing Pixel Values 126 127 99 104 182 183 57 66 31 140
NPCR (%)R99.653299.612899.613699.616299. 613
G99.628199.608299.612199.607299.6152
B99.610999.643199.625099.622399.6174
UACI (%)R33.506233.442133.415133.395733.5421
G33.480133.505333.382333.441633.5206
B33.413633.414733.520733.472333.4361
BACI (%)R26.732126.702126.785126.686126.8538
G26.767426.792326.771426.744226.7924
B26.754226.753126.743126.790526.7835
Table 6. Statistical results of NPCR in Table 5.
Table 6. Statistical results of NPCR in Table 5.
ComponentMin
(%)
Max
(%)
Avg
(%)
Passing Rate (%)
N P C R = 99.5693 ± 0.05 N P C R = 99.5527 ± 0.01
R99.580199.632699.6173100100
G99.592399.629199.6182100100
B99.587299.635299.6191100100
Table 7. Statistical results of UACI in Table 5.
Table 7. Statistical results of UACI in Table 5.
ComponentMin
(%)
Max
(%)
Avg
(%)
Passing Rate (%)
U A C I = 33.2824 ± 0.05 U A C I = 33.2255 ± 0.01
R33.310333.542533.4541100100
G33.381533.531733.4686100100
B33.380233.526333.4535100100
Table 8. Comparison of NPCR and UACI using image Peppers (The bold part is the relevant values of the proposed algorithm).
Table 8. Comparison of NPCR and UACI using image Peppers (The bold part is the relevant values of the proposed algorithm).
AlgorithmNPCR (%)UACI (%)
RGBRGB
Proposed99.608099.608699.620533.458533.372133.4012
Ref. [30]99.610799.609399.608533.474133.481833.4806
Ref. [25]99.593499.604899.610933.312033.391633.4853
Ref. [46]99.600099.572199.562833.520933.677333.6317
Ref. [47]99.649199.692199.653433.410233.407733.3812
Ref. [48]99.616799.604699.615833.439533.458733.4566
Ref. [35]99.620099.620499.621933.380633.217933.4472
Ref. [36]99.613499.590699.633233.234833.300333.5421
Table 9. Statistical results of BACI in Table 4.
Table 9. Statistical results of BACI in Table 4.
Statistical DataBACI (%)
RGB
Average value26.752826.770526.7538
Standard deviation0.04450.02810.0294
Table 10. Correlation coefficient values of adjacent pixels in three different directions.
Table 10. Correlation coefficient values of adjacent pixels in three different directions.
ImageComponentThe Plain ImagesThe Encrypted Images
HorizontalVerticalDiagonalHorizontalVerticalDiagonal
PeppersR0.95850.96460.9533−0.00590.00280.0007
G0.97800.97740.9644−0.0002−0.00370.0031
B0.96470.96080.94230.00550.0016−0.0050
BaboonR0.94270.87580.85030.0005−0.00470.0006
G0.91390.81700.77700.0004−0.0005−0.0001
B0.94890.89360.8691−0.00070.00080.0002
AirplaneR0.97520.96460.95330.00190.00170.0012
G0.96700.97140.9604−0.00120.00160.0011
B0.97710.96780.94530.0025−0.0028−0.0051
HouseR0.95070.95860.9526−0.0027−0.00130.0009
G0.96110.94740.9602−0.00090.00150.0021
B0.95930.96020.94130.00230.0008−0.0010
PenguinR0.96620.96060.9567−0.0019−0.00370.0007
G0.97030.95740.9652−0.00220.00160.0001
B0.96690.96130.94910.0055−0.00060.0011
SkyR0.88130.86570.8492−0.0009−0.00050.0015
G0.88400.86750.8593−0.00470.00720.0012
B0.87910.86380.85700.0001−0.0003−0.0011
RailwayR0.84780.83390.7682−0.0017−0.00060.0038
G0.78370.76340.6819−0.00160.0076−0.0004
B0.74770.72530.6423−0.0022−0.0003−0.0007
SeaR0.89830.91330.85580.00460.00300.0024
G0.81690.84860.7496−0.00080.00350.0008
B0.78780.81450.72220.0029−0.0011−0.0017
WaterR0.84220.85540.78250.00190.00000.0023
G0.75500.77980.6780−0.0013−0.0003−0.0041
B0.67600.70860.58450.00650.00420.0013
BuildingR0.95770.95940.9372−0.00080.00130.0004
G0.93680.94110.9126−0.0019−0.00090.0004
B0.92210.92780.89660.00390.0027−0.0039
Table 11. Correlation coefficients of Peppers (The bold part is the relevant values of the proposed algorithm.).
Table 11. Correlation coefficients of Peppers (The bold part is the relevant values of the proposed algorithm.).
DirectionsComponentThe Encrypted Images
HorizontalVerticalDiagonal
PeppersR0.95850.96460.9533
G0.97800.97740.9644
B0.96470.96080.9423
ProposedR−0.00590.00280.0007
G−0.0002−0.00370.0031
B0.00550.0016−0.0050
Ref. [30]R−0.0029−0.0043−0.0007
G−0.0074−0.00100.0007
B−0.00370.00280.0012
Ref. [25]R−0.0007−0.00120.0022
G0.0007−0.00120.0022
B0.0007−0.00120.0022
Ref. [46]R0.0006−0.00120.0052
G−0.0035−0.00170.0021
B0.0025−0.0023−0.0008
Ref. [47]R−0.0022−0.00100.0003
G0.0004−0.0020−0.0009
B0.00050.0002−0.0012
Ref. [48]R−0.00320.0025−0.0005
G0.00050.0021−0.0017
B0.00110.00200.0025
Ref. [35]R0.00470.00250.0014
G0.00380.00400.0033
B0.00520.00090.0021
Ref. [36]R0.0147−0.0037−0.0306
G−0.00210.00350.0171
B0.0027−0.02190.0044
Table 12. Information entropy values.
Table 12. Information entropy values.
AlgorithmEntropy of Plain ImagesEntropy of Encrypted Images
RGBRGB
Peppers7.33887.49627.05837.99927.99947.9993
Baboon7.74007.70257.15527.99937.99937.9993
Airplane7.30617.41577.34277.99937.99947.9992
House7.21137.43867.52157.99947.99947.9994
Penguin7.53937.67227.32077.99937.99947.9994
Sky7.50907.35416.59667.99937.99937.9993
Railway7.40167.41886.59317.99947.99937.9993
Sea6.54765.70034.50307.99927.99947.9992
Water7.26216.61635.27367.99927.99927.9994
Building7.55807.45966.66647.99937.99937.9994
Table 13. Comparison of information entropy with other algorithms (The bold part is the relevant values of the proposed algorithm.).
Table 13. Comparison of information entropy with other algorithms (The bold part is the relevant values of the proposed algorithm.).
AlgorithmEntropy of Plain ImagesEntropy of Encrypted Images
RGBRGB
Proposed7.29787.34177.51427.99927.99947.9993
Ref. [30]7.99947.99947.9994
Ref. [25]7.99747.99747.9974
Ref. [46]7.99727.99697.9973
Ref. [47]7.99987.99987.9998
Ref. [48]7.99947.99947.9994
Ref. [35]7.99917.99917.9991
Ref. [36]7.99927.99937.9993
Table 14. NIST test results.
Table 14. NIST test results.
TestRGB
p-ValuesPass/Filep-ValuesPass/Filep-ValuesPass/File
Frequency test0.7563Passed0.1482Passed0.3377Passed
Frequency test within a block0.3825Passed0.3561Passed0.5212Passed
Runs test0.3332Passed0.5715Passed0.5068Passed
Test for longest run of ones in a block0.1126Passed0.1067Passed0.6612Passed
Binary matrix rank test0.2737Passed0.3323Passed0.1043Passed
Discrete Fourier transform test0.6057Passed0.7132Passed0.2341Passed
Non-overlapping template matching test0.3182Passed0.8317Passed0.3325Passed
Overlapping template matching test0.3073Passed0.7112Passed0.2956Passed
Maurer’s “Universal Statistical” test0.2496Passed0.3431Passed0.3014Passed
Linear complexity test0.5092Passed0.2321Passed0.5575Passed
Serial test0.2161Passed0.1250Passed0.4017Passed
0.09210.21610.1250Passed0.4017Passed
Approximate entropy test0.6561Passed0.6406Passed0.6249Passed
Cumulative sums test0.5276Passed0.5993Passed0.6331Passed
Random excursions test-Passed-Passed-Passed
Random excursions variant test-Passed-Passed-Passed
Table 15. Random excursions test.
Table 15. Random excursions test.
The TestRGB
p-ValuesPass/Failp-ValuesPass/Failp-ValuesPass/Fail
x = −40.2391Passed0.1673Passed0.3125Passed
x = −30.8124Passed0.2419Passed0.4107Passed
x = −20.2165Passed0.3718Passed0.0518Passed
x = −10.0134Passed0.2152Passed0.3179Passed
x = 10.4199Passed0.4179Passed0.0917Passed
x = 2 0.2154Passed0.2007Passed0.1845Passed
x = 30.1200Passed0.6120Passed0.3028Passed
x = 40.0917Passed0.0234Passed0.5134Passed
Table 16. Random excursions variant test.
Table 16. Random excursions variant test.
The TestRGB
p-ValuesPass/Failp-ValuesPass/Failp-ValuesPass/Fail
x = −90.2167Passed0.2412Passed0.1341Passed
x = −80.3214Passed0.0111Passed0.3219Passed
x = −70.1033Passed0.3427Passed0.0713Passed
x = −60.0023Passed0.0911Passed0.5217Passed
x = −50.1892Passed0.2377Passed0.2513Passed
x = −4 0.0912Passed0.1923Passed0.0712Passed
x = −30.0035Passed0.1997Passed0.2613Passed
x = −20.1734Passed0.1964Passed0.3107Passed
x = −10.0531Passed0.0131Passed0.0125Passed
x = 10.2921Passed0.2003Passed0.4003Passed
x = 20.1793Passed0.1091Passed0.1026Passed
x = 30.2234Passed0.0061Passed0.0041Passed
x = 40.3112Passed0.0997Passed0.0157Passed
x = 50.8917Passed0.4118Passed0.0673Passed
x = 60.1187Passed0.5107Passed0.0155Passed
x = 70.2562Passed0.1425Passed0.2517Passed
x = 80.0911Passed0.2108Passed0.5718Passed
x = 90.8134Passed0.3142Passed0.2542Passed
Table 17. Algorithms’ encryption time (The bold part is the values of the proposed algorithm.).
Table 17. Algorithms’ encryption time (The bold part is the values of the proposed algorithm.).
AlgorithmsThe Size of a Color ImageTime (s)
Proposed256 × 2560.16
512 × 5120.32
1024 × 10241.05
Ref. [30]512 × 5126.74
Ref. [25]512 × 5124.39
Ref. [46]512 × 51212.23
Ref. [47]256 × 2560.83
Ref. [48]256 × 2560.32
512 × 5121.81
Ref. [35]512 × 5121.00
Ref. [36]512 × 5122.08
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Zhang, X.; Liu, M.; Tian, J.; Gong, Z. Color Image Encryption Algorithm Based on Dynamic Block Zigzag Transformation and Six-Sided Star Model. Electronics 2022, 11, 2512. https://doi.org/10.3390/electronics11162512

AMA Style

Zhang X, Liu M, Tian J, Gong Z. Color Image Encryption Algorithm Based on Dynamic Block Zigzag Transformation and Six-Sided Star Model. Electronics. 2022; 11(16):2512. https://doi.org/10.3390/electronics11162512

Chicago/Turabian Style

Zhang, Xiaoqiang, Mi Liu, Jingxi Tian, and Zhengjun Gong. 2022. "Color Image Encryption Algorithm Based on Dynamic Block Zigzag Transformation and Six-Sided Star Model" Electronics 11, no. 16: 2512. https://doi.org/10.3390/electronics11162512

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop