Digital Image Encryption using Composition of RaMSH-1 Map Transposition and Logistic Map Keystream Substitution

—Digital communication of multimedia data (text, signal/audio, image, and video) through the internet network has an important role in the era of industrial revolution 4.0 and society 5.0. However, the easiness of exchanging personal and confidential digital information/data has a high risk of being hijacked by irresponsible people. The development of reliable and robust data encryption methods is a solution to this risk. This paper suggests combining modified Henon Map transposition encryption and Logistic Map keystream substitution encryption to create a novel data encryption method (called RaMSH-1). The proposed algorithm simultaneously transposes data positions and substitute data values randomly, as well as having encryption key combination or key space of 1.05 × 10 670 . A few images with various sizes and variations of color features, object shapes, and textures have been tested. Based on the results of the analysis of randomness, key sensitivity, and visual, it is evident that the proposed encryption algorithm is resistant to differential attack, entropy attack and brute force attack.


INTRODUCTION
Data security is an important issue in technological advances. Private data requires data security to protect the data from hacker or cracker [1]. Cryptography is a science related to data security. Cryptography is used to transform plaintext into ciphertext to make the meaning of message difficult to read [2]. Data can be in the form of digital images that can have many meanings. Data security methods such as encryption can be implemented on digital image data.
Transposition and substitution methods are techniques of data encryption. The transposition method in data security is used to randomize data by permuting the position of data sequence from the original data [3]. In the digital image encryption, this method is used to randomize the pixel position coordinate. The new pixel position coordinate is an encrypted image. The substitution methods are used to replace original data with other data [4] [5]. This method is used to replace the pixel color intensity value to a different value [6]. The new pixel color intensity value is an encrypted image. These two methods can be combined to strengthen the security of encrypted image.
Transposition and substitution techniques have been used in numerous studies on digital image security. Ping's research suggests applying Henon Map keystream substitution and transposition for encryption. Henon Map comes in two models which are transposition and generating keystream. Henon Map transposition encryption and decryption functions can only be used for square-size-image N×N (width = height) [7].
Research by Lone proposes encryption using Random Matrix Affine Cipher (RMAC) transposition, Henon Map transposition, Logistic Map keystream substitution. The encryption process is carried out sequentially, so it takes longer time in encryption process. Research by Lone has limitation which is that the encryption process cannot be implemented on images with size of M≠N (width ≠ height) [8].
Research by Ratna proposes encryption using Cat Map transposition and Henon Map keystream substitution. The encryption process on image with size M≠N is carried out by adding dummy pixels, so the image size is larger than the original size. The limitation in Ratna's research is that the Cat Map transposition function can only carried out in the image with size N×N [9].
The Henon Map and Cat Map transposition functions have the advantage of being able to randomize the position of pixel coordinates based on the value of key variable, but these functions have limitations which can only be implemented on image with size N×N. Padding the image with size M ≠ N (width ≠ height) into N×N (width = height) can be done but it will enlarge the size of original image, so the encryption process times takes longer.
The Logistic Map functions has the advantage of being able to generate a keystream using two sensitive key variable which can be used to substitute pixel color intensity values, but to strengthen the security of encryption method, the substitution technique can be combined with transposition technique. This paper proposes a combination of transposition and substitution encryption method called RaMSH-1 (Rama, Madenda, Suhatril, Harmanto). In the transposition encryption section, a modified Henon Map function is proposed, so that it can be applied to all image sizes without padding. Furthermore, the combination of the proposed transposition encryption function with the Logistic Map keystream substitution function aims to increase the encryption key combination so that the probability of finding the key will be smaller. www.ijacsa.thesai.org

II. METHODS
This research proposes the RaMSH-1 Map transposition and Logistic Map keystream substitutions functions for encryption and decryption methods. The development of proposed method aims to encrypt and decrypt digital image with all size of image and has a high level of security. This study is focused on 8-bit RGB images.
The RaMSH-1 Map transposition is used to randomize the pixel position coordinates and the Logistic Map is used to generate a keystream that is used to replace the pixel color intensity values. The encrypted image is represented by new pixel position coordinates and color intensity values. To convert the encrypted image back to the original image, the pixel position coordinates, and color intensity values must be restored. The proposed methods for encryption and decryption are shown in Fig. 1.

A. RaMSH-1 Map
RaMSH-1 Map is modification of the Henon Map transposition function. Henon Map function has limitation which can only perform encryption and decryption on image with size N×N (width = height) because there are a crossing transposition in coordinates x  y and  x so some pixels in the original image with different coordinates (x y) are transposed to the same coordinate (x ) [10]. This cause-the pixels cannot return to the original coordinates when decryption process is carried out. Eq. (1) and (2) are the encryption and decryption functions of Henon Map Transposition.
Modification of the Henon Map to RaMSH-Map is carried out by transposing x  x and  y. The modulo process is also carried out according to the size of image at these coordinates. Eq. (3) and (4) are the encryption and decryption function of the RaMSH-1 Map transposition.
The variable keys of RaMSH-1 Map function are c and d with positive integer values. The width of the image is represented by M. The height of the image is represented by N [11]. The pixel coordinates are represented by (x, y). I(x,y) represents the original image as its value. The value of I(x ) represents an encrypted image whose pixel position coordinates have been randomly generated. RaMSH-1 Map function can be applied in all image size.

B. Logistic Map
The chaotic function known as the logistic map is highly sensitive to the generation of keystream [12]. The original image's pixel color intensity values are substituted with the keystream value, changing the color intensity value. The Logistic Map function to generate keystream is defined in Eq. (5).
The Logistic Map function has two key variables g 0 and z which are real number with range of value 0 < g 0 < 1 and 3.5 < z ≤ 4. The keystream is calculated by Eq. (6). The keystream is represented as e n with value from 0 to 255. The value of n is the numbers of pixels in the image where n = (0 …. T-1), T = M×N. Keystream substitution is carried out by XOR process in Eq. (7). 567 | P a g e www.ijacsa.thesai.org

C. Proposed Encryption Algorithm
RaMSH-1 Map transposition is used in Eq. (3) to randomize the pixel position coordinates during the encryption process. The encryption algorithm that is proposed is Algorithm 1. Algorithm 2 is used to modify the pixel color intensity values by keystream substitution.

Algorithm 1: Process for Proposed Encryption
is generating encrypted image using a keystream replacement to change the value of the pixel's color intensity. The encryption technique uses a single loop to carry out the transposition and substitution operations.

D. Logistic Map Keystream Algorithm
The Logistic Map function in Eq. (5) and (6) are applied in the keystream generation process. The Logistic Map keystream algorithm is used in Algorithm 2.
for end function end is a calculation of pixels number in the image.
Step g n+1 is the Logistic Map function.
Step e n is a function to generate keystreams Logistic Map. Keystreams were generated in an amount equal to the number of pixels in the image.

E. Proposed Decryption Algorithm
The decryption method uses the same procedure as the encryption process, but instead returns values for pixel position coordinates and color intensity. The proposed decryption algorithm is Algorithm 3.

Algorithm 3: Process for Proposed Decryption
Input: Variable c, d, g 0 , z, Cipher Image The variable key used in the encryption and decryption processes is same. The distinction between the encryption and decryption processes is that the decryption process uses encrypted images as input, whereas step of algorithm 3 restores encrypted images to their original forms.

III. RESULT AND DISCUSSION
The research experiment of proposed algorithm used image data with variety of colors, shape, and texture. The size of image is M = N: 512×512 pixel, M > N: 1500×1000 pixel, and M < N: 2850×3200 pixel. Matlab R2020a, which runs on a computer system with an Intel (R) Core (TM) i7-4790 CPU, a processor clocked at 3.60 GHz, 16 GB of RAM, and the Microsoft Windows 10 operating system, is the software utilized in this study. The analyses used in the experimental are histogram, correlation, NPCR, UACI, decrypted image quality, key sensitivity, and key space.

A. Histogram Analysis
The distribution of pixel color intensity in an image is displayed using a histogram [13] [14]. In this study, the pixel color intensity distribution was represented by a histogram, which can demonstrate the effectiveness of pixel randomization in the encrypted image produced by the proposed technique. If the histogram displays a particular pattern, the information in the image can be interpreted easily [15]. In column 3 of Table I, are encrypted images that visually differ from the original image. Columns 4 and 5 show how the histogram of every original image follows a certain pattern, while the histogram of every encrypted image follows a uniform pattern. This shows how the proposed algorithm can change the color intensity value and randomize all pixel coordinates within the encrypted image. It becomes www.ijacsa.thesai.org challenging to interpret the information in an encrypted image [16].

B. Correlation Analysis
The correlation parameter is used to determine how similar two neighboring pixels are to one another in an image's horizontal (I(x,y) and I(x+1,y)), vertical (I(x,y) and I(x,y+1)), and diagonal directions (I(x,y) and I(x+1,y+1)). When the correlation value is near to 1 or -1, two neighboring pixels are either closely associated or have comparable colors [17]. In contrast, if the correlation value is close to 0, either both adjacent pixels have a high degree of randomness or there is low color correlation between them [18]. Eq. (8) functions as the correlation formula, where A and B are similar images that represent two nearby pixels on all three directions. The average value of all the pixels in images A and B is represented by variables and , respectively.
Columns 5, 6, and 7 of Table II display that the correlation absolute value of the encrypted image ranges from 0.00024 to 0.10269. In columns 2, 3, and 4, the encrypted image has a lower correlation value than the original image. This shows that the proposed algorithm can randomize each bit of information in the encrypted image, making it impossible to crack the data. The level of randomization in pixel color intensities is displayed in Table II. The curve lines of the original images can be seen moving diagonally in columns 2, 3, and 4, which indicates that the two neighboring pixels in the original image have a strong correlation. However, columns 5, 6, and 7 display the random movement of the curve lines of the encrypted image, indicating that the color correlation between two neighboring pixels in the encrypted image is low. The proposed image encryption algorithm can randomize the position and color intensity of every pixel so that the messages contained in the encrypted image are difficult to read, according to the correlation value and correlation curve in Table II.

C. Decrypted Image Quality Analysis
Peak Signal to Noise Ratio (PSNR) and MSE (Mean Square Error) are used to evaluate the quality of encrypted images. Eq. (9) functions as the PSNR formula, and Eq. (10) is used to calculate the MSE value between the original image and the decrypted image [9]. The quality of the decrypted images is evaluated using an RGB image with a resolution of 2850×3200 pixels.
The encryption algorithm used by the previous researcher is listed in Table III [19]. It means that the proposed algorithm can be used to process images of all image size.

D. NPCR and UACI Analysis
The NPCR (Number of Pixel Change Rate) parameter measures how differently colored pixels in the original image affect the outcomes of the encrypted image [20] [21]. The UACI parameter assesses the average pixel change percentage in the encrypted image. The security level of an algorithm's resistance to differential attack is shown by the NPCR and UACI value [7] [22].
Eq. (11) and (12) are the formulas of NPCR and UACI where C1 and C2 are two encrypted images. The D xy coefficient is the similarity value of pixel in same coordinate of both C1 and C2 images. The C1 xy and C2 xy are color intensity values of the C1 and C2 at the (x,y) position.
The largest UACI value is 33.37521%, while the largest NPCR value is 99.61014%, according to Table IV. The proposed algorithm is resistant to differential attack [8] and has sensitivity of pixel changes in original image effects to encrypted image results since both values are above the standard 99.6% of NPCR value and 33.3% of UACI value.

E. Entropy Analysis
The entropy parameter calculates the minimal average number of bits required to decode a symbol from a sequence of www.ijacsa.thesai.org bits. The entropy value displays the effectiveness of the algorithm's security level and the degree of unpredictability in the encrypted image [23]. Entropy is calculated using Eq. (13), where Pi is the chance that a pixel with the value of i will appear. Entropy can have a maximum value of 8 [8] [24].
The highest entropy value, according to Table IV, is 7.99980. It shows that the proposed algorithm can randomize the pixel coordinates and change the pixel color intensity value in the encrypted image and is resistant to entropy attacks [14].

F. Key space Analysis
The proposed algorithm is composition of Logistic Map substitution and RaMSH-1 Map transposition. The key variables are c, d, g 0 , and z. The range of values c, d ∈ ℤ + . The range of values for z and g 0 are 3.5699 < r ≤ 4 and 0 < g 0 <1, respectively, where g 0 , r ∈ ℝ + [8]. In Matlab, the largest integer number value is 2 64 ≈ .8 × 0 19 and the largest real number value is 1.8 × 10 308 . The default mantissa value in floatingpoint is 10 15 [23]. Table V shows the proposed algorithm's key space.  10 24 computations in a second is used to simulate testing every key combination [22]. It would take 3.33 ×10 639 years to complete the vast array of computations through the computer in a single year (1.05 × 10 670 ) ÷ (10 24 ) × 365 (days) × 24 (hour) × 60 (min) × 60(s) = 3.33 ×10 639 . This amount of time for attempting every combination is sufficient to fend off a brute force attack [23] [25].

G. Key Sensitivity Analysis
The proposed algorithm using four variable keys. Key of c and d are positive integer numbers. Key of g 0 and z are positive real numbers. The decrypted key value with small changes on decrypted process will affect the decrypted image. The key sensitivity can be seen in Table VI.
Table VI row 2 shows the decrypted keys for decryption process are c = 20, d = 30, g 0 = 0.1, and z = 3.6. Each key is changed with a very small value change in key values. Rows 3, 4, 5, and 6 show the decrypted image still unreadable. In row 5 shows the key sensitivity of g 0 reached 10 -16 which indicate the proposed algorithm is robust against brute force attack.

IV. CONCLUSIONS
The Henon Map transposition function is modified in the RaMSH-1 Map transposition. The proposed algorithm can be applied for all image size without padding. The key variable of proposed algorithm generated a key space of 1.05 × 10 670 . The entropy values reached 7.99980 out of 8 as perfect entropy value. The correlation value for all encrypted images is very close to 0, indicating that there is no correlation between the color intensity of neighboring pixels. Entropy and correlation analyses show that the encrypted image's information is all scrambled, which makes it hard to decipher. The results of the key sensitivity reached 10 -16 which indicate the proposed algorithm is very sensitive. The UACI value of 33.37521 and the NPCR value of 99.61014 respectively show that the proposed algorithm is resistant to differential attack.

V. FUTURE WORK
The proposed algorithm's weakness is that it only uses four variable keys. The algorithm's key space can be expanded. The data security can be improved by combining RaMSH-1 Map transposition, Logistic Map substitution, and Cat Map transposition.