Hiding an Image inside Another Image Using Variable-rate Steganography

—A new algorithm is presented for hiding a secret image in the least significant bits of a cover image. The images used may be color or grayscale images. The number of bits used for hiding changes according to pixel neighborhood information of the cover image. The exclusive-or (XOR) of a pixel's neighbors is used to determine the smoothness of the neighborhood. A higher XOR value indicates less smoothness and leads to using more bits for hiding without causing noticeable degradation to the cover image. Experimental results are presented to show that the algorithm generally hides images without significant changes to the cover image, where the results are sensitive to the smoothness of the cover image.


I. INTRODUCTION
Steganography is a method of hiding a secret message inside other information so that the existence of the hidden message is concealed.Cryptography, in contrast, is a method of scrambling hidden information so that unauthorized persons will not be able to recover it.The main advantage steganography has over cryptography is that it hides the actual existence of secret information, making it an unlikely target of spying attacks.To achieve higher security, a combination of steganography with cryptography may be used.
In this paper, a new algorithm is presented to hide information in the least significant bits (LSBs) of image pixels.The algorithm uses a variable number of hiding bits for each pixel, where the number of bits is chosen based on the amount of visible degradation they may cause to the pixel compared to its neighbors.The amount of visible degradation is expected to be higher for smooth areas, so the number of hiding bits is chosen to be proportional to the exclusive-or (XOR) of the pixel's neighbors.Analysis showed effectiveness of the algorithm in minimizing degradation while it was sensitive to the smoothness of cover images.

II. BACKGROUND AND RELATED WORK
Surveys of different steganography techniques were presented in previous work, where secret information may be hidden in text, audio, image or video [1], [2], [3], [4], [5], [6], [7].When an image is chosen to be used for hiding information, it is called a cover image.A cover image containing the secret information is called a stego image.
Hiding in LSBs of each pixel is desired since their modification will cause less distortion compared to other bits.The number of bits used should be variable and related to the stego image to minimize distortion [8], [9].However, some applications, such as lossy compression, involve image alteration where some LSBs are lost.In such cases, more significant bits are used by transformation algorithms that utilize the special features of these applications.These techniques generally append coding information to the image with minimal or no change to the original pixels [10], [11].
Generally, the related previous work did not focus on hiding images inside other images.In addition, related image steganography research was usually limited to either grayscale or Red-Green-Blue images; not generalized to work for both image types.The new algorithm of this paper handles hiding different images inside other images of various types.

III. THE HIDING ALGORITHM
This algorithm uses a variable number of LSBs from each pixel of the cover image for hiding.A grayscale image consists of only one color matrix.A Red-Green-Blue (RGB) color image consists of three matrices representing the three colors.The number of bits chosen from each pixel color (red, green, and blue) is different.Images in other color formats may be converted to RGB matrices and converted back after the hiding process is done.The actual number of bits changes according to neighborhood information of each pixel color.When the resemblance between the neighbors of a pixel color entry is low, the pixel entry is located in a non-smooth area where change will not be detected easily.Therefore, the number of bits used for hiding is chosen to be proportional to the neighbors' XOR value for each pixel color entry.
The pixels used in hiding are those located in every line and every other column of the cover image, as in the white squares of a chess board.Pixels on the borders are not used for hiding.This means that approximately 50% of the pixels are used for hiding, while the rest of the pixels are used in determining hiding values and hiding capacity.For RGB images, each color is treated separately.The hiding process starts with the Red matrix, followed by the Green, and then the Blue.The XOR is computed for the value of each one of these pixels' four neighbors: left, right, above, and below.This comparison measures the smoothness of the pixel's neighborhood so that the number of hiding bits can be determined.www.ijacsa.thesai.org The algorithm for hiding in each color matrix is shown in Fig. 1, where stegoC is stegoR, stegoG, or stegoB, corresponding to the Red, Green, and Blue matrices of the original stego image, respectively.Each of these matrices has the same (nm) dimensions as the original image.In grayscale images, stegoC is the single color matrix.This algorithm takes each color matrix individually, and it goes through every line of the matrix starting with the second line and stopping at the line before the last.It goes through the entries in every other column, taking odd and even numbered columns in odd and even numbered lines, respectively.Left and right border columns are not used for hiding.The XOR of the four neighbors of each examined entry is computed.If the XOR value is less than a given threshold (), only one LSB is used for hiding.Otherwise, the number of LSBs (numLSBs) used will be the ceiling of one-half of the XOR value.In the implementation of this paper,  was set to 9 and the maximum number of LSBs used for hiding in any pixel color was 4. To enhance avoidance of detection for RGB images, avoid grouping all color information of a hidden pixel in a single location in the stego image.
The extraction process searches each of the three color matrices (Red, Green, and Blue), going through all lines and every other column as in the hiding procedure.The number of bits used for hiding in an entry, stegoC(row, col), is also determined by examining x; the XOR of the four neighbors as in the hiding process.All extracted hidden values are concatenated and grouped into bytes to form the original secret image.

IV. IMPLEMENTATION AND ANALYSIS
The algorithm was applied using 35 different images of different types and sizes for hiding.The sizes of these secret images ranged from 55110 to 175148 pixels.Three different cover images were used: Valley (25601920 pixels), Street The analysis of the results focus on two aspects: difficulty to detect the hidden image existence in the stego image and sensitivity to the smoothness of the cover image.Recall that only non-adjacent pixels are used for hiding.These are approximately 50% of the pixels in the image.
Fig. 2 shows one sample secret image (Face), which is 148175 pixels, and the three cover images.Fig. 3 shows the three stego images where each of them is hiding a copy of the Face image.As seen in the figures, the difference between the original images and the stego images is not visible to the human eye.TABLE I shows the measurements obtained for these three stego images, where the percentage values show the ratios for using 1, 2, 3, or 4 bits per pixel color entry for hiding.Recall that RGB images have three color entries per pixel, compared to one entry in grayscale images.The peak signal-tonoise ratio (PSNR) and correlation values were the highest for the Office cover image.This cover image has mostly smooth areas, which caused the algorithm to choose only one bit for hiding in each of 84.6% of the pixel entries used for hiding, as seen in TABLE I.The other two cover images used more bits per entry, where Valley used more entry bits than Street.The average results for all 35 test images are shown in TABLE II.The average correlation value was taken for the absolute values of correlation for all images, where the original cover image was compared to each of its stego images to obtain the individual correlation values.
As TABLE II shows, the PSNR and correlation values were high, indicating low degradation of stego images and big difficulty for hidden image detection.The correlation and PSNR values were the highest for the Office cover image.This mostly-smooth cover image caused the algorithm, on average, to choose only one bit for hiding in each of 85.8% of the pixels used for hiding, as seen in TABLE II.The other two cover images used more bits per entry, where Valley used more bits than Street.This indicates that images with smoother areas are a poor choice for cover images since they must use fewer bits for hiding to avoid detection, consequently lowering their hiding capacity.The slight increase in PSNR and correlation values for such images may not be a feasible expense for the significant decrease of hiding capacity.

V. CONCLUSIONS
The new algorithm presented in this paper uses a variable number of LSBs from each color of each considered pixel for hiding a secret image, where approximately 50% of all pixels are considered for hiding.The actual number of hiding bits in a pixel is inversely proportional to the smoothness of its neighbors.The smoothness of a pixel area is determined by taking the XOR of the pixel's neighbors, where a high XOR value indicates less smoothness.
Test results showed that the new algorithm keeps the hidden image difficult to detect, as shown by the high PSNR and correlation values for stego images.The algorithm must hide less information in images containing more smooth areas to keep avoiding detection.This indicates that hiding in such images would be a poor choice.

VI. FUTURE WORK
The presented algorithm may be modified easily to work with video where each frame is regarded as a single image.However, the modification should be made more efficient by taking advantage of video properties, which differ according to video content and format.For example, frames with less smooth contents could be detected and chosen for hiding information.Another reason for considering video format properties is their effect on video sensitivity to modification.For example, some video formats use the similarities and differences within frame sequences to perform compression.Hiding information in such videos may cause a detectable change in video size unless the hiding algorithm works around the compression method.