Steganography is the art of hiding a secret message in some kind of media. The main goal is not to hide only the secret message but also the existence of communication and secure data transferring. There are a lot of methods that were utilized for building the steganography; such as LSB (Least Significant Bits), Discrete Cosine Transform (DCT), Discrete Fourier Transform, Spread-Spectrum Encoding, and Perceptual Masking, but all of them are challenged by steganalysis. This paper proposes a new technique for Gray Scale Image Steganography that uses the idea of image segmentation and LSB to deal with such problem. The proposed method deals with different types of images by converting them to a virtual gray scale 24 bitmaps, finds out the possible segments inside image and then computes the possible areas for each segment with boundaries. Any intruder trying to find the transformed image will not be able to understand it without the correct knowledge about the transformation process. The knowledge is represented by the key of image segmentation, key of data distribution inside segment (area selection), key of mapping within each area segment, key agreement of cryptography method, key of secret message length and key of message extension. Our method is distinguishing oneself by one master key to generate the area selection key, pixels selection keys and cryptography key. Thus, the existence of secret message is hard to be detected by the steganalysis. Experiment results show that the proposed technique satisfied the main requirements of steganography; visual appearance, modification rate, capacity, undetectability, and robustness against extraction (security). Also it achieved the maximum capacity of cover image with a modification rate equals 0.04 and visual quality for stego-image comparable to cover image.
The network environment turns into a substantial portion of humans work life or even of their normal life. Network provides us with a rapid carrier to deliver the digital data from one point to another in a convenience way. Users look to enjoy the merits that networks have provided in sending and receiving process. Sometimes they may want to keep the secret communications or the copyrights, so a various technologies have been recognized as a helpful way in dealing with transferring data securely. The most common ones are steganography, cryptography, and watermarking. Steganography has always been confused with encryption and watermarking. Although they have the same goal (transferring data securely), but they are different in manipulating the data.
Steganography was derived from the Greek word steganos, meaning covered or secret, and graphy (writing or drawing) [
There are many ways to classify the steganography techniques [
This paper will present a random LSB method consolidated with the image segmentation. Here, the cover-object, where the data to be embedded, is always any type of images, the embedded data may be a text, an image or any type of files. The input image will be converted to 24 bits gray scale one in order to construct the host medium. Host image dimensions will be used to find out the segments which are employed in hidden process. Areas are built according to the selected segment that represents the segment key. The master key must be inserted in the hidden and extraction process by the user in aim to generate the other manipulation keys (selection, generation and cryptography). Secret message length, extension and the selected segment must be kept by the user in order to extract the secret message.
The rest of the paper is organized as follows. Section 2 presents related work. Section 3 describes the materials and methods. The experimental result is shown in Section 4. Finally, Section 5 concludes this paper with directions for future work.
Steganography is a very old technology that was utilized in the time of the ancient Greeks to pass the secret messages from one area to another. They wrote the secrete message on a different hosts such as the head of slaves or the wood part of a wax then sent it to the receiver area [
In recent years, the steganography is widely known due to availability of different environment such as images, audios, videos and documents for hosting the secret message. Several applications and model were and will be built on those environments. In our work we concentered on the grayscale image steganography, so the ulterior drawing out presents some of the published studies in this field.
Nilizadeh [
Chang and others [
Kadry and others [
Bawaneh [
Juneja and others [
Asthana and others [
Farn and others [
Sharma and others [
Udhayavene and others [
Sandip Sadashiv and others [
Ballesteros and others [
Raju and others [
The main focus of this paper is the grayscale image steganography using the image segmentation. Our method looks to divide the cover image into several segments such that each one stores multi areas, but only one segment will be utilized in the hidden and the extraction process. The used method utilizes one master key to generate multi keys for area selection, cryptograph and pixel selection. It deals with any type of secret messages and cover images. Ulterior subsections show how the hidden and the extraction process will be carried out to reach the main goal from this work.
The method that is used to hide the data in the cover image is the Least Significant Bits (LSB) method. It’s one of the most famous embedding methods. This method bases on replacing the least significant bits of a given byte from the cover image pixels. LSB is very fast and simple, but the distortion in the cover image is noticeable when the number of replacement bits exceeds three for each pixel [
In this work each bit requires one pixel (3 bytes) from the cover image, so each byte in the used pixel will store the same bit form the secrete message as shown in
The target pixels that will store secret message bits are selected randomly from different segment areas. Randomness process has two merits; firstly it increases the security of the data since the message bits are going to be scattered all over the image areas in a random way. Secondly it makes the effect of changing relatively less apparent; due to the replacement pixels are not adjacent.
Hidden process needs for several requirements to accomplish their work. Those requirements can be summarized by: cover image conversion, cover image segmentation, segment area boundaries computation, and secret message conversion, number of areas determination, key initialization, area generators initialization and embedding process.
Hidden process steps
Step 1: Input the cover image, secret message, and master key.
Step 2: Convert the cover image to gray scale by using image conversion unit.
Step 3: Convert the secret message to stream of bytes by using message conversion unit.
Step 4: Compute the segments of cover image by using segmentation unit.
Step 5: Compute the areas for selected segment by using segment area unit.
Step 6: Generate the selection, encryption and distribution keys by using key unit.
Step 7: Embed the secret message inside cover image to get the stego-image.
First of all, the image that is used as a cover object could be any type of images such as bmp or jpeg then the input image will be converted to 24-bits color depth. The system converts the 24-bits image to a virtual gray scale one by taking the mean value of red, green and blue colors. Result value of mean is set as the new value for red, green and blue colors as follows:
Step 1: Color C = Get Pixel (x, y), 0 ≤ x < Image Width and 0 ≤ y < Image height
Step 2: Mean = (C. Red + C. Green + C. Blue)/3.0
Step 3: C. Red = C. Green = C. Blue = Mean;
Step 4: Set Pixel (x, y, C)
After completing the image conversion process, the system will deal with cover image as two dimensional array and start by the segmentation process. It takes width and height of the image in order to send them to the segmentation procedure. Inside the procedure, possible segmentations will be computed and given an index for each one. The computation of each segment is done according to height and width that were sent from caller. Segments will be stored and returned back to user as a linked list in aim to determine the selected one for the embedding process.
Each segment stores a distinguishable index that is used when the user selects the required segmentation for embedding. Also it stores the number of rows and columns in which height and width can be divided to them. The ulterior steps will summarize the forerun description.
Step 1: Set Segmination List. Head = null
Step 2: Set Segmination List. Set Image Dimension
Step 3: Set Index = 0, Used Index = 0, Col Increment = 0, Row Increment = 0, Area Head = null
Step 4: For # of Rows = 2 To Height
IF Height Mod # of Rows = 0 Then
For # of Cols = 2 To Width
IF Width Mod # of Cols = 0 Then
Index = Index + 1
Add_Node (Index, # of Rows, # of Cols)
End If
Next For
End If
Next For
Step 5: Return back the Segmentation list to user
Here, the user must select a segment form the returned segmentation list to be utilized in the embedding process. According to user selection, the system will find out the areas for number of rows and columns that were determined previously. Each area will hold an index, minimum width, maximum width, minimum height, maximum height, row index and column index, keyX and KeyY as shown in
Index of area is used in the embedding process to determine the selected area from the area list. Minimum width, maximum width, minimum height and maximum height are utilized in the mapping process for finding the correct location inside the area. Col Index and row index are used in the selecting area generator for X and Y locations. KeyX and KeyY are employed in area X Generator and Y Generator respectively to compute the current and the next values for x and y (x and y are location in the cover image). The next steps show how the values for each area are computed:
Step 1: Get the index of segment and store it.
Step 2: Set Segmination List. Area Head = null
Step 3: Set Segment = Find Node (Index)
Step 4: IF Segment = null Then Return Back to caller
Step 5: Set Row Inc = Image Height/Segment. Rows
Set Col Inc = Image Width/Segment. Cols
Set Min Width = Max Width = 0
Set Min Height = Max Height = 0
Set Segmination List. Used Index = Index
Set Area Index = Row Index =Col Index = 0
Step 6: While Min Height < Image Height Do
Begin
Max Height = Min Height + Row Inc − 1
Min Width = 0
Col Index = 0
While Min Width < Image Width Do
Begin
Max Width = Min Width + Col Inc − 1
Add Area Node( )
Area Index = Area Index + 1
Min Width = Max Width + 1;
Col Index = Col Index + 1
End While
Row Index = Row Index + 1
Min Height = Max Height + 1;
End While
Step 7: Return back the segmentation list to caller.
The secret message could be any type of files such as text, image, PDF, DOC…etc. The message file is converted to a stream of bytes. The system will compute size of input secret message, find out their extension and display the results to user in aim to keep them for the future employment in the extraction process.
Number of areas defines the total number of areas in the selected segment. It is computed as follow:
Step 1: Segment = Find Node (Used Index)
Step 2: # of Areas = Segment. Rows * Segment. Cols
The inserted master key value is utilized in multiple operations. It is used for data encryption, x & y generation and area selection as ulterior:
Step 1: Set Segment Area = Area Head;
Step 2: Set Encryption Key = Key * 23
Step 3: Set Selection Key = Key * 31
Step 4: Set Generator Key = Key
Step 5: While Segment Area! = null Do
Segment Area. Key X = Generator Key * 3
Segment Area. Key Y = Generator Key * 7
Generator Key = Generator Key * 5
Segment Area = Segment Area. Next
End While
Each area in the segment requires two generators one for x and the other for y, so the number of X Generator will be equals to number of columns in segment, while the number of Y Generator equals to number of rows in the same segment. They are defined as ulterior:
Step 1: X Generator = new LCG [Segment. Cols]
Step 2: Y Generator = new LCG [Segment. Rows]
Linear Congruent Generator (LCG) method is used to generate a set of random number sequence over the interval [0, M − 1] without redundancy until completing the cycle. LCG has a set of preconditions that must be satisfied to generate the set of numbers without any redundancy [
It is one of the most common and simplex cryptography techniques [
The mapping function that converts a value from one range to another is employed in the computer graphics viewport mapping [
After completing the main requirements for embedding process (Image conversion process, Secret message selection, Key setting, Number of areas determination, Area boundaries and Segment selection), the system will start data manipulation if the size of secret message compatible with the size of cover image. First of all, it takes the first byte of secret message stream, encrypts it by using the Caesar algorithm then the result will be converted to bits. For each bit in the selected byte, the system will select an area from the segment according to area index. Next the system will generate x and y through X Generator and Y Generator respectively, it’s also update the values for Keyx and Keyy in the selected area. The values of x and y must be mapped to the boundaries of selected area. The pixel in (x, y) location will be fetched for manipulation and replacement. After completing that, the new color is set on bitmap buffer of cover image and the area index updated to next area. The process stills working until completing all bits of secret message bytes. The previous description can be summarized as follows:
Step 1: Secret Stream. Position=0
Step 2: Area Index = Selection Key
Step 3: Load cover image in a bitmap buffer
Step 4: Set Capacity = (Image Width * Image. Height)/8
Step 5: IF Secret Length > Capacity Then
Return back to caller
Step 6: while Stream. Position < Stream. Length Do
W = Stream. Read Byte ( )
W = Encryption (Encryption key, W)
Bits = Convert To Bits (W)
For i = 0 To Bits.Length-1
Area Index = Random LCG (Area Index)
Segment Area = Find Area Node (Area Index)
With Segment Area Do
Get XY (KeyX, KeyY)
KeyX = X
KeyY = Y
X = Map Value (X, Min Width, Max Width, 0, Col Inc)
Y = Map Value (Y, Min Height, Max Height, 0, Row Inc)
End With
Color C = Get Pixel (X, Y)
IF C. Red [
C = Color. From Argb (C. Red, C. Red, C. Red);
Set Pixel(X, Y, C);
Next For
End While
In order to extract the secret message from the stego-image, you should be aware of four important things; first you should know the length of secret message, this means you should know the number of bytes that were hidden. Secondly, you should know the key that was used to hide the data. Thirdly, you should know the segmentation that was utilized in hiding the data. And finally, you should know the extension of secret message (type of message). Once you have these information you can extract the message from the stego-image using the ulterior steps as shown in
Step 1: Determine segment to be used on stego-image
Step 2: Compute segment area boundaries
Step 3: Compute number of segment areas
Step 4: Initialize the keys
Step 5: Initialize the area generators
Step 6: Load stego-image in a bitmap buffer
Step 7: Set Capacity= (Image Width * Image Height)/8
Step 8: IF Given Length > Image Capacity Then
Return back to caller
Step 9: Set Area Index= Selection Key
Step10: Set Byte Counter = 0
Step 11: While Byte Counter < Message Length Do
Bits = new byte [
For j = 0 To j < Bits. Length-1
Area Index = Random LCG (Area Index)
Segment Area = Find Area Node (Area Index)
With Segment Area Do
Get XY (Key X, Key Y)
Key X = X
Key Y = Y
X = Map Value (Min Width, Max Width)
Y=Map Value (Min Height, Max Height)
End With
Color C = Get Pixel (X, Y)
Bits [j] = (byte) (C.R & 1)
Next For
B = Convert To Byte (Bits)
B = Decryption (Decryption key, B)
Write Byte (Stream Buffer, B)
Byte Counter = Byte Counter + 1
End While
Step 12: Copy Buffer (Stream Buffer, Filename, Extension)
Step 13: Return back to caller
The extraction procedure carries out the steps from one to nine as in the hidden procedure, so no need to re-explain them, also X, Y generation and mapping are done as in the hidden process. Decryption process uses the Caesar algorithm that was used to encrypt the secret message bytes.
The proposed system was tested using a lot of images and secret messages.
The main issues that were taken in our consideration for evaluating the system are: visual appearance of ste-
Secret Message | Size | Cover Image | Size | Dimension [W × H] |
---|---|---|---|---|
Secret 1 | 508 Bytes | Jarash | 717 KB | 700 × 350 |
Secret 2 | 41 Bytes | Lenna | 768 KB | 512 × 512 |
Secret 3 | 1 KB | |||
Secret 4 | 13.7 KB |
go-image compared to the cover one, modification rate, capacity of cover image, robustness against modification, detecting ability and security.
Visual appearance is evaluated through the human eyes or the magnifying classes. The stego-image is compared with cover image in order to detect a noise or irregularity in the final form of image. To test the appearance, we embedded secret 1, secret 2, secret 3 and secret 4 in the images of Lenna and Jarash with two segment area for each one. The stego-images in the different cases gave a result similar to the cover one as shown in
One criteria can be utilized to select the best segment is the modification rate. It is computed by dividing the number of modified pixels over the cover image length. The MR value bases on the user selected image. It helps in selecting the best segment for hiding the effect of visual appearance in the stego-image. MR varies between one segment and another for the same secret message as shown in
Lenna Image | Jarash Image | ||
---|---|---|---|
64 Segments | 160 Segments | ||
Segment | # of Areas | Segment | # of Areas |
2 × 2 | 4 | 2 × 2 | 4 |
2 × 4 | 8 | 2 × 4 | 8 |
2 × 8 | 16 | 2 × 5 | 10 |
: : | : : | : : | : : |
256 × 256 | 65,536 | 175 × 350 | 61,250 |
Segment | Lenna Image | Segment | Jarash Image |
---|---|---|---|
[2 × 2] | 0.0076 | [2 × 2] | 0.0078 |
[64 × 32] | 0.0070 | [70 × 20] | 0.0062 |
a low MR due to regular and equal distribution of pixels within those areas.
Capacity of cover image is determined by the dimensions of image. As we mentioned previously, each secret message bit requires one pixel (3 bytes) from cover image, so the maximum capacity is computed by dividing cover image length on the value 8 ( one byte). Lenna image can store in the maximum state 3264 bytes. To evaluate the proposed method at the maximum capacity state, we got a secret message of size 3 KB and embedded it in Lenna image; the result stego-image was very similar in visual appearance to cover one with a modification rate only 0.04 as shown in
Information is considered a robust when it is embedded, hidden inside an image and encountered any modification to image. In general, most of image steganography techniques are not robust against the modification and our proposed technique is one of non-robust methods.
Undetectability as a feature was applied in the proposed method because the used pixel consists of three colors (Red, Green and Blue), each one stores the same value and the bit is distributed randomly within a random area, according to this the hidden bits under an image are not doubtable or suspicious.
The proposed method is considered a secure one because no attacks view the hidden message unless they have a full knowledge about the keys. The extraction process requires multi keys for extracting the secret message. Those keys are: master key, length of message, used segment and type of secret message. Master key is utilized to build other keys for cryptography, key of area selection and keys of pixel location. For example to extract the message inside a given image, we will require a set of keys as follow:
・ Image consists of N segments (N keys) and the user must select one of them.
・ The Selected segment holds a number of areas, selection of random area needs a key and the initial key will be regenerated in next area selection.
・ Each area requires two keys to select the pixel and the initial keys will be regenerated in next pixel selection.
・ Decryption of extracted bit requires a key that is regenerated in next decryption process.
・ Secret message length and extension are also considered two keys
・ According to that, the extraction process is very hard, complex and secures one.
This paper presented a novel gray scale steganographic method for information security. It based on the idea of image segmentation to give an improved steganography method for embedding secret message bit in least significant bytes of random pixel in a random area within the grayscale cover image. The main goal of this paper is to construct a solution that is robust against the attack, effective in generating stego-image and very hard for visual appearance to predict and detect the existence of secret message. Experimental results show that, the proposed method satisfied most of the security requirements (visual appearance, security, undetectability), explained adaptability of grayscale cover image as a host to hide the secret messages and improved the data hiding capacity of host image by utilizing all the pixels. The future work of this paper proceeds to extract the secret message from stego without a master key. We look to distribute the master key inside in the stego-image in a way that allows the receiver extracting the secret message without any pre-knowledge about it.
Mohammed J. Bawaneh,Atef A. Obeidat, (2016) A Secure Robust Gray Scale Image Steganography Using Image Segmentation. Journal of Information Security,07,152-164. doi: 10.4236/jis.2016.73011