Secure Data Transmission and Image Encryption Based on a Digital-Redesign Sliding Mode Chaos Synchronization

: In this paper, a novel image encryption algorithm based on chaotic synchronization is proposed. First, a digital-redesign sliding mode controller (SMC) is developed to guarantee the chaos synchronization. The digital redesign method makes it possible to transform a proposed continuous-time SMC to discrete-time SMC whilst maintaining the performance of the robust synchronization. Then, the secret keys are embedded in the state equations of the master chaotic system, such that the secret keys do not appear in the public channel, and utilize the chaotic synchronization to achieve secure communication for transmitting the secret keys from transmitter to receiver. Second, an image encryption algorithm integrating the S-box with chaotic synchronization is established, where the S-box is created by the secret key transmitted from the transmitter. Finally, a detailed analysis of the image encryption algorithm based on chaos synchronization is included to verify the feasibility and effectiveness of this proposed approach.


Introduction
Chaotic systems are nonlinear systems with many complex characteristics. Due to the randomness of chaotic systems, they can be applied in many aspects, especially in secure communication. For application in secure communication, chaos synchronization is the most important issue, and some control methods for chaos synchronization have been developed in the literature. In the report [1], the adaptive fuzzy control approach is designed to deal with the synchronization for time-delay uncertainty chaotic systems. In [2], the sliding mode control is utilized in the process of synchronization for the chaotic system with disturbances. It is well known that the sliding mode control (SMC) is a nonlinear control method using a discontinuous control signal to force state trajectories to hit the switching surface and enter the sliding manifold such that the Lyapunov stability for the controlled systems can be ensured. Moreover, SMC is an effective method to eliminate the influence of the matched disturbances [3][4][5], and the design of SMC often combines with the disturbance estimator or observer to achieve better robustness [6][7][8]. Due to this reason, SMC has been widely used to solve the robust control problems for many problems in engineering. However, there is a chattering phenomenon due to the utilization of sign function in SMC, which causes the high-frequency oscillation in the controller. To solve this problem, there are some alternatives, such as high-order SMC [9,10], second-order SMC [11,12], and saturation function [13]. Thus, in this paper, we also introduce the saturation function to avoid the chattering phenomenon and achieve the chaos synchronization.
To develop the digital-redesign SMC, we introduce the digital redesign approach to transform a well-designed continuous-time SMC to a corresponding discrete-time SMC

Communication Structure Based on Synchronization
A. The secure communication based on chaos synchronization. In this section, a secure communication based on synchronization is formulated. Due to the characteristic of chaos synchronization, the message m(t) can be embedded in the master system and obtained in the slave system through the SMC synchronization control method.
First, the structure of the master system can be described as . y m (t) = Ay m (t) + B g y (y(t)) + m(t) (1) and the slave system is described as .
x s (t) = Ax s (t) + B(g x (x(t)) + u(t)), where A ∈ R n×n and B ∈ R n×m are the system matrices, g x (x(t)) and g y (y(t)) are the nonlinear terms of chaotic systems, and m(t) is the embedded message.
The error vector is defined as e(t) = y m (t) − x s (t) and the error dynamics can be obtained as follows: . e(t) = . y m (t) − . x s (t) = Ae(t) + B(m(t) − u(t) + g e (t)), where g e (t) = g y (y(t)) − g x (x(t)). When the synchronization is ensured, it means the error state converges to zero, i.e., e(t) = y m (t) − x s (t) = 0, and g e (t) will converge to zero as well. Then, the equivalent error dynamics can be rewritten as . e(t) = B(m(t) − u(t)) = 0.
B is the system matrix and not be equal to zero, therefore, one can derive that m(t) = u(t). As a result, the message can be recovered in the slave system if the synchronization is ensured.
B. SMC design for message communication.
First, to achieve the sliding mode control for completing chaos synchronization, the sliding mode function can be selected as s(t) = C s e(t) + t 0 (−C s Ae(τ) + K c e(τ))dτ, where C s = B † , and K c is the designed controller gain. By differentiating (5), we have . s(t) = C s . e(t) − C s Ae(t) + K c e(t) = C s (Ae(t) + B(m(t) − u(t) + g e (t))) − C s Ae(t) + K c e(t) = −u(t) + m(t) + K c e(t) + g e (t).
When the controlled state trajectories enter the sliding manifold, the equivalent controller with the fact of s(t) = . s(t) = 0 can be derived as u ceq (t) = K c e(t) + m(t) + g e (t) (7) Thus, one can know that the equivalent controller u eq (t) is equal to m(t) when the error converges to zero which is mentioned in (4).
To guarantee the minimization of the state error e(t), we use the linear-quadratic method [24] to calculate the controller gain K c which will be used in the sliding mode function (5). We consider the cost function as follows where Q = 10 q × I n , R is a positive define matrix. According to the above performance, we have the Riccati equation as where P is a positive symmetric define matrix. Thus, one can obtain the gain K c : To ensure the controlled dynamics, (3) can enter the sliding manifold, the controller is designed as follows: Replacing (11) into (6), (6) becomes .
To verify the designed controller can ensure the occurrence of the sliding mode, a Lyapunov function is chosen as follows: and then one differentiates (13) and obtains From (14), one can know that . V(s(t)) ≤ 0 when γ 3 is chosen as g e (t) + γ. Thus, the design of SMC (12) is complete through the above derivation.
There is a chattering phenomenon when the design of SMC includes the nonlinear sign function. To overcome this situation, we replace sign function with saturation function sat(s(t)) [13]. The saturation function is shown as follows: where the parameter ε is an arbitrarily small but positive constant. Therefore, one can obtain the continuous-time SMC-based control law for secure communication as follows: While the sliding mode is reaching, the synchronized error approaches to zero, the desired message m(t) can be established by the control law (16) in the continuous time.
C. Digital redesign of H 2 SMC for message communication After obtaining the continuous-time SMC-based controller, we utilize the digitalredesign method to make the transformation and obtain the corresponding discrete-time SMC controller. First, one can discretize (9) with Euler's method [25] and get s(kT s + T s ) = s(kT s ) + T s (g(x(kT s )) − g(y(kT s )) + m(kT s ) −γ 1 s(kT s ) − γ 2 sgn(s(kT s )) − γ 3 sgn(s(kT s ))) ∆s(kT s ) = −γ 1 T s s(kT s ) + T s (g(x(kT s )) − g(y(kT s )) +m(kT s ) − γ 2 sgn(s(kT s )) − γ 3 sgn(s(kT s ))) (17) where T s is the sampling time. To guarantee the occurrence of the sliding manifold in the discrete-time domain, Lemma 1 is given as follows.
If the reaching conditions above are satisfied, then the controlled state trajectories can converge to s(kT s ) = 0 and enter the sliding manifold.
Proof of Lemma1: when s(kT s ) > 0, ∆s(kT s ) = s(kT s + T s ) − s(kT s ) < 0 means s(kT s + T s ) < s(kT s ) and the trajectory of s(kT s ) converges towards the sliding surface s = 0. When s(kT s ) < 0, ∆s(kT s ) = s(kT s + T s ) − s(kT s ) > 0 means s(kT s + T s ) > s(kT s ) and the trajectory of s(kT s ) also converges towards the sliding surface s = 0. Therefore, if the reaching conditions above are satisfied, the controlled state trajectories can converge to s(kT s ) = 0 and enter the sliding manifold.
Based on Lemma 1, we calculate Therefore, according to Lemma 1, s(kT s ) will always converge to zero and the controlled system enters the sliding manifold. In this paper, Euler's method is adopted to discretize the proposed sliding mode controller such that the existence of the sliding mode can be guaranteed and the equivalent control can be achieved.
When the system is in the sliding manifold, i.e., u c (t) = u ceq (t) as given in (7), the error dynamics can be discretized as e(kT s + T s ) = Ge(kT s ) + Hu * d (kT s ), (20) where G = e AT s , and H = (G − I n )A −1 B. Due to zero-order-hold (Z.O.H.), the controller u * d (kT s ) can be approached to u * c (t) = u * d (kT s ) ∼ = u * c (kT s + T s ), for kT s ≤ t < kT s + T s , and u * d (kT s ) can be approximated as According to (20), (21) can be rearranged as where Since the reaching condition is satisfied, the controlled system is operated in the sliding manifold. The digital-redesign method is utilized to ensure that (G − HK d ) is Hurwitz and the stability of the controlled system can be guaranteed. Furthermore, to achieve the digital-redesign-based SMC, one can discretize (8) to implement the discrete-time SMC as follows s(kT s ) = C s e(kT) + s I (kT s ), (23) s I (kT s + T s ) = s I (kT s ) + T s (−C s Ae(kT s ) + K c e(kT s )).
Finally, with the utilization of the proposed digital-redesign method and the adoption of the saturation function (15), the discrete SMC synchronization scheme can be obtained as u d (kT s ) = −K d e(kT s ) − γ 1 s(kT s ) − γ 2 sat(s(kT s )) − γ 3 sat(s(kT s )), (25) Mathematics 2022, 10, 518 6 of 22 While the sliding mode is reaching, the synchronized error approaches to zero, the desired message m(t) can be established by the control law (16) in the discrete time.
D. Simulation for message communication After completing the design of the digital redesign SMC synchronization controller, the simulation for verifying the feasibility is performed with the Lorenz chaotic system which can be found in reference [27]. The Lorenz chaotic system is given as follows: where, δ 1 = 10, δ 2 = 28 and δ 3 = 8/3.
First, one rearranges the Lorenz chaotic system as the structure of the master-slave system considered in (1) and (2) for secure communication as follows . y m (t) = Ay m (t) + B g y (y m (t)) + m(t) , and .
In Figure 1, one can observe that the synchronization errors are soon approaching zero, which means the designed controller can make the system achieve synchronization effectively. The errors between controller u(t) and message m(t) converge to zero as shown in Figures 2 and 3, which is in accordance with the derivation in (4). Figure 4 illustrates the sliding mode trajectory also converges to zero as expected. Thus, one can figure out that the digital-redesign SMC-based controller is an effective method to make the system achieve synchronization and establish a secure communication. In Figure 5, one can observe that the synchronization errors are not stable before 10 seconds, however, the synchronization errors are closing to zero while the control input is active after 10 seconds. Therefore, the proposed SMC controller is effectiveness and robust.

Results
Image encryption based on secure communication After completing the construction of secure communication with the hybrid synchronization control, the proposed controller is applied in image encryption in this section. First, the secret key for the image encryption algorithm is designed as the embedded message m(t) and the S-box is established by the secret key. The main function of the S-box is to increase encryption strength. With the secret key and S-box, the image encryption algorithm is proposed. The structure of the synchronization-based image encryption algorithm and flowchart are shown in Figure 6.

Results
Image encryption based on secure communication After completing the construction of secure communication with the hybrid synchronization control, the proposed controller is applied in image encryption in this section. First, the secret key for the image encryption algorithm is designed as the embedded message m(t) and the S-box is established by the secret key. The main function of the S-box is to increase encryption strength. With the secret key and S-box, the image encryption algorithm is proposed. The structure of the synchronization-based image encryption algorithm and flowchart are shown in Figure 6. A. Preliminary: establish S-Box by utilizing chaotic behavior In this section, the secret key and the generation steps of the S-box are introduced.
The reconstructed message ˆ( ) m t is used for establishing the S-box and it is designed as  A. Preliminary: establish S-Box by utilizing chaotic behavior In this section, the secret key and the generation steps of the S-box are introduced. The reconstructed messagem(t) is used for establishing the S-box and it is designed as where m 1 , m 2 , and m 3 are appropriate positive integers, t end is an entire time of synchronization simulation, and m steady (t) is the steady-state trajectory of m(t). Then, one uses three constants in the message to establish the sample period m ts for dealing with the state of the Lorenz chaotic system.
where t s1 , t s2 , and t s3 are sampling times and round(•) is a function that rounds the element • to the nearest integer. The constants m 1 , m 2 , and m 3 are the important elements in image encryption and decryption. After getting the m ts1 , m ts2 , and m ts3 , one can sample the states of the Lorenz chaotic system with m ts1 , m ts2 , and m ts3 respectively, and obtain sampled states Furthermore, the simple rules are applied in sampled states to get three sequences, x ts1 , x ts2 , and x ts3 . The rules are shown as follows where i = 0, 1, . . . , s 2 − 1, the size of the image is s 1 × s 2 , s 1 for row and s 2 for column, and mean(x d ) is the function to get the mean value of the sequence x d and it is a rule. The function of the sampled states is to permute the sequence and obtain the S-box. After dealing with the states of the system, one uses it to obtain the S-box_x, S-box_y, and S-box_z. Take the S-box_x, for example. First, one generates a sequence z 0 = [0, 1, 2, . . . , s 2 − 1], and compare the sequence z j with the sequence x ts1 , where j is the execution times. If the i term of x ts1 (i.e., x ts1 (i)) is one, the i term of z 0 (i.e., z 0 (i)) is arranged to the far left side of the sequence z 0 . If the i term of x ts1 (i.e., x ts1 (i)) is zero, the i term of z 0 (i.e., z 0 (i)) is arranged to the far right side of the sequence z 0 , and replaces the original z 0 after permutation. After completing the permutation from i = 0 to s 2 − 1, one gets the new sequence z 1 . Then, one performs the same rules to get z 2 . After running N × s 1 times, one obtains an S − box_1 with size (N × s 1 ) × s 2 and chooses the last s 1 rows of S-box_1 to build the S-box_x whose dimension is s 1 × s 2 . Rules for establishing the S-box is given in Figure 7.
Mathematics 2022, 10, 518 12 of 23 The function of the sampled states is to permute the sequence and obtain the S-box. After dealing with the states of the system, one uses it to obtain the S-box_x, S-box_y, and S-box_z. Take the S-box_x, for example. First, one generates a sequence s rows of S-box_1 to build the S-box_x whose dimension is 1 2 s s × . Rules for establishing the S-box is given in Figure 7.
With the rules mentioned above, one can have another two S-box, S-box_2, and S-box_3, which are generated from the  B. Image encryption algorithm After constructing the S-boxes, the image encryption algorithm is proposed with the obtained S-boxes.
Step 1. Separate the image I with the size of 1 2 s s × into three grayscale images of With the rules mentioned above, one can have another two S-box, S-box_2, and S-box_3, which are generated from the x ts2 and x ts3 , respectively. Then, one selects the last s 1 rows in S-box_2 and S-box_3 to obtain the S-box_y and S-box_z.
B. Image encryption algorithm After constructing the S-boxes, the image encryption algorithm is proposed with the obtained S-boxes.
Step 1. Separate the image I with the size of s 1 × s 2 into three grayscale images of red, green, and blue, respectively. Arrange the pixel from row to column, and one can obtain three sequences    R = {r 1 , r 2 , r 3 , . . . , r s 1 ×s 2 }, where r i , g i , and b i are ith pixel of the red layer, green layer, and blue layer in a color image, respectively.
Step 2. Generate three S-boxes, S-box_x, S-box_y, and S-box_z, with the rules mentioned above and arrange three S-boxes from row to column as Step 3. Generate three sequences, cr, cg, and cb. Then, one can get where ⊕ denote the bitwise exclusive or operation and i = 1, 2, 3, . . . , s 1 × s 2 .
With the above three steps, one can obtain three encrypted layers cr i ,cg i , and cb i , and combine three layers to obtain the encrypted color image.
C. Decryption algorithm In this section, the decryption algorithm is established. The decryption algorithm is just the inverse process of the encryption algorithm. One can obtain some decryption information from the transmitter such as the entire simulation time of synchronization, sampling time t s , fast sampling time t f , the state of the master system with the message embedded, and the formula of the sampling time for sampling the state of the system. With the above information, the message is obtained through the approach of synchronization, establishes the same S-box, and performs the following steps to obtain the decryption image.
Step 1. Perform the synchronization to have the message and calculate the sample time for sampling the state with the formula given in part A of Section 3. Then, sample the state to obtain x tsd = x tsd1 x tsd2 x tsd3 T .
Step 2. Separate the encryption image I en into three grayscale images of red, green, and blue, arrange the pixels from row to column, and get three sequences R en , G en and B en as          R en = r 1 , r 2 , . . . , r s 1×s 2 , G en = g 1 , g 2 , . . . , g s 1×s 2 , Step 3. Establish the S-boxes with the state generated by synchronization and rule in part A of Section 3 and arrange three sequences as Step 4. Generate the sequences, udr, udg, and udb, and get the decryption component cdr, cdg, and cdb as follows: Finally, one can combine three layers, cdr, cdg, and cdb, and obtain the decrypted color image.

D. Simulation results
The Lena image with the size 512 × 512 is used as the test image to perform the image encryption. The secret keys are taken as m 1 = 1, m 2 = 2, and m 3 = 3. The plain image of Lena is shown in Figure 8 and its histogram is shown in Figure 9. After using the proposed encryption algorithm, one can obtain the encrypted image shown in Figure 10, and its histogram is shown in Figure 11. The outline of the Lena is hard to distinguish in the encrypted image. The encrypted image uses all the grayscales from 0 to 255 and the histogram of the encryption image is flat which means the encryption scheme is effective and secure.  Figure 8 and its histogram is shown in Figure 9. After u proposed encryption algorithm, one can obtain the encrypted image shown in Fi and its histogram is shown in Figure 11. The outline of the Lena is hard to distin the encrypted image. The encrypted image uses all the grayscales from 0 to 255 histogram of the encryption image is flat which means the encryption scheme is and secure. Furthermore, another two images, baboon image with size 512 512 × , and black figure with size 512 512 × , are used as the test images as well. The baboon shown in Figure 12 and its histogram is shown in Figure 13. The all-black figure i in Figure 14 and its histogram is shown in Figure 15. One can obtain the encrypted image and the encrypted all-black image shown in Figure 16 and Figure 17, resp and the histograms are, respectively, shown in Figure 18 and Figure 19. The en image is done by utilizing the above algorithm with the same secret key. Then, observe that the histogram of the encrypted baboon image ( Figure 18) and the hi of the encrypted all-black image ( Figure 19) are flat as well. Eventually, the image tion algorithm can be applied in the image with any size, and the detailed analysi security is discussed in the next section.       Furthermore, another two images, baboon image with size 512 × 512, and the all-black figure with size 512 × 512, are used as the test images as well. The baboon image is shown in Figure 12 and its histogram is shown in Figure 13. The all-black figure is shown in Figure 14 and its histogram is shown in Figure 15. One can obtain the encrypted baboon image and the encrypted all-black image shown in Figures 16 and 17, respectively, and the histograms are, respectively, shown in Figures 18 and 19. The encrypted image is done by utilizing the above algorithm with the same secret key. Then, we can observe that the histogram of the encrypted baboon image ( Figure 18) and the histogram of the encrypted all-black image ( Figure 19) are flat as well. Eventually, the image encryption algorithm can be applied in the image with any size, and the detailed analysis for the security is discussed in the next section.       . Figure 15. Histogram of all-black image.   . Figure 15. Histogram of all-black image.   . Figure 15. Histogram of all-black image.    Once the encryption is completed, one starts the process of the decryption with decryption information. The file of decryption information includes the system states, the sampling time, the synchronization time, and the encrypted image. The file of decryption information is established in the transmitter and sent to the receiver. Then, by using the proposed synchronization-based communication to obtain the secret key, one performs the decryption algorithm to obtain the decrypted image. Figure 20 shows the decrypted images.   Once the encryption is completed, one starts the process of the decryption with decryption information. The file of decryption information includes the system states, the sampling time, the synchronization time, and the encrypted image. The file of decryption information is established in the transmitter and sent to the receiver. Then, by using the proposed synchronization-based communication to obtain the secret key, one performs the decryption algorithm to obtain the decrypted image. Figure 20 shows the decrypted images. To show the effectiveness of the encrypted algorithm, the plain image is contrasted with the decrypted image pixel by pixel, and one can get the following result. Thus, one can know that there is no difference between two images, and the encrypted and decrypted algorithms are feasible.
E. Security analysis In this section, we analyze the security of the encryption algorithm with three images.
(1) Key space analysis Key space means the total number of all different keys used in the encryption algorithm. The value of key space must be high so that it can make the brute-force attack inef- , which is large enough to resist the brute-force attack.
(2) Correlation Adjacent pixels of an image will always be similar and with a strong correlation. A good image encryption algorithm is able to weaken the correlation of the adjacent pixels. The correlation function of the image is given as follows: The correlation analysis demonstrates the similarity between two adjacent pixels in the vertical direction and the horizontal directions. The range of the correlation is [ 1 1] − . The higher value means the higher correlation. One randomly selects 3000 pairs of the adjacent pixel from the plain image and encrypted image, respectively, to calculate the correlation coefficient. The horizontal correlation of the plain Lena image is shown in Figure 21 and the horizontal correlation of encrypted Lena image is shown in Figure 22. The vertical correlation of the plain Lena image is shown in Figure 23 and the vertical correlation of the encrypted Lena image is shown in Figure 24. One can find that the correlation of the adjacent pixel weakens after applying the encryption algorithm. The value of the correlation is shown in Table 1. Then, one can compare the proposed algorithm with the To show the effectiveness of the encrypted algorithm, the plain image is contrasted with the decrypted image pixel by pixel, and one can get the following result.
Thus, one can know that there is no difference between two images, and the encrypted and decrypted algorithms are feasible.
E. Security analysis In this section, we analyze the security of the encryption algorithm with three images.
(1) Key space analysis Key space means the total number of all different keys used in the encryption algorithm. The value of key space must be high so that it can make the brute-force attack ineffective. The secure key m(t) in this proposed algorithm is utilized to generate the sampling time m ts for sampling the states, and the sampling time m ts is ranged in 10 0 ∼ 10 3 . The key space can reach 10 9 . The valid precision of the initial condition in chaotic systems is set to 10 −14 , so the key space can reach 10 14×3 = 10 42 . Thus, the number of different key combinations that can be used are 10 42 × 10 9 = 10 51 , which is large enough to resist the brute-force attack.
(2) Correlation Adjacent pixels of an image will always be similar and with a strong correlation. A good image encryption algorithm is able to weaken the correlation of the adjacent pixels. The correlation function of the image is given as follows: where cov(x, y) = 1 The correlation analysis demonstrates the similarity between two adjacent pixels in the vertical direction and the horizontal directions. The range of the correlation is [ −1 1 ]. The higher value means the higher correlation. One randomly selects 3000 pairs of the adjacent pixel from the plain image and encrypted image, respectively, to calculate the correlation coefficient. The horizontal correlation of the plain Lena image is shown in Figure 21 and the horizontal correlation of encrypted Lena image is shown in Figure 22. The vertical correlation of the plain Lena image is shown in Figure 23 and the vertical correlation of the encrypted Lena image is shown in Figure 24. One can find that the correlation of the adjacent pixel weakens after applying the encryption algorithm. The value of the correlation is shown in Table 1. Then, one can compare the proposed algorithm with the algorithm in [22] on the encrypted Lena image. One can observe that the correlation coefficient in this paper is smaller than the correlation coefficient in [22] and this means the encryption algorithm in this paper is much more effective in decreasing the adjacent correlation as wells.
(3) Entropy The entropy function of an image is given as follows:  Table 2. Comparing the encrypted Lena image in [22] with the encrypted Lena image in this paper, one can figure out that the entropy of the encrypted Lena image in this paper is larger than that in [22]. It means the Lena image encrypted by the proposed algorithm can get the higher randomness in the encrypted image.    −0.0017 −0.0013 Figure 12 0.8761 0.7786 Figure 14 0.0018 −0.0031 Figure 16 NaN NaN Figure 18 −0.0042 −0.0048 Encrypted Lena image in Ref. [22] 0.003

Correlation. Horizontal Vertical
(3) Entropy The entropy function of an image is given as follows: p(ρ(a, b)) log 2 p(ρ(a, b)), where a,b are the numbers of the rows and the columns of the image, ρ(a, b) is the pixel value at the ath row and the bth column in the image, and p(ρ(a, b)) is the probability of image pixel at the ath row and the bth column. Entropy demonstrates the randomness of the image and the value range in [ 0 8 ] for an image having 256 scales. The high value of entropy means the encrypted image has a greater amount of randomness. The value of entropy of the proposed algorithm is shown in Table 2. Comparing the encrypted Lena image in [22] with the encrypted Lena image in this paper, one can figure out that the entropy of the encrypted Lena image in this paper is larger than that in [22]. It means the Lena image encrypted by the proposed algorithm can get the higher randomness in the encrypted image. F. Ability to resist differential attack The differential attack is a good method to break the proposed encryption algorithm. If the encryption method has good sensitivity and diffusion property to the plain image, it can resist those attacks. There are two indexes to evaluate the diffusion property, the number of pixel changing rate (NPCR) and unified averaged changed intensity (UACI). NPCR implies the change rate between two encrypted images C 1 and C 2 encrypted from two plain images with only one pixel different. NPCR and the UACI are defined as (42) and (43) (1) NPCR : (2) UACI : where D(i, j) is defined as D(i, j) = 0, if C 1 (i, j) = C 2 (i, j) 1, if C 1 (i, j) = C 2 (i, j) .
Here, we encrypt the Lena image, baboon image, and all-black image as C 1 , and change the value of one pixel Lena image, baboon image, and all-black image then encrypt as C 2 . Then, calculate the values of NPCR and UACI, and compare NPCR and UACI of the proposed method with the others [20,22] in Tables 3 and 4. One can find that NPCR applied in color images is over 99% and NPCR applied in the all-black image can be also over 99%. UACI applied in the color images can be over 33% and UACI applied in all black image can approach 33%. The result shows that the proposed encryption algorithm is sensitive to a tiny change in image, even if the change is only in one pixel. The comparison results in Table 5 reveal that the method proposed in this paper has better results in NPCR and UACI tests. Thus, the proposed encryption algorithm is strong enough to make the differential attack ineffectively.  [20] 99.61% 33.46% Liu et al. [22] 99.63% 33.41%

Conclusions
This paper proposes a digital-redesign SMC-based control law to achieve the chaotic synchronization. The proposed encryption/decryption algorithm integrates the synchronization technology of chaotic systems with the secret key transmission which embeds the secret keys in the chaos trajectory of the chaotic system. Therefore, the secret keys do not expose in the public channel and the security is improved. The designed controller makes the sliding trajectories converge to the sliding mode and complete synchronization. Furthermore, the proposed discrete digital-redesign SMC-based control law can make the controller easy to realize with high precision and low cost by using Raspberry Pi microcontrollers. After designing the controller, we construct the secure communication based on the chaotic synchronization. Furthermore, a chaos-based image encryption algorithm is established by the S-boxes to strengthen the complexity of the encryption algorithm. Security analysis has been included to verify the feasibility and effectiveness for the proposed encryption algorithm.