Hybrid Image Encryption Technique Using Genetic Algorithm and Lorenz Chaotic System

. One of the important application of image encryption is storing conﬁdential and important images on a local device or a database in such a way that only the authorized party can view or perceive it. The current image encryption technique employs the genetic algorithm to increase confusion in the image, but compromises in time and space complexity. The other method employs chaos or pseudo random number generating systems which have fast and highly sensitive keys but fails to make the image su ﬃ ciently noisy and is risky due to its deterministic nature. We propose a technique which employs the non-deterministic, optimizing power of genetic algorithm and the space e ﬃ ciency and key sensitivity of chaotic systems into a uniﬁed, e ﬃ cient algorithm which will retain the merits of both the methods whereas tries to minimize their demerits in a software system. The encryption process proceeds in two steps, generating two keys. First, an encryption sequence is generated using Lorenz Chaotic system of di ﬀ erential equation. The seed values used are the user’s actual key having key sensitivity of 10 − 14 . Second, the encrypted image’s genetic encryption sequence is generated which will result in an encrypted image with entropy value greater than 7.999 thus ensuring the image is very noisy. Proposed technique uses variations of Lorenz system seed sets to generate all random mutations and candidate solutions in Genetic encryption. Since only the seed sets leading to desired solution is stored, space e ﬃ ciency is higher compared to storing the entire sequences. Using this image encryption technique we will ensure that the images are hidden securely under two layers of security, one chaotic and other non-deterministic.


Introduction
Nowadays, the concern of information security is gaining immense importance, hence the security of confidential information and data in the field of Computer Science is crucial. In the 21th century, images have become an integral part of digital information hence maintaining the integrity, access control and confidentiality of image data from unauthorized users are essential. Cryptography is a vital tool for guarding such information in computer systems. It refers to secure information and communication techniques that descended from mathematical concepts along with a set of algorithms to reconstruct messages in ways that are hard to decipher. Encryption is translation of data into another form, or code so that only people with access to a decryption key or password can access it. Image encryption plays a crucial role in the field of information security and makes the information in the image unreadable. Consequently, no third party can decrypt and retrieve information from this image, thus ensuring complete privacy for the users. In the past years, a lot of research has been made into refining algorithms that deal with data encryption. The genetic algorithm is one such type of non-deterministic evolutionary algorithm which uses its powerful features like crossover and mutation to generate a symmetric key which also augments the entropy furthermore the noise of the resulting encrypted image [4]. Chaos-based cryptographic systems have become an important part of data encryption techniques because of their excellent performance in generating highly sensitive keys and prompt results [1]. Our aim is to propose an integrated algorithm which employs the agility, efficiency and high key sensitivity of chaotic systems and the optimizing power of the genetic algorithm. In this paper, a novel method of image encryption is introduced and the aim to design a system for optimizing and analyzing the whole process of image encryption wherein Lorenz Chaotic System and Genetic Algorithm are employed to encrypt and store the image data securely is achieved. unauthorized use. Different papers to propose an efficient method for image encryption have been referred.
The paper [1] proposed a inventive chaotic picture encryption method dependent on the opposite fractal insertion function. This framework is connected to produce clamorous arrangements. The groupings inferred are then used to permute the pixel positions to get the rearranged picture by disorganized succession arranging. To upgrade the security the acquired chaotic sequences are then evaluated and used to perform dissemination. A new scheme based on mixed chaotic map and Josephus traversing is being proposed in methodology [2]. The proposed technique comprises three procedures. Initially a key stream generator is structured dependent on another proposed plan of chaotic frameworks. At that point Josephus traversing is utilized in scrambling, next, the segments and the columns of the pixels are traded in extent to characterized guidelines lastly the chaotic coordinates are utilized to exchange the places of every pixel. In the last advance the picture information and four disordered maps are utilized to change the pixel gray level values and break the solid relationships between neighboring pixels of the picture at the same time. The consequences of this technique and security investigation affirm that the framework proposed has better execution. A picture cryptography framework dependent on a chaotic True Random Bit Generator (TRBG) is anticipated in method [3]. The chaotic generator might be a nonlinear electronic circuit that produces twofold parchment chaotic attractors. The estimations of the underlying conditions rationale entryway parameters are the keys of the cryptological framework. Since the dynamic conduct of the circuit is incredibly unusual, a genuine arbitrary bits succession is made through perceived procedure. Likewise, the assurance investigation of the scrambled picture represents the high security of the anticipated topic. A hybridized model for encoding pictures through a blend of hereditary calculation and DNA Sequence was anticipated in procedure [4]. The encoding method comprises two stages Transportation and Scrambling area and Substitution stage. In the initial stage, the pixel areas are modified by utilizing GA to curtail the relationship among nearby pixels. In the substitution part, pixels are supplanted by utilizing XOR activity between the pixel esteems redesigned into double strings and DNA corrosive sub-strings got from an irregular DNA string. The DNA sub-strings are utilized as keys for picture encryption. The exploratory result approves that the calculation is direct, quick and conceivable. A usage of computerized picture encoding framework utilizing the Lorenz chaotic framework is anticipated in strategy [5]. Subsequent to creating a disorganized key stream, the hash estimation of plain picture is inserted to change the initial secret keys progressively to help security. The anticipated digital picture cryptography calculation basically contains two stages. In the primary stage we will in general create secret keys utilizing 256-piece hash estimation of plain picture and furthermore the strategic guide. Inside the second segment the plain picture is encoded by utilizing Lorenz confused arrangements with the key keys from the past segment. The projected method [6] uses adjus-tive Genetic algorithm to create an efficient variety of optimum clusters centers in real time pictures. Genetic operators like mutation and crossover are done and are enforced with an adjustive nature to try and do work expeditiously to decide the cluster heads. By using this data K-means clustering rule is applied. The output is a clustered medical look. Through the results it may be concluded that the projected technique of clustering of medical pictures using genetic rule is effective. Segmentation is needed to dis-join a complete image into tiny segments such that they collectively cover the complete image. This was planned in approach [7]. within the planned system, we tend to begin by taking a gray image. Noise is introduced during this image using numerous noise models. Afterwards Genetic algorithm is applied for segmentation of the obtained image. Thus, the final segmented image is obtained and at last we tend to confirm the peak Signal to Noise ratio and Mean square Error for noisy image and metameric image. The values obtained are compared with alternative image segmentation algorithmic programs like OSTU and Watershed and it's concluded that Genetic algorithm works best for segmentation of noisy image. An investigation on the employment of other kinds of sequences referred to as chaotic sequences for DS-SS system is planned in procedure [8]. It also thinks about the execution of picture encoding utilizing run of the mill pseudo irregular code generators thereto utilizing new confused sequence generator. A buildup arithmetic number is added to the framework; this strategy is assessed and thought about thereto of non residue numeration framework and it quantifies its execution. To add a great deal of highlights to the riotous correspondence framework Residue numeration framework (RNF) is included. The creators of [9] propose a standard for pseudo irregular range arrangement generator utilizing tests of Chen chaotic framework. This procedure explains the matter of the non-uniform possibility dispersion of grouping created specifically by the Chen disordered framework. The varied applied arithmetic tests check that the arrangements created by our anticipated framework have reasonable factual properties. The test consequences of the security examination approve the high ability of the anticipated system to oppose changed assaults. Further depictions of the use of pseudo random number generators in the domain of image encryption techniques with the incorporation of a perceptron model within a neural network proposed in [10] and the used of transposition and substitution techniques in [11] is used to further the encryption efforts to ensure the abstraction of the information to a great extent. The proposed methodology in the work in [13] features the uses of multiple pseudo random generator techniques in various steps of the mentioned encryption technique which are the chaotic map functions. The used functions being Cubic Map, Henon Map, Quadratic Map, Logistic Map. The work has as mentioned in the paper proved to have better encryption quality in terms of entropy and correlation than the compared works.

Proposed Methodology
In the proposed methodology, image encryption algorithm takes part in two major phases using two different techniques of random sequence generation and genetic algorithm (G.A.) to optimize/improve image noise. They are encryption using Lorenz chaotic system and noise enhancement using genetic algorithm. In the first phase we generate a random sequence of integers K c = {k c 0 , k c 1 , k c 2 , k c 3 ,...,k c n } whose values range form [0...255] corresponding to the first layer of encryption. This sequence K c is generated using Lorenz Chaotic system of Differential equations. The length of sequence K c i.e. n will be equal to the number of pixels in the image. Each pixel in the original image I is traversed and sequentially XORed with the values in the sequence K c generating an intermediate encrypted image I en 1 . The next phase takes the image I en 1 as input to the Genetic algorithm and generates a genetic encryption sequence K g = {k g 0 , k g 1 , k g 2 , k g 3 ,...,k g n } which is another sequence of integral values where individual value ranges from [0...255] having length equal to the number of pixels in the image. These values are again sequentially XORed onto each pixel of the image I en 1 and the final encrypted image I en 2 is generated. For decryption the sequences K c and K g are regenerated, whose individual values are sequentially XORed to each image pixel of image I en 2 to decrypt and regenerate the original image I.

Encryption Process With Lorenz Chaotic
System: The Lorenz system, first studied by Edward Lorenz around 1960, is a dynamical system described by the following nonlinear system of ordinary differential equations: The real numbers given by a, b, c are the control parameters, whereas real values given by x, y, z are called the state variables, and the given equations 1, 2 and 3 are for the time derivatives of the variables x, y and z. For a given set of control parameters and initial set of values x 0 , y 0 and z 0 which are the initial state variables are provided.
All these values are seed values and combined form a sets call as the seed set which is the encryption, decryption key for this phase. The system is non linear , non periodic. It does not repeat its values over a time period and takes three input variables x y and z. This implies that the system is three dimensional and deterministic thus from a given current state and inputs, it can always be determined what the next state will be.
Step 1: The generation of the random sequence is done by first defining a key /seed set containing the seed values for the Lorenz system as follows: Here the random() function takes two real numbers as parameters random(m,n) where m is the lower limit and n is the higher limit, random() generates a real number v such that, m ≤ v ≤ n. Similarly we consider control parameters as Also, initially we have to define the number of steps after which we will extract values from the Lorenz system Step 2: These values a, b, c, x 0 , y 0 , z 0 and dt are the seed values and the set of values that users needs to store for generating encryption sequence K c instead of storing the entirety of K c . Once these parameters are set i.e. a user key is defined, we begin our iteration to generate sequence K c . Consider an image I having height H and width W that means H pixels in a row and W pixels in a column respectively, the number of random numbers to be generated are H * W. That means H * W values or samples of x , y and z are considered. Let x i−1 , y i−1 and z i−1 be the values of x, y and z at iteration i-1 respectively. The values for x, y and z in the next iteration is given by: Substituting the values of dx, dy and dz from equations 1, 2 and 3 we get To generate random whole number less than K. Let S be a key set such that Here s 0 = x, s 1 = y, s 2 = z, s 3 = a, s 4 = b, s 5 = c, s 6 = dt, s 7 = x 0 s 8 = y 0 and s 9 = z 0 . Initially s 0 = s 7 , s 1 = s 8 and s 2 = s 9 Algorithm 1: The algorithm to generate random whole number less than K using user key/ seed set S: The square brackets in the above equation represents rounding off operation to its nearest integral value.
Algorithm 2: To generate random double between 0 to 1 using user key S: for i in range(0, H * W): Step 3:To encrypt, every pixel of the image is traversed. Let I i j represent pixel at row i and column j of the image matrix and the encryption sequence be K c .
Algorithm 3: The algorithm for encrypting the image I using sequence K c : Encrypt(I, K c ): for i in range(0, H): for j in range(0, W): Every pixel I i j will be XORed with k c i * W+ j i.e (i * W + j)th value the in the sequence K c . This produces a new encrypted image matrix I en 1 .

Encryption Process With Genetic Algorithm:
The genetic algorithm is an adaptive heuristic search algorithm. It is an soft computing technique which is used to implement artificial intelligence. For a particular problem to be solved we first start with the initial generation of candidate solutions and a function that evaluates how good is the solution based on some fixed parameters called as fitness function. The attributes of the candidate solution which define how the candidate solved the problem is called the chromosome of that solution. Through the stochastic process of G.A., the proposed technique tries to improve these chromosomes. Out of the initial candidate solutions a set of solutions is selected as parents by some stochastic selection process giving greater priority to fitter parents. They are then used to develop a fresh generation of candidate solutions via the operations of crossover and mutation to bring diversity in the solutions. This process is continued and new generations are generated from the previous ones until a stopping condition is reached. The candidate solutions over the generations become more tuned, optimal and better for the given problem.
In the following approach Lorenz chaotic system itself is used to generate all the initial random candidate solutions and introduce the mutations to the selected parents in the heuristic search process of Genetic Algorithm. This therefore helps us surf and eventually discover the locations in the search space where the solution is reasonably optimized i.e. the key sequence gives considerably enhanced entropy/noise after encrypting the image.
In current phase the proposed technique generates another encryption sequence k g 0 , k g 1 , k g 2 , k g 3 ..., k g n and genetic key A. Every value k g i in K g is an integer ranging from 0 to 255 and the length of the sequence is equal to the number of pixels in the image I. This sequence is called as genetic encryption sequence K g . The purpose of K g is to increase the noise in the image I en 1 resulting from the chaotic encryption process and also add another layer of security to the image so that the encryption is stochastic.
Step 1: First, an initial population that is a set of 20 such random sequences are spawned K 0 and each of this sequence is generated by Lorenz system similarly to how K c was generated previously thus each sequence K 0 g i uses a set of Lorenz seed values. Let the seed set corresponding to the ith sequence be denoted as For every set S 0 g i initial Lorenz's state values x 0 , y 0 and z 0 remains the same as used by the user in the Lorenz encryption process, only the sampling gap or time step dt and control parameters a, b and c differs by a value of They are generated randomly such that 10 −14 ≤ t 0 g i , a 0 g i , b 0 g i , c 0 g i ≤ 10 −6 . The superscript 0 represents the generation, in this case initial generation. Thus we generate 20 sets S 0 g 0 , S 0 g 1 , S 0 g 2 , S 0 g 3 ,...,S 0 g 19 using which we generate 20 keys K 0 g 0 , K 0 g 1 , K 0 g 2 , K 0 g 3 , ..., K 0 g 19 . Now with respect to each sequence K 0 g i of the 20 new sequences we encrypt the image I en 1 to generate their corresponding encrypted image I 0 g i . Algorithm 4: The algorithm to obtain the encrypted image using original image I of size H * W and encryption sequence K = {k 0 , k 1 , K 2 , ..., k H * W }is as follows: Step 2: Encrypt( I, k ): for i in range(0, H): for j in range(0, W): Step 3: For the resulting image from each sequence it's respective fitness is calculated as per the following function: here, in equation 19, I f itness is the fitness the resulting image equal to the I entropy i.e. the entropy of the resulting image. p(i) in equation 19 is the probability of a shade i such that 0 ≤ i ≤ 255 in the resulting image given as: f req(i) is the frequency or the number of times the shade i occurs in the image I. The greater the value of I entropy the more even is the frequency distribution of the shades in the image and more the noise. For maximum entropy the value freq(i) of every shade i should be: This state of maxi-ma in the final encrypted image I en 2 is what the proposed system tries to achieve via the heuristic search process of genetic algorithm.
Step 4: Of these 20 sequences K 0 The parent is selected via Elitism selection process i.e. the parent giving best fitness and a new generation of 20 sequences via mutation process is spawned. Lets say K 0 g i is the selected parent. Values t 0 g i * 10 12 , a 0 g i * 10 12 , b 0 g i * 10 12 and c 0 g i * 10 12 are appended to the solution array/ Genetic Key A and the value of it's fitness is stored in global best fitness G and a variable g (generations computed) is set to one i.e. g = 1.
Step 5: After initial population generation and parent selection, mutation is performed in the rest of the generations. In the mutation process first a mutation rate lets say m is set and 20 Lorenz seed sets S j g 0 , S j g 1 , S j g 2 , S j g 3 , ..., S j g 19 are generated where: Here in above set equation 22 j represents the current iteration or the generation we are on and t j g i is a small randomly generated number added to dt of set S j g i such that 10 −14 ≤ t j g i ≤ 10 −6 . The values of x 0 , y 0 , z 0 , a, b, c and dt are the same values used in the Lorenz encryption process in user key or seed set. Now suppose the generation is j and selected best parent from the previous generation is K j−1 g . Algorithm 5: Mutation of parent encryption sequence K j−1 g i to generate i th candidate sequence K j g i for j th generation and mutation rate m is as follows: Here K j−1 g i [k] and K j g i [k] represents the k th value in the sequence K j−1 g i and K j g i respectively.
Step 6: Thus 20 independent mutations are performed on selected parent sequence K j−1 g to generate 20 separate candidate sequences K j g 0 , K j g 1 , K j g 2 , K j g 3 , ..., K j g 19 and with respect to each the image I en 1 is encrypted using the Encrypt algorithm shown before to generate I j g 0 , I j g 1 , I j g 2 , ..., I j g 19 respectively. Calculate the fitness of each of these images and the sequence which gives the image with fitness greater than G after encryption is selected via elitism selection process, lets say K j g i , this is passed on to the next generation as parent and its corresponding value of t j g i * 10 12 is appended to the solution array A. Update G as fitness of image I j g i . If none of the child candidates in the current generation are able to perform better than current G, the entire generation is discarded and the process is repeated. For every computed generation set g = g + 1. These operations are performed unless a stopping condition is reached. The stopping condition being that G ≤ 7.9997 or g ≤ 200 whichever comes first. Finally a solution array A = a 0 , a 1 , a 2 , ..., a l is generated which is our genetic key and will be an array of values where 3 ≤ l ≤ 203 and the image with entropy G is our final encrypted image I en 2 .

Decryption Process:
The decryption process consists of the following steps.
Step 1: The chaotic encryption sequence K c = {k c 0 , k c 1 , k c 2 , k c 3 ,...,k c n } is regenerated using the values a, b, c, x 0 , y 0 , z 0 and dt that are entered by the user that is the user key.
Step 2: For genetic decryption we first generate the initial sequence K form the Lorenz seed set S 0 derived from the genetic key A as follows [1], c+A [2], dt+A [3]} (23) Step 3: Then perform mutation on the key sequence K: Algorithm 6: Mutation on key sequence K using seed set S and genetic key A and mutation rate m: Mutation( S, A, K, m ): for j in range(4, l + 1): S j−3 ={x 0 , y 0 , z 0 , a, b, c, dt + A[j]} for i in range(0, H * W): r := Random(S j−3 ) if r ≤ m: Thus K is mutated into the genetic encryption sequence K g Step 4: Using the generated keys in the above process K g ={k g 0 , k g 1 , k g 2 ,...,k g n } and K c ={k c 0 , k c 1 , k c 2 ,...,k c n } to decrypt image I en 2 Algorithm 7: Decryption of image I en 2 using encryption sequences K g and K c is as follows: Decrypt( I en2 , K g , K c ): for m in range(0, H): for n in range(0, W): I mn := I mn ⊕ k g m * W+n ⊕ k c m * W+n Where I mn represents pixel at position (m,n) of image I en 2 . This will thus help us the original image I. Once the Genetic key A for the image is obtained, it can be used for both future encryption and decryption rapidly.

Results And Discussion
This chapter provides us with the detailed analysis and outcome of the proposed image encryption technique in terms of image entropy, standard deviation of pixel states and time. It also analyses the Lorenz sequence sensitivity with respect to the initial seed values(user's key).

Results
Through the proposed work the following are the outcomes.
• The first stage involves using Lorenz chaotic system which generates a sequence K c XORed onto the original image figure 1 Cameraman of size 256x256. Applying the • The part following this is the generation of genetic key and encryption sequence to add the second layer of security which adds stochastic elements to the encryption  The figure 4 demonstrates the gradual improvement in the encrypted image fitness as the whole G.A. process progresses. Chaotic encryption gave an image noise of 7.99691 which was improved by genetic Key to 7.9997. All of these methods have image entropy greater than 7.9997 which means information leakage in the encryption scheme is negligible.
• Now if we change the value of dt during the decryption process by adding 10 −14 and then try to decrypt the image: Thus the proposed system has demonstrated the high sensitivity of the user key and decryption process to the initial parameters. Changing even one of the parameters by a factor of 10 −14 will lead to a completely different sequence hence failing to successfully decrypt the image. This is because Lyapunov exponents are a measure that is

Evaluation Parameters
The evaluation parameters taken into consideration for analysis are as follows: • Key Space Analysis: In order to review the proposed image encryption design, the key analysis is very essential. In this analysis, the key space is required to be sufficiently large to make the brute-force attack unattainable.
• Histogram Analysis: Histogram analysis shows the unique distribution of plain image. For good encryption design, encrypted image should attempt to erase the traces of the plain image. In order to safeguard the information of the original image, it is imperative for the encrypted image to exhibit no statistical similarity with the original image.
• Entropy Analysis: The entropy analysis is practiced to assess the randomness of an image. If an image has an excellent random property, it determines that the entropy score is close to the maximum entropy value. Its value can be computed by the following equation: where p(i) is the probability of a shade i such that 0 ≤ i ≤ 255 in the resulting image. The greater the value of I entropy the more even is the frequency distribution of the shades in the image and more the noise. For maximum entropy the value p(i) of every shade i should be: • Correlation Coefficient Analysis: The security level of cryptography system is also commonly measured in terms of diffusion and confusion. Therefore, statistical analysis is conducted on the image by testing the correlation 10,000 randomly selected pairs of two adjacent pixels in the original image and encrypted image. Next, the correlation of each pair is calculated using the following equations: where, Where x i and y i are random selected pair pixels.

Key Space Analysis
In the proposed algorithm, the initial conditions of the Lorenz Chaotic System have been employed as the secret keys with the precision of 10 −14 . An efficient chaotic system is distinguished for its high sensitivity to the initial conditions. In the proposed algorithm, the initial control parameters 'a', 'b', 'c' and the sampling interval 'dt' each of 14 digit precision postdecimal points is the user secret key or password. The key length is 56 digit, hence 56! i.e (7.1099859e + 74) combinations are possible. The key space of our proposed system is 10 56 . Ideally, the key space should be more than 2 100 to provide adequate security in order to evade bruteforce attacks. According to this, the key space is large enough for the secret keys and to withstand all kinds of brute-force attacks.
In the proposed algorithm, the initial control parameters 'a', 'b', 'c' and the sampling interval 'dt' each of 14 digit precision post-decimal point is the user secret key or password.  Figure 6 shows the histogram of the original image Lena with the size of 256 x 256 and its corresponding encrypted image. It is observed that histogram of encrypted image is very uniform, and the regularity of plain image is not bought into the encrypted image. The domain of the histogram are discrete integers ranging from 0 to 255 representing pixel shades. The Y axis also contains integers representing the number of occurrences.

Entropy Analysis
The below Table I

Correlation Coefficient Analysis
The correlation coefficient between adjacent pixels of original image and encrypted image are given in Table II. The experimental results show that the correlation coefficient between adjacent pixels are high in plain original image and being greatly weakened in the encrypted image Ref [14].The proposed encryption scheme is perfect for coefficient analysis. Lena and Cameraman image are of size 256x256 It is observed in the table above that the entropy and correlation coefficient of proposed method is better than the referred methods. In figure 7 we can see that the disor-  [12] 0.0048 7.9904 der brought about in the encrypted image by the proposed method is more than that brought about by the individual methods. Similarly figure 8 shows that the encrypted image produced by the proposed method has least correlation to the original image in comparison to the other methods.

Conclusion
Proposed system has shown an easy and highly optimized way of encrypting images which has been clarified by our design and methodology. Technique first utilizes Lorenz chaotic system of differential equation to generate a random sequence of integers ranging from 0 to 255 which are highly dependent on the initial values, time step and control parameters which form a key that generates sequence K c to achieve the first level of encryption and a noisy image. Given that the whole sequence can be generated using just the initial parameters the whole sequences need not be stored apart from those initial parameters that are the seed values making it space efficient. Also these values should be accurate up to 10 −14 decimal place ensuring high key sensitivity, changing those values even slightly will give a completely different image during decryption. Following Lorenz encryption, Genetic algorithm used hence is used to optimize the noise in the encrypted image I en 1 generated by the Lorenz System even further making it more random and chaotic giving us a second layer of security to nullify the deterministic nature of Lorenz system and an image entropy close to or over 7.9997 with adequately small pixel correlation of the final encrypted image I en 2 .
We have hereby demonstrated a way to use Lorenz system to generate the candidate solutions and introduce random mutations in the heuristic search process of Genetic Algorithm to eventually locate the optimum solution in the search space. The merit of our proposed system lies in the fact that our genetic sequence K g i.e. the solution once generated can be regenerated easily by the genetic key A of length 200 or less for both encryption and decryption process, thus is space efficient because only this array needs to be stored and not the entire sequence.