A Novel Technique for Secure Data Cryptosystem Based on Chaotic Key Image Generation

: The advancements in Information and Communication Technology (ICT), within the previous decades, has significantly changed people’s transmit or store their information over the Internet or networks. So, one of the main challenges is to keep these information safe against attacks. Many researchers and institutions realized the importance and benefits of cryptography in achieving the efficiency and effectiveness of various aspects of secure communication.This work adopts a novel technique for secure data cryptosystem based on chaos theory. The proposed algorithm generate 2-Dimensional key matrix having the same dimensions of the original image that includes random numbers obtained from the 1-Dimensional logistic chaotic map for given control parameters, which is then processed by converting the fractional parts of them through a function into a set of non-repeating numbers that leads to a vast number of unpredicted probabilities (the factorial of rows times columns). Double layers of rows and columns permutation are made to the values of numbers for a specified number of stages. Then, XOR is performed between the key matrix and the original image, which represent an active resolve for data encryption for any type of files (text, image, audio, video, … etc). The results proved that the proposed encryption technique is very promising when tested on more than 500 image samples according to security measurements where the histograms of cipher images are very flatten compared with that for original images, while the averages of Mean Square Error is very high (10115.4) and Peak Signal to Noise Ratio is very low (8.17), besides Correlation near zero and Entropy close to 8 (7.9975).


Introduction:
Cryptography provides secure communication among individuals, governmental organization, corporations through the utilizing of codes and it can be used effectively to nullify the value of cyber threats in the presence of malicious third-parties, phishing, interception of information being stored in database or sent via networks. Thus, only those intended parties for whom the information was sent can interpret and analyze it. Certainly, this information relates to multiple areas, such as: financial accounts, civil or military aspects, scientific inventions, medical, educational, business applications, live-broadcast, or any sensitive data that someone wants to keep private … etc [1][2][3][4] .
Many encryption techniques were developed in the past decades to be adopted as a national standard for secure communication, like: DES, RSA, 3-DES, Two-fish, IDEA, AES. Yet, they are not suitable options for real-time multimedia cryptosystem of large size [4][5][6] . On the other hand, cryptanalysts are trying to develop their expertise and capabilities to find shortcuts to break the security of these cryptosystems. The AES is considered one of the foremost broadly utilized encryption methods today by the public whether they are individuals, institutions, companies. However, it suffers from longtime calculations in encryption/decryption processes (i.e., low-level efficiency with large multimedia). Therefore, there is a need to develop a fast and strong cryptographic cryptosystems with pseudo-random behavior. Dynamic systems theory and chaos demonstrated promising area within the field of cryptography for research and applications [5][6][7] . Chaos-based schemes are dominant techniques due to high randomization, simple cryptographic processes, and its sensitivity to initial control parameters, such that a minor deviation in its input parameters can lead to a large change in the output range values. This will guarantee that the plain-data and/or secret key can't be easily reconstructed 5, 8, 9 . Image encryption techniques acquire the attention of scientists and researchers in order to meet the growing demand for real-time information security. The following survey includes various efforts related to our paper objectives for secure data cryptosystems: In 1 , a scrambled plaintextrelated image cryptosystem based on improved Josephus traversing and pixel bits permutation is presented to enhance the abilities of resistance against different types of attacks. A combination of image segmentation of chaotic system, bitwise XOR and crossover operations are made to attain higher effects of randomness. In 5 , the authors worked on the scrambling of text according to a novel 2D chaotic function that exhibits a uniform bifurcation upon large parameters range. Genetic algorithm is used to optimize the parameters of the map and hence improve the security of textual data. In 9 an encryption algorithm is proposed to improve the security of a cryptosystem by solving the key management problem through a combination of an elliptic curve and chaotic system. In 10 , a novel architecture of image encryption algorithm' permutation and diffusion based on DNA rule matrix operations and 2D-LASM chaotic systems is proposed using 256-bit hash value. Security analyses are performed on multiple samples which prove the efficiency of the scheme and it robustness against known attacks. In 11 , a perturbed highdimensional chaotic system is investigated for image encryption according to Devaney conjugate definition to enlarge cycle and manage secure problems. The confusion/diffusion structure is designed based on separated Cat map. The test results prove high security of the technique with fast algorithm. In 12 , a framework and an algorithm are introduced based on dual Arnold and logistic chaotic maps for lightweight image encryption scheme. Miscellaneous groups of images have analyzed and produce very good results according to security measures. This paper aims to build a secure cryptosystem for the transfer of data among entities, whether individuals, companies, or state institutions, and for various military, medical, banking or other fields. A non-standard technique was adopted that aims to generate a two-dimensional chaotic key matrix image that includes enormous number of probabilities based on 1-D range chaos values for given control parameters (selected randomly by the system in order to ensure higher level of information security), which is considered the main target of any cryptosystem to make the mission of any cryptanalyst impossible, those numbers are processed in some way to produce non-repeated set of numbers. Successive processes are then performed on the 2-D key matrix including permutation, repetition, and diffusion. Initially, the values of numbers in both rows and columns are permuted for specified number of stages. After that, XOR operations are carried out between original image data and key matrix values. The resulted chaotic key image with flatten histogram represents the key to encrypt any secret data file.

Chaotic Theory
The security of information becomes a significant concern for all internet users. Hence, the data to be shared between any entities must be secure using an encryption technique prior to transmission.
Actually, a faster and secure technique that offers good ciphers is a chaoticsystem that has many attractive features for secure communications. Chaos theory has been used widely in modern cryptosystems. Its behavior exhibits/creates a random sequence, which is considered as a benefit of using chaos efficiently for real-time multimedia encryption instead of the traditional DES, RSA, AES, … etc [13][14][15] . Chaos sequences are generated through the use of iterative equations, +1 = f ( ), that will be produced randomly, aperiodic and unpredictable. Furthermore, it is important to mention that any little changes in the starting conditions will cause widely varying outcome sequences (i.e., very sensitive to initial conditions). The equations below are used to express it mathematically: , = 0, 1, 2, … ………….. 1 A property of the logistic map can be exhibited when the chaotic parameter (r) value ranges from 3.5 to 4, such that its behavior depends on r's value; otherwise, the values will instantly leave the interval [0, 1] when r exceeds 4. Eq.2 -Eq.4, are the results of substituting the values of n into Eq.1 13-16, 17, 18 :

The Proposed Cryptosystem
The proposed cryptosystem is composed mainly of sender and recipient components. Fig.1 displays the block diagram of the sender part. Conversely, the recipient reconstructs the original secret file by performing the decryption processes in reverse order. The system is implemented using Microsoft Visual C#.net 2019 and its performance was

Figure 1. The Block diagram of the proposed Encryption Technique
The idea is based originally on generating a cipher image by exploiting the properties of randomness from chaotic-maps, as indicated in Eq.1, which will be considered as a key to encrypt the plain data (i.e., secret file). The system selects randomly the initial parameters of the logistic map ( 0 , ), such that: 0 ∈ [0, 1] and ∈ [0, 4] in order to create the random sequence that was used in some manipulation to produce the values and ranges whose length is the same as image rows and columns dimensions, which will constitute the 2-D key matrix that will be generated after the extending of key Row and key column to a full keys of non-repeated values. Then, there is a re-permute to the 2-D key matrix according to the number of stages prior to XOR operations that are performed between pixels image data and its equivalent 2-D key matrix so as to obtain an encrypted key image. It is worthwhile that this step is performed in "offline" mode by the system which saves computational time and avoid delay. To convert the selected secret file (plain-form data) of any extension into a meaningless cipher form, initially the sender must follow the sequence of steps indicated in Algorithm 1 to generate the key image.

Algorithm 1. The Proposed Key Image Generation
Input : Image Img[H, W], H refer to height and W for the width; Number of Stages (nStages). Output: Encrypted Key Image Generation file whose data denoted by EncK[H, W]. a) The proposed system randomly select initial chaotic parameters ( 0 , ) such that 0.5 ≤ 0 ≤ 1.0 3.5 ≤ ≤ 4.0. b) Chaotic sequence values (VL) and ranges (RG) are generated according to a pre-specified range length. c) Convert VL & RG into a set of 1-D Vectors of non-repeated values after processing their floating-numbers (i.e., 4

908
The resulted key image will be used to encrypt the selected secret file through another bitwise XOR processes in order to make the confusion more powerful. Then, the 4-tuples header information (keyimageID, x0, r, nStages) which is composed of 13-bytes (i.e., 4-bytes represent the ID of selected key image from a set of common database images between sender and recipient, 4bytes is dedicated for each floating-point chaos initial parameters (x0, r) respectively, and the last byte for the number of stages allocated for permutation in the encryption phase) will be concatenated with the encrypted secret file to be sent to the intended recipient. The security of the suggested cryptosystem approach depends on a set of factors (most of them are produced arbitrarily), as indicated in the following points:  The random selection of initial chaotic parameters ( 0 , ) by the computerized program. The window-form program for the proposed encryption system relating to the sender is illustrated in Fig.2, with all parameters utilized to convert a secret image into non-interpreted form.

Figure 2. The Window-Form of the proposed Encryption system
In order to reconstruct the plain form of original secret file by the intended recipient over the communication channel, decryption processes must be performed in reverse way of what has been implemented during the stages of encryption; such that the 13 bytes header information will be extracted first from the encrypted secret file to obtain the 4-tuples (keyimageID, x0, r, nStages). Then, the same key image, chaotic sequence values besides ranges, and 2D key matrix permutation are all generated by the system accordingly. Consequently, the encrypted key image will be generated by following the same procedure stated in Algorithm 1 which will be diffused with the encrypted secret file to produce the original secret file.

Security Measurements
In this work some of security measurements will be applied to compute efficiency of the proposed encryption algorithm. where H represents the height and W is the width of the image.

b) Peak Signal to Noise Ratio (PSNR):
this measurement is utilized to assess an enciphering scheme, which points to the changes in pixel values between plain and cipher images. The lower value of PSNR represents better enciphering quality 10,13,[18][19][20][21] .
) / log (10) …….. 6 c) Correlation Coefficients: in a plain image, pixels are usually very correlated with their adjacent pixels in any direction, while the relationship between neighboring pixels in an enciphered image should be as low as possible in order to resist correlation analysis. The correlation coefficients are calculated as follows: where Corr. refer to the correlation, X is the plain image and its mean is X ̅ , while Y is the cipher image and its mean is Y ̅ . The association image values range from -1 to 1, such that the good encryption should have a correlation value near to 0 10, 13, 21-26 .

d) Information
Entropy: it is one of the most significant properties of randomness for an encryption planner analysis. It is the average amount of information content generated by a stochastic source of data. It is computed as shown in the following formula: where p(Xi) is the probability of symbol (Xi) and the entropy is expressed in bits. Ideally, the entropy value of the cipher message should to be close to 8 10,13,[19][20][21][22]24 .
e) Histogram Analysis: to avoid the information leakage for an intruder when encrypting an image, it must be made sure that the original and cipher images do not have any statistical similarity. Histogram distribute pixel values in a 2D graphical representation, the vertical axis represent the frequency of each color intensity level (L range from 0 to 255) occurred in image. The more flatten histogram indicates a higher encryption technique 13,[20][21][22][23][24] .

Results and Discussion:
To evaluate the efficiency of the proposed encryption technique according to the above security measurements, a number of experimental tests were performed, as shown in Tables.1-3, on more than 500 color/gray image samples collected from different color maps data sets (including: CSet8, CBSD68, Set12, kodak24 …etc) of various dimensions and format types.  From the experimental tests in the above Table, it is shown that the optimal results are obtained when the number of stages equal 3 that produce higher MSE = 9032.596 and lower PSNR = 8.632. Therefore, it will be relied upon in the following tests.
The efficiency of the proposed encryption algorithm needs to be investigated according to different image samples of various types and dimensions, as illustrated in Table.3   From the results demonstrated in the above Table, it is clearly indicated that the histograms of cipher images are very flatten compared with that for original images, and the average of other measures are very promising, such that the average MSE is very high (10115.48) and the average PSNR is very low (8.17), while correlation near zero and the average Entropy of the cipher image become near 8 (7.9975). The overall randomness of cipher images can be revealed by information entropy measure, which is used to compare between the efficiency of the proposed method with that in previous related work 1 for the same image samples, as stated in Table .4.

Conclusions:
This research introduces an extremely secure data cryptosystem based on chaotic logistic map which is used to generate a 2D key-matrix image to encrypt any types of files and information stored in database or sent through a communication channel, and thus nullifies the value of interception. The originated key matrix offers an unbounded number of probabilities that make the process of brute-force attacks impossible. The security of algorithm depends on many factors: the initial control parameters selected randomly by the system to generate the chaotic ranges, the applied mechanism to derive set of unrepeated numbers from range values, the adopted map that convert the 1D chaotic values into 2D key matrix, advancing the number of stages to some extent on 2D key matrix transposition made significantly the key more secure, furthermore the diffusion processes that are performed with a private image selected by the sender.
The experimental results prove the efficiency of the proposed system when tested on more than 500 image samples of various dimensions and types according to many valuable indicators, in terms of hiding the distinctive marks in the histogram of ciphered images (become flatten) when compared with that of their original context, beside that the other security measurements are very hopeful where a highly average of MSE for cipher images is obtained greater than 10000 (i.e. the greater MSE indicators lead to higher quality and strength of the encryption method), whereas the mean PSNR is very low and appropriate (8.17), with correlation near zero and optimal entropy close to 8 (7.9975). Furthermore, the average entropy value of the proposed algorithm method achieves better results when compared with previous related works for a unified data set.