An Image Encryption Scheme Using a 1D Chaotic Double Section Skew Tent Map

Department of Electrical and Computer Engineering, Faculty of Engineering, King Abdulaziz University, Jeddah 21589, Saudi Arabia Department of Electronics and Communications Engineering, Alexandria Higher Institute of Engineering and Technology, Alexandria, Egypt Department of Electrical Engineering, College of Engineering and IT, Onaizah Colleges, Al-Qassim 56447, Saudi Arabia Department of Computer Engineering, 1e Higher Institute of Engineering and Technology, El-Behera, Egypt


Introduction
In the current era, digital technology is changing all aspects of everyday life. It has revolutionized the way data is stored, displayed, and transmitted. However, with the increase of digital-based applications such as mobile communications, cloud storage, and the Internet of things (IoT), more advanced methods of securing these data are also being developed. While many logical/physical techniques exist to protect sensitive data from unauthorized access and accidental or intentional destruction [1], encryption is the most popular method of choice for securing them. As depicted in Figure 1, an encryption/decryption should incorporate three basic elements: a message, an encryption/decryption scheme, and a key [2].
Despite the fact that the strength of an algorithm comes from the strength of its key [3,4], other critical factors come into consideration for the overall performance. Some of these factors would be the computational load of their mathematical representation [5][6][7][8][9][10][11], the generated key size, and the randomness of the generated sequence.
is is one of many reasons why cryptologists have turned to chaotic functions as many chaotic functions are simple in their mathematical representation [12][13][14], such as 1-D functions with iterative difference equation [15]. ese functions are also characterized by their high sensitivity to initial conditions, aperiodicity, and unpredictability [16]. For all these reasons, these functions seem to be ideal for encryption application.
When it comes to hardware implementation, the cost of realizing low dimension maps (specially 1D maps) decreases significantly with respect to higher-order ones. However, PRNG with a single 1D chaotic map as its core proved to be inefficient with generally two main issues [17][18][19][20][21][22]; (i) its limited number of control parameters and (ii) its orbit collapsing to a specific period under finite precision implementation. Recent studies suggested that 2D chaotic maps may be considered as a midpoint balance between hardware complexity and chaotic performance.
is is clearly shown in the recent work of Zhongyun Hua where the complexity of 2D chaotic maps was improved by using a two-dimensional sine chaotification system (2D-SCS) in [23] and two-dimensional modular chaotification system (2D-MCS) in [24].
For the second issue, [25,26] investigated the effect of finite precision on the periodic and chaotic behaviour of the logistic and coupled logistic maps. In [27], further studies of the same effect were conducted on single and coupled skew tent maps, the authors then presented a modified design to reduce the effect of limited finite precision realization on coupled skew tent maps. e finding of the research gives deep insight on how this issue needs a lot of attention in hardware implementation of chaotic systems.
is manuscript deals with the first issue mentioned above by introducing a 1D difference chaotic map with five variable parameters (not including the initial condition). e map is first analyzed for chaotic properties and its capability to be used as pseudorandom number generator (PRNG). en, based on the promising results of the map histograms and statistical analysis, the proposed map will be used as a RING in a new image encryption scheme. Despite the map simplicity, its unique feature of increasing the number of control parameters allowed a key space large enough to withstand brute-force attack. Further analysis of the whole encryption scheme showed good confusion-diffusion properties.
is paper is organized as follows: Section 2 gives the mathematical representation of the presented map with an investigation of its chaotic properties; in Section 3, a new image encryption algorithm using the introduced map is presented and the encryption results were subjected to many statistical tests to prove its robustness. e conclusion is given in Section 5.

A 1D Map with Variable Control Parameters
In this section, a 1D map with variable control parameters is introduced. Multiple analysis is conducted to validate its chaotic property. en, the possibility of employing it as a potential pseudorandom bit generator (PRBG) is tested.

Mathematical Representation.
e first order discrete dynamical system in Figure 2 is given by where x ∈ R + : x ∈ [0, L 2 ], and L 1 , L 2 , p 1 , p 2 , h ∈ R + acting as the control parameters. Although the previous postulate stated the range of x and the control parameters to be in positive real number set R + , for the function to exhibit fullchaotic behaviour, the following conditions must be satisfied: Although the function in (1) may seem to resemble the second iterate of the skew tent map given by It is obvious that more system parameters were added to increase the control on its topology, where the map described by (2) has only one control parameter p, while the proposed function has five L 1 , L 2 , p 1 , p 2 , h . In addition, expanding the phase space to [0, L 2 ] makes it difficult to estimate the control parameters using chaotic signal estimation technologies for 1D maps [28,29]. Decryption key k d Figure 1: Basic encryption/decryption system.  Figure 3. It is visually clear that any f n iterate has k � 2 2n− 1 "skew tent" and the iterate f n maps itself to the interval [0, L 2 ]. is implies that n satisfies f n (U 1 ) ∩ U 2 ≠ ϕ and that the presented function is topologically transitive.

Dense Periodic
Orbits. By definition, a point x ∈ X is a periodic point for f with period n ∈ N >0 if f n (x) � x. us, by referring to Figure 3, it is obvious that f n intersects a line y � x in 2 2n locations (once in each interval). As a result, each interval contains a fixed point of f n that results in a periodic orbit of period n. erefore, periodic points of f are dense in [0, L 2 ].

Sensitivity to
Sensitivity to the initial condition x o e map f: X ⟶ X is sensitive to the initial conditions if for any x ∈ X and any neighbourhood N of x, there exist y ∈ N and n ≥ 0 such that |f n (x) − f n (y)| > δ, where δ > 0. e presented map shows high sensitivity to the initial condition as depicted in Figure 4. Two trajectories starting from two nearby initial points x o , x o + d (where d ∼ 10 − 9 ) coincide at first and then evolve incoherently afterwards.
Sensitivity to the control parameters p 1 , p 2 , L 1 , L 2 : To test the sensitivity of the proposed map for any small perturbation in the control parameters, a sequence S 1 is generated using the values of p 1 , p 2 , L 1 , L 2 . en, another sequence S 2 is generated but with a small perturbation of d ∼ 10 − 9 to any of the control parameters. e cross-correlation results in Figure 5 show that no correlation was detected between S 1 and the sequences of S 2 .
is proves the sensitivity of the proposed map to any small change in any of the control parameters.

Lyapunov Exponent (LE)
. For a dynamical system with two infinitesimally close initial points (x o and x o + d) generating two nearby trajectories, the rate of exponential divergence of these nearby trajectories is called the Lyapunov exponent and is defined by where δ o and δ 1 represent a separation between two trajectories. By itself, the Lyapunov exponent defines the degree of sensitivity to the initial condition. However, for a dynamical system bounded in a finite phase space, it is the familiar test for chaotic behaviour where positive LE indicates chaos. e procedural steps described by Sprott in [31] allow the calculation of the Lyapunov exponent numerically as follows: (1) Choose any initial condition in the basin of the trajectory. Since there are multiple system parameters controlling the topology of the presented function, Algorithm 1 shows how the Lyapunov exponent was calculated by varying p 1 and p 2 while fixing L 1 to half of L 2 . e 3D depiction and contour representation of the result in Figures 6(a) and 6(b) show that, for all values of p 1 and p 2 , λ > 0 and subsequently the orbit is "unstable." is emphasizes that the map possesses a chaotic behaviour for all values of p 1 and p 2 . is is also considered an advantage over the LE of the tent map given by (4) and having only one control parameter μ ∈ [0, 2]. In comparison, it is visible from Figure 6(c) that, for the tent map to be "unstable" (λ > 0), μ must be greater than "1", whereas in the proposed map λ > 0 for all values of the control parameters:   Figure 7 reveals the uniformity of the output sequence for different (random) values of the control parameters p 1 , p 2 , L 1 , L 2 . is is an indication of good cryptographic property as a uniform distribution gives little information about the system and its control parameters. e chaotic map described by (1) is used to generate a binary sequence according to the simple and basic scheme shown in Figure 8.
e seed x o along with the control parameters is randomly selected. e generated bit-sequence is subjected to a statistical test to check for clear patterns and its suitability as a (PRNG).

Statistical Testing.
e statistical analysis was conducted by the suite provided by the National Institute of Standards and Technology (NIST STS) [32]. NIST package comprises 15 tests that target the discovery of nonrandom patterns in the generated sequence. It tests for two types of hypotheses: null hypothesis H 0 (i.e., the sequence under test is random) and the alternative hypothesis H a (i.e., the sequence under test is not random). After each test, a decision is produced with two possible outcomes, either accept H 0 or accept H a . ese decisions are based on calculating the probability (P-value) and comparing it with a significance level (α). For cryptographic applications, common values of α are about 0.01. Hence, of P-value ≥ α, then the null hypothesis is accepted (random sequence). If P-value < α, then the null hypothesis is rejected (not random).
After the test is conducted, the resultant P-values are counted and distributed over ten subintervals in the range of [0, 1]. Overall distribution of these P-values is determined using the incomplete gamma function P-values � igamc((9/2), (χ 2 /2)), where χ 2 is the chi-square of the resultant P-values of a given test and is calculated using Complexity where m is the sample size and F i is the number of P-values in the i th subinterval. NIST considers the sequences to be uniformly distributed if P-values ≥0.0001. e generator is tested by producing m � 1000 sequences with a length of 10 6 bits each (m � 100 should be sufficient with respect to α � 0.01; however, we choose m � 1000 to increase the accuracy of our test and prove the robustness of our system). For each sequence, x o , p 1 , p 2 , L 1 , L 2 were randomly chosen and the 15 tests were applied with the results listed in Table 1. To interpret these empirical results, an acceptable proportion range called the confidence region is determined using where p � 1 − α and α � 0.01. For any test, the evidence that the data is not random is manifested when a result proportion falls outside this interval. Substituting in (6), we get the confidence interval of [0.9805607, 0.9994392]. e proportion of sequences that passes a test and the confidence region is shown in Figure 9, where all proportions lie within the confidence interval region. is is an indication that (1) can be used as PRBG suitable for cryptographic applications.

Application to Image Encryption
roughout the years, various techniques were devised to achieve the highest possible levels of encryption efficiency [33]. Like other types of data that these methods have been applied to, image encryption is a real challenge due to the evolution in both cryptanalysis techniques and the electronic devices used to apply them [34]. In 1998, Fridrich et al. [35] introduced a scheme based on the baker map; since then, various schemes based on chaotic maps were given in literature [36][37][38][39][40][41][42][43][44][45][46][47][48][49][50][51]. e algorithms based on the tent map and skew tent maps have also been investigated. For example, Li et al. [52] proposed image encryption based on a pure chaotic tent map. However, [53] showed that this system suffered from multiple drawbacks since it is very simple and depends only on the diffusion step while omitting the permutation phase. e skew tent map was used in [54] with the orthogonal matrix and in [55] with cellular automata to produce a robust and secure image encryption schemes.
In this section, we introduce a new image encryption scheme based on the presented 1D chaotic function along with its security analysis.  9 . e results show that there is no correlation between the sequences and that the proposed map is very sensitive to any small change in any of the control parameters.

e Proposed Scheme.
e proposed scheme ( Figure 10) has four rounds with each round consisting of five horizontal stages as follows: (1) e dimension M × N of the image (I) is calculated and fed along with a key to X � f(k 1 ) and Y � g(k 2 ). Each function will produce a stream of chaotic random-like numbers with the length where l is the number of eliminated iterations from each chaotic function and G is a gap length used to separate subsequences. (2) Four subsequences X 1 , X 2 , X 3 , and X 4 are extracted from X transformed to M × N matrices. (3) Four permutation matrices PM 1 , PM 2 , PM 3 , and PM 4 are formed using X 1 , X 2 , X 3 , and X 4 . (4) According to the round number, an image is permuted (PI n ) using the permutation matrix PM n . (5) Four subsequences Y 1 , Y 2 , Y 3 , and Y 4 are extracted from Y with Y n used for the diffusion step of PI n to produce C n .
3.1.1. Secret Key Structure. Two unique keys (k 1 , k 2 ) are fed to (f, g) for generating a random-like stream. As seen from Figure 11, the whole key is divided into two subkeys, with each containing the necessary parameters for (1) to operate efficiently, namely, x o , p 1 , p 2 , L 1 , L 2 , h. As described in the previous section, h is the height of the map and is usually equal to L 2 . However, it was found that choosing h � L 2 − δ, where δ is smaller than 1 × 10 − 3 will produce numerical sequences with better uniform distribution and random-like properties, thus leading to expanding the key space and increasing the security of the system. Here, we select the first five variables to be 32 bits each and δ to be 10 bits long. As a result, each key will have a length of 170 bits with an overall of 340 bits for the whole key. e first five variables in each key are calculated based on fixed-point representation using the following formula:   (1) for p 1 ⟵ 0 to L 1 do (2) for p 2 ⟵ L 1 to L 2 do (3) run the map for N times for i ⟵ 1 to N do (7) run the map with initial xa o (8) run the map with initial xb o (9) 11) readjust the perturbed trajectory using: (12) x X (S1 : S2)

Complexity
However, δ is calculated using where var represents any of the variables x o , p 1 , p 2 , L 1 , L 2 , and h. B i+1 represents the bit position from left to right, structured for two bits as the integer part and 30 bits for the fraction. is directly tackles the weak key property discussed in [56] especially when using floatingpoint representation to construct the key.

Permutation Stage.
e redundancy characteristic in a digital image leads to a high correlation between its adjacent pixels. Hence, breaking this correlation by pixel permutation is an important step for securing a scheme against statistical attacks. In this manuscript, we used a simple and effective permutation algorithm to attain this task ( Figure 12). We start by using the dimension of the original image (M × N) and the subkey k 1 to generate the following sequence using f(x, k 1 ):  Complexity where l and G are the eliminated iterations and the gap between the extracted subsequences. e next step is to extract four equal subsequences from X according to the following formulae: where S 1 � l, e extracted X 1 , X 2 , X 3 , and X 4 are converted to 2D matrices with dimensions of M × N. For the first round, the 2D matrix from X 1 will be sorted first by columns and then by rows, while taking into account the retention of the original location of each cell. e pixels of the original image are then permutated according to these matrices. e same steps are used to permutate the ciphered image from each round.

Diffusion Stage.
To increase the resistance against differential attacks, any small change in the original image should lead to nonuniform spreading across the ciphered image. After the permutation stage, the diffusion phase is designed to attain this goal by replacing the bit level value of each encrypted pixel with the previously encrypted pixel and the generated key stream Y n according to the following formula: where A i is equivalent to I or C n according to the encryption round. E i is defined by Similarly, by reversing the steps in Figure 12 and using (12), decryption of the encrypted image can be achieved.

Experimental Results and Security
Analysis. An encryption scheme is said to be robust if it withstands its security against all types of known attacks like key bruteforce attack, statistical attacks, and differential attack. In this section, the proposed scheme is subjected to various security analysis methods to verify its robustness. All calculations were performed using a 64-bit double-precision floatingpoint representation. e experimental analysis was done using 64-bit MATLAB (R2015a) running under Windows 10 installed on a Core i7 2.2 GHz machine with 8 GB of RAM.

Security of the Key Space.
In the presented algorithm, the secret key consists of two subkeys (k 1 and k 2 , with an overall of 340 bits composing the whole key. Hence, 2 340 or ∼10 102 attempts are required to brute-force the key. is verifies that the key space is large enough to withstand a brute-force attack.

Key Sensitivity
Analysis. An encryption scheme is sensitive to its secret key if (a) a change of one bit in the key will produce a completely different ciphered image and (b) a change of one bit in the key will produce a completely different decrypted image. In Figure 5, we proved the sensitivity of the proposed chaotic map to any small change in the initial condition or control parameters. Similarly, the effect of changing the least significant bit in the key on the encrypted image is depicted in Figure 13, where Figure 13(a) is the original image. en, we used the values listed in Table 2 to initially construct the key � k 1 , k 2 . e key is then used to encrypt the original image as shown in Figure 13(b) (we call the encrypted image C 1 ). Figure 13(c) is another encryption (C 2 ) of the original image but by flipping the LSB in one of the control parameters in the original key. To verify if changing only one bit produces a completely different encrypted image, absolute pixel-by-pixel subtraction was performed between C 1 and C 2 (|C 1 − C 2 |). e result of this subtraction is shown in Figure 13(d), e noisy figure is an indication that two different encrypted images were produced with a slight change in the original key.
To further elaborate on this, the previously described test was repeated for all parameters in k 1 and k 2 . e mean square error (MSE) and peak signal-to-noise ratio (PSNR) were calculated according to (14) and (15) and listed in Table 3. e obtained numbers confirm the sensitivity of the scheme to all key parameters. Since k 1 is for permuting the pixels and k 2 is for changing the gray levels, the results in the table prove that the scheme has good confusion-diffusion properties: PSNR � 20 log 10 255

Histogram Analysis.
Histogram shows the distribution of color intensities in an image. A good encryption scheme would produce a ciphered image with a uniformly distributed histogram even for images with weak color intensity distribution. In Figure 14, each histogram of an original image shows unique intensity distribution, while all those of the encryption result exhibit a uniform shape. is indicates that the proposed algorithm can resist statistical attacks.

Correlation Analysis.
Since the high correlation of adjacent pixels in an image makes it vulnerable to statistical attacks, a robust encryption scheme should be able to break this correlation in the vertical (V), horizontal (H), and diagonal (D) directions. To calculate the correlation coefficient r xy , S random pairs of adjacent pixels are selected and substituted in the following equations: Figure 13: Key sensitivity of the proposed algorithm. e effect of changing one bit in the key on the encrypted images: (a) original image, (b) encrypted image C 1 using x o � 0 × 9AC32BC4 in k 1 (corresponding to 2.4181622900068759918212890625 in decimal form using (7)), (c) encrypted image C 2 using x o � 0 × 9AC32BC4 ⊕ 0 × 000000001 for k 1 , and (d) absolute pixel-by-pixel difference |C 1 − C 2 | indicating two different encrypted images were produced.  Table 2: Values used to test for key sensitivity in the proposed algorithm (these values can be converted to their decimal form using (7)).

Complexity 11
A visual display for S � 3000 pixels of such calculations is shown in Figure 15. It is visibly clear that pixel correlation is strong and compacted in the original image, while it is scattered and weak in the ciphered image. e result of subjecting different images to that test is listed in Table 4. All the numbers for the ciphered images suggest weak correlation and robustness against statistical attacks.

Information Entropy Analysis.
In physics, entropy is a measure of "knowledge", or its opposite "uncertainty" about a certain system. Applying this definition to cryptography shows that the less information we can extract from the ciphered message, the more secure the ciphering algorithm is. In 1949, Shannon [58] mathematically linked this definition to information security. For image encryption, this equation is given by where n is the number of bits representing the color intensity and P(m i ) is the probability of a color intensity m i in an image I. For a grayscale image, n � 8 bits with total gray levels of 256 (0 ∼ 255); if all gray levels in an image have the same probability P(m i ) � (1/256) which is equivalent to a uniform histogram, then the result of (17) would be 8. is indicates that, as the entropy value increases (very close to 8), less information can be extracted from it. In other words, histogram and entropy are both quantitative measures of "uncertainty": one with visual representation and the other with a numerical result. In Table 5, the result for the entropy analysis of several ciphered images is listed and confirms the uniform distribution of gray levels in them. Another where k is the number of blocks, T B is the number of pixels in each block, and H(I B i ) is the Shannon entropy of the block. Table 5 shows the comparison of LSE of the proposed scheme with other schemes using significant value α � 0.05, k � 30, and T B � 1936. is led to a critical interval of      3.2.6. Resist to Differential Attack Analysis. A robust encryption scheme should also be sensitive to small error in the plaintext. at is, while using the same key, a change in one pixel in the plain image would produce a completely different ciphered image. If a scheme possesses this property, then it has the ability to resist differential attacks.
In practice, number of pixels' change rate (NPCR) and unified average changing intensity (UACI) are the two common methods for measuring this type of sensitivity. Consider two images I and I ′ , where I ′ is slightly different from I by one pixel only. Encrypting both images with the same key will produce C and C ′ . NPCR measures the absolute number of pixels with the same position in C and C ′ that changed value where T � M × N is the number of pixels in the image. An ideal scheme would produce NPCR � 1 which implies that no relation between C and C ′ can be achieved. But since this value is difficult to attain, values very close to unity could be accepted under a certain criterion.
UACI measures the average intensity difference between C and C ′ using the following equation: where L is the maximum level of color intensity. Criterions for accepting the results of both tests were given in [41]. For NPCR, a test result is accepted when it is greater than or equal a one sided hypotheses N with α as its significance level: where Φ(·) − 1 is the inverse CDF of the standard normal distribution N(0, 1). For UACI test, the result of an encryption is considered a pass if its value falls inside the interval [U * − α , U * + α ] as follows: Using α � 0.05, typical values of N * α , U * − α , and U * + α for different image sizes are listed in Table 6.
For the proposed algorithm, 26 gray scale images with different sizes were subjected to the NPCR and UACI test (α � 0.05). e results are listed in Table 7 with all scores passing the tests. ese results are a good indication that the proposed algorithm is robust and can withstand differential attacks. (PSNR). Another indication of encryption quality is to calculate the PSNR between the original image and the ciphered one.

Perceptual Security: Peak Signal-to-Noise Ratio
where M × N is the image size and P and C are the plain and ciphered images, respectively. Table 8 lists the PSNR of multiple images, where values greater than 25 indicate good encryption quality.

Execution Speed Analysis
To test the execution speed for both the proposed map and encryption scheme. A laptop with Intel(R) Core(TM) i7-4702MQ CPU @ 2.20 GHz and 8 GB RAM was used to perform the experiment. e average execution speed of the proposed maps runs at 6.2 ms while the conventional tent map executes at an average of 5.2 ms. e running speeds of the proposed encryption scheme for different image sizes are listed in Table 9. ese running speeds are acceptable considering the high level of security of the proposed scheme.

Conclusion
Recently, chaos theory has been linked to cryptographic applications. One-dimensional chaotic map has the simplest form of mathematical and hardware representation but suffers from many security problems like collapsing and limited effect of its control parameters. is paper introduced a 1D chaotic function with five variable control parameters in addition to the initial condition x o . e function proved to be topologically mixing with dense periodic orbits and sensitivity to its initial condition and control parameters. A simple PRNG based on the map was constructed and tested using NIST sts; the results gave a good indication of the strong cryptographic property of the presented map. Based on the presented map, a new image encryption scheme was presented. Several analyses proved the scheme to be robust against various types of attacks with good diffusion and confusion property.

Data Availability
All data included in this study are available upon request by contact with the corresponding author.

Conflicts of Interest
e authors declare no conflicts of interest.