Suggested Method for Encryption and Hiding Image using LCG and LSB

Maintaining the confidentiality of the data of the very important areas in computer applications , Where many researchers work in the fields of concealment and encryption . So in this research we are working on the combining of the two methods , where confidential data is encrypted by using a proposed method , Then the cover is encrypted (regular image) by LCG algorithm (which generates a series of random numbers) to generate the encrypted cover (irregular image) , After that ,we hide the encrypted data in encrypted cover by depending on the LSB technique, then we convert the irregular image into regular image and thereby getting hidden data in random locations in the cover image , This method is characterized by flexibility in terms of the possibility of hiding the different types of confidential data in different types of media , and durability as that data be hidden in random locations and this what distinguishes the proposed algorithm , and the results showed high security, because the data is hidden in random locations in encrypted image then convert to the original regular image For clarification of the proposed algorithm , it has been applied on a digital image of the gray type using MATLAB language by using the efficiency scales PSNR and MSE .


Introduction
The rapid development in the field of computer and data transfer through internal networks and global networks , require maintainng the confidential of data in the area of transfer of confidential information between the countries and banks of personal information and copyright etc .different techniques appeared to maintain the confidentiality of data ; they Can be divided into two parts .the encryption techniques and the concealment techniques ; The encryption techniques are working to change the general form of confidential data , and they are used widely in different areas , but these techniques may be detected because the encrypted information is unclear and this raises doubts among hackers and those who seek to steal the confidential information .Thus the concealment technique is adopted beside encryption technique .Concealment technique is one of the important techniques in maintaining the confidentiality of the transmitted data .The basic principle for this technique is hiding the secret information in cover of the carrier without affecting the human eye [ Singh and Agarwal , 2010;Ramanpreet Kaur & Singh, 2012;Saket et al., 2013)].
There can be a combining between the concealment technology and the encryption technology for increasing the confidentiality of data .That is when the secret message is revealed, it will be unclear and this will remove doubt about the existence of a hidden message and this what has been applied in this research where concealment is improved by using LSB technique and combined with the LCG algorithm to generate random locations to hide the confidential data .

1-Encryption
Its One of the methods used in maintaining the security of data which works to change the content of information for symbols that are difficult to be understood .It is divided into two algorithms , symmetric needs one secret key which is used in encryption and decryption , while asymmetric needs two secret keys , a public key is used in encryption, and a private key is used in decryption.We used the symmetric type in this search [Jianying and Yung, ( 2010)].

2-Steganography
Its One of the methods used in maintaining the security of data .the basic principle of this technique is hiding of information in the file of the cover without raising doubts about the existence of hidden data ,There are three basic algorithms for steganography

3-Linear congruential generator (LCG)
This algorithm is used to produce a series of random numbers and it can be easily used, especially with computers [Prasada , 2010] where Random numbers are generated by the following equation :

4-The proposed method
The proposed method consists of several stages :

Encryption of confidential information
The proposed method is intended to encrypt the data, where the binary system consists of 1 and 0, so we will depend on group sequence (1) and group sequence (0).where we convert confidential data to the binary system, and then collect them in a single matrix, then divide the matrix into two matrices.Matrix (1) which contains the sequence ( 1) with (0) between each two sets of the ( 1), and matrix (0) and the sequence (0) with ( 1) between each two sets of the (0), where the matrix ( 1) is complementary to the matrix (0) and vice versa .

5-2 Encryption of cover image
It means the transformation of the image of the cover to another image but irregularly (unclear), and that depends on the LCG algorithm to generate random locations, we create the random locations matrix , make its dimensions Equal to the dimensions of the cover Matrix , and then put the original image in the matrix generated from LCG algorithm, so the result is irregular image.

5-3 hiding the secret data
Confidential data resulting from the first stage is storing in the irregular image depending on the LSB Technique .

5-4 Converting irregular image to regular image
Irregular Image containing the confidential data is converted to a regular image depending on the LCG algorithm .

Output : stego_reg
Step_1 : Encryption of confidential information 1-Reading the secret data (D_secr) 2-Convert (D_secr) to a binary system (D_bin) 3-Put D_bin in Matrix one-dimensional (D_bin_1) 4-separating (by using some instructions) D_bin_1 for matrix of ( 1) and matrix of (0) Step_2 : Encryption of cover image 1-reading a cov_im_reg 2-finding the dimensions of the cov_im_reg (N,M) 3-generating a random numbers depending on the LCG algorithm , where the collection of random numbers is equal to N*M ( arr_random_1 ) 4-converting arr_random into a array by two dimensions ( arr_random_2) , which conform with dimensions cov_im_reg 5-put cov_im_reg in arr_ran_2 ,we will get on cov_im_irreg Steps_3 : Hiding of secret data (Matrex of ( 1)) ,and (Matrex of (0)) in cover (cov_im_irreg ) 1-limit two places ( place_1 , place_2 ) from cov_im_irreg 2-hide Matrix of (1) in place_1 in Least Significant Bit from each byte 3-hide Matrix of (0) in place_2 in Least Significant Bit from each byte 4-we will get on stego_irreg   Step_1 : Encryption of stego_reg 1-reading a stego_reg 2-finding the dimensions of the cov_im_reg (N,M) 3-generating a random numbers depending on the LCG algorithm , where the collection of random numbers is equal to N*M ( arr_random_1 ) 4-converting arr_random into a array by two dimensions ( arr_random_2) , which conform with dimensions stego_reg 5-put stego_reg in arr_ran_2 ,we will get on stego_im_irreg Step_2 : Extraction of secret data (Matrex of ( 1) ) , and (Matrex of (0) ) from cover (stego_im_irreg) 1-limit two places ( place_1 , place_2 ) from stego_im_irreg 2-extract Matrix of (1) from place_1 in Least Significant Bit from each byte 3-extract Matrix of (0) from place_2 in Least Significant Bit from each byte Step_3 : decryption of confidential information 1-reseparating (by using some instructions) matrix of ( 1) and matrix of ( 0

7-Results
The proposed method has been tested on a gray image with different sizes ,with the use of standards PSNR and MSE to measure the efficiency of the way

9-Conclusions
1-What distinguishes the proposed algorithm.it is impossible to determine the sites of concealment even by the authorized person , because we hide our data in the encrypted cover.2-It's Possible to hide a lot of data without affecting the cover .3-There is no loss or errors in the recovered data .4-Use of an LCG algorithm gives high security in the cover-ups in terms of the large number of the possibilities , especially with changing the values ( c , r , f() , and the size of image

Fig( 1 )
Fig(1) Block diagram to encrypt and data decrypt

Fig( 2 )
Fig(2) Block diagram of data hiding and retrieval

Steps_4:
converting stego_irreg into stego_reg reversing the operation 5-2 step_5 will leads to the stego_reg EX(1) : to explain the proposed method ( encoding & hiding the secret data ) Stage _1 : encoding a secret data suppose secret data is " Ir " , where the results are : matrix of two dimensions (1) cover image before encoding (cov_im_reg) matrix of two dimensions (3) matrix of the Random locations is generated by LCG matrix of two dimensions (4) encoded cover image (cov_im_irreg) matrix of two dimensions (5) Include confidential data in encrypted cover (stego_irreg) matrix of one dimension (2) generated random numbers by LCG Stage_4 : stego_irreg into stego_reg stego_reg = Algorithm(2) extracting the secret data from stego_image Input : stego_reg , values of variables of LCG algorithm , start of first location (place_1) , start of second location (place_2) Output : secret data (D_secr) to explain the proposed method (extracting the secret data from stego_image) Stage_1 : Encryption of stego_reg 1-reading a stego_reg 2-finding the dimensions of the cov_im_reg (N,M) N=5 , M=5 3-generating a random numbers depending on the LCG algorithm , where the collection of random numbers is equal to N*M ( arr_random_1 ) stego_reg in arr_ran_2 ,we will leads to stego_im_irreg

Fig( 3 )
Fig(3) : block diagram to explain steps of combining between the operation of encrypting and operation of hiding Fig(4) : block diagram to explain steps the operation of extraction the secret data

Table ( 1
) .5-It's characterized by durability in terms of concealing information in different locations .6-Values os PSNR and MSE, are good even with a large volume of information.) : display the values of for PSNR and MSE