Abstract

As the internet has become the medium for transferring the sensitive information, the security of the transferred message has become the utmost priority. Image steganography has emerged out as the eminent tool of information hiding that ensures the security of the transmitted data. Image files provide high capacity, and their frequency of availability over the internet is also high. In this paper, a method of image coding is proposed that hides the information along a selected pixel and on the next value of the selected pixel, that is, pixel + 1. One bit is hidden at the selected pixel, and the second bit is hidden on the pixel +1 value. On the basis of the 7th bit of the pixels of an image, a mathematical function is applied at the 7th bit of the pixels, which generates a temporary variable (pixel + 1). The 7th bit of the selected pixel and 7th bit of pixel + 1 are used for information hiding and extraction. On the basis of a combination of these two values, two bits of the message can be hidden on each pixel. After implementation, the efficiency of the method is checked on the basis of parameters like PSNR and MSE, and then comparison with some already proposed techniques was done. This proposed image steganography showed interesting, promising results when compared with other existing techniques.

1. Introduction

Internet has emerged as the most convenient and efficient medium for communication. Through internet, messages can be transferred in a fast and cheap way in various fields like government offices, private sector, military, and medical areas [1]. Many times, confidentiality of the transferred message needs to be maintained. To ensure that the message is transferred securely and safely over the network, a suitable method is needed. Steganography proves as a trustable method for achieving this aim. In steganography, the data are hidden in the cover media. The cover medium can be in the form of image file, text file, video file, or audio file. Steganography is defined as a science or art of hiding the message inside some cover medium [2, 3]. The word steganography is built up of two words of ancient Greek origin “steganos” meaning “covered, concealed, or protected” and “graphie” meaning “writing.” The concept of steganography is not new; its usage can be seen in the past also. Historical records depict that around 440 BC, Herodotus sent secret messages using the concept of steganography. In ancient times, Greeks also wrote messages on wood and covered them with wax. The concept of invisible ink was also used during the period of World War II. According to Greek history, secret messages were written on the bald scalp of the slaves, and after the growth of hair on their heads, they were sent as messengers.

The most popular medium used is image files because of their high capacity and easy availability over the internet [4]. At the sender’s side, the image used for embedding the secret message is called cover image, and the secret information that needs to be protected is called a message. As soon as data are embedded using some appropriate embedding algorithm, then it is called stego image. This stego image is transferred to the receiver, and he extracts out the secret message using extraction algorithm [5]. Another data hiding technique, cryptography is also used for secure transmission of messages over the internet, but steganography is becoming more popular because of its advantages over cryptography. Cryptography hides the exact meaning of message from the third party whereas steganography hides the very existence of the message itself. Figure 1 shows the Steganography System.

2. Literature Review

Steganography has emerged as a glowing research area in which various methods have been proposed in several carrier media. Here, we are going to present the brief overview of some already proposed methods, and at last, we will be presenting the comparison work with these methods.

LSB method [6] provides the very basic idea of steganography in an easy manner. This method states that the secret message bits can be placed by replacing the least significant bits of the pixels of the image. It allows 100% insertion of message binary bits in the pixels of an image with a very minute change of +1 or −1 in the value of the pixels [7]. This method was vulnerable to attack as the message was present at LSB, and by only picking LSBs, the intruder can access the data. Quantization noise can also destroy the data present on LSB [8]. So, this method can be easily decoded by the intruder and is also not immune to the noise and compression techniques. Also, this method allows only single bit insertion of message data inside the particular pixel. Let us try to understand with the help of the following example.

Suppose the message string to be sent over the internet is 10010101, and the value of continuous pixels are as follows:

01101000 10101001 01101000 11110000 00011101 10000001 11110000 10101010.

Then after inserting the message, pixels would be as follows:

01101001 10101000 01101000 11110001 00011100 10000001 11110000 10101011.

This method was vulnerable to attack as the message was present at LSB, and by only picking LSBs, the intruder can access the data. Singh et al. proposed a method based on first and second bit plane. In this method, on the combination of 1st and 2nd bit plane the message was hidden. The main result of the method was that the probability of message insertion at a pseudorandom location at first chance was 50%. The probability was 50% when there was no need to change the pixel value. The probability was 12.5% when a change in pixel value was required. Batra and Rishi [9] proposed a method in which the message was hidden using the 6th, 7th, and 8th bits of a pixel in a grayscale image. This method overcomes the limitation of the Singh et al.’s method. The main result of the method was that the probability of message insertion at a pseudorandom location at first chance is 85.93%. The probability when the message was not changed was 43.18%. As the result shows, this method does not provide 100% message insertion rate. In FMM (Five Modulus method) [10], the cover image was divided into N blocks with block size kk pixels where k is the size of the window. Each pixel in these blocks was modified such that the pixel of the block is divisible by 5. The beauty of this method was that the message was scattered over the entire image. The limitation of this method is the hiding capacity that is low. In some cases, the average message hidden capacity is below 1 bit per pixel. Bailey and Curran [11] have presented the facts of the Stego Color Cycle (SCC) method. This is the advancing method of LSB. Here also LSB of pixels of color images is used for insertion of secret message binary bits. Insertion is done in a cyclic way by choosing the LSB of the red channel of first pixel and then LSB of the green channel of second pixel and then LSB of the blue channel of third pixel, and this cycle repeats in same cyclic order for all the pixels. This method also allows 100% insertion for RGB images, but for its simple cyclic order, it can be easily decoded by the intruder. Further, some more techniques are proposed that remove the fallacies of this method to some extent. Gutub [12] presented the pixel indicator method. This method is applied to RGB images in which two channels of the image are used for storing the data on the basis of the value of the third channel that acts as the indicator channel. A sequential order is used for choosing the indicator channel, that is, RGB, RBG, GBR, GRB, BRG, and BGR. Table 1 shows the PIT technique.

This method provides high-capacity data insertion; 2 bits and 4 bits of secret message can be hidden inside single pixel. Along with this, it provides high capability against decoding of the message by the intruder. The disadvantage associated with this method is that it does not provide 100% insertion as one channel is utilized for the indicator. Wu and Tsai [13] have proposed pixel value difference method. In this technique, the cover image is bifurcated into nonoverlapping blocks. Two consecutive pixels are placed inside each block. The difference of the consecutive pixels of each block is calculated, and this difference value is found to be small in smooth areas of the image whereas its value is large in edge areas. Using this technique, large amount of data can be placed in edge areas as compared to smooth areas. The amount of secret message bits that can be embedded depends upon the range of difference value; range is always taken in powers of 2 because the message has to be inserted in binary form. This method provides high embedding capacity and perceptibility but the stego image can be more distorted if the difference in pixel values is more.

LSB-S method [14] also provides two layers of security. First layer provides cryptographic security, and second method uses steganographic security. Joshi et al. [15, 16] proposed two methods based on XOR operation. The first method used two bits of the cover media, and the second one used three bits of the cover media. The author claimed 100% chances of message insertion.

3. Proposed Work

The aim of the proposed scheme is to develop a secure and robust technique for transfer of messages so that private and important information can be sent over the network in a protected manner without being vulnerable to any kind of attacks by an unintended recipient. The proposed method works on gray images. A mathematical function is applied to the 7th bit of the pixels. The 7th bits of the selected pixel and pixel + 1 value are extracted, and on the basis of a combination of these two values, 2 bits of the message can be extracted from each pixel. There can be four possible combinations 00, 01, 10, and 11. This method provides various advantages such as two bits of message storage in each pixel and nondependency of the technique on the 8th bit. There can be a change of +2 and −2 at maximum in the pixel value while inserting the data in the image file. This method helps in tackling the limitations of steganography to a higher extent.

4. Proposed Algorithm

Let the length of the message is known to sender as well as the receiver. Let I be the cover image of RC pixels, S be the N-bit secret message, x be the pixel value of I, and s be the bit of secret message, then the image matrix can be represented by (1), and S can be represented by (2).

Let is the message to be hidden, is the cover media, is the stego key used for insertion and retrieval of the message, and are the insertion and retrieval algorithms, respectively, and is the stego file.

The insertion process may be given by the following equation:

The insertion algorithm is given in Pseudocode 1. At the other end, the reverse process is carried out and the message is extracted using the algorithm in Pseudocode 2. The message is separated from the cover image by (4). The retrieval process may be given by the following equation:

The data can be inserted by the method given as follows.

(1)a1 = enter the message;
(2)N = length (a1) 8;              %Length calculates the message length in bits
(3)Binarystring = dec2bin (a1, 8);            %Message in bits
(4)I = Read image;                   %Insert Image in I variable
(5)[r, c] = size (I);                %r and c give the row and column of the image
(6)X = zeros (r, c);                   %Initialize a temporary matrix, X, to ZERO
(7)Let K = 1;                  %Initialize a variable K
(8)Let a = 1;                   %Initialize a variable a
(9)Repeat L = 1: r                %Repeat L = 1 to r
(10) Repeat m = 1: c               %Repeat L = 1 to c
(11)  A = get 2nd bit of I, (I (L, m), 2);        %A is the 2nd bit of I
(12)  Q = I (L, m) +1;             %Q is the next pixel of the image I
(13)   B = get 2nd bit of Q, (Q, 2);       %B is the 2nd bit of Q
(14)    If (K < N)
(15)     M1 = binarystring (a);        %M1 is the first message bit
(16)     M2 = binarystring (a + 1);      %M2 is the second message bit
(17)     if ((A==0) && (B==0))
(18)      if ((M1==0) && (M2==0))
(19)       X (L, m) = I (L, m);       %No change in pixel value and drop I in X
(20)      end
(21)      if ((M1==0) && (M2==1))
(22)       X (L, m) = I (L, m) +1;     %Pixel value is incremented by 1
(23)      end
(24)      if ((M1==1) && (M2==0))
(25)       X (L, m) = I (L, m) −1;     %Pixel value is decremented by 1
(26)      end
(27)      if ((M1==1) && (M2==1))
(28)       X (L, m) = I (L, m) +2;     %Pixel value is incremented by 1
(29)      end
(30)     end
(31)     if ((A==0) && (B==1))
(32)      if ((M1==0) && (M2==0))
(33)      X (L, m) = I (L, m) −1;
(34)      end
(35)      if ((M1==0) && (M2==1))
(36)      X (L, m) = I (L, m);
(37)      end
(38)      if ((M1==1) && (M2==0))
(39)     X (L, m) = I (L, m) +2;
(40)      end
(41)      if ((M1==1) && (M2==1))
(42)     X (L, m) = I (L, m) +1;
(43)      end
(44)     end
(45)      if ((A==1) && (B==0))
(46)     if ((M1==0) && (M2==0))
(47)      X (L, m) = I (L, m) +1;
(48)      end
(49)      if ((M1==0) && (M2==1))
(50)       X (L, m)=I (L, m) +2;
(51)      end
(52)      if ((M1==1) && (M2==0))
(53)       X (L, m) = I (L, m);
(54)      end
(55)       if ((M1==1) && (M2==1))
(56)       X (L, m) = I (L, m) −1;
(57)       end
(58)     end
(59)      if ((A==1) && (B==1))
(60)       if ((M1==0) && (M2==0))
(61)        X (L, m) = I (L, m) +2;
(62)       end
(63)       if ((M1==0) && (M2==1))
(64)        X (L, m) = I (L, m) −1;
(65)       end
(66)       if ((M1==1) && (M2==0))
(67)        X (L, m) = I (L, m) +1;
(68)       end
(69)       if ((M1==1) && (M2==1))
(70)        X (L, m) = I (L, m);
(71)       end
(72)      end
(73)      K = K + 2;
(74)      a = a + 2;
(75)    else
(76)      X (L, m) = I (L, m);
(77)    end
(78)   end
(79)end
(80)Convert X matrix to an image, that is, stego.tif
(1)S = Read stego.tif image      %Read the stego image in S matrix
(2)[row, col] = size (S);         %Find row and column of the stego image
(3)load N;              %Load the message length
(4)k = 1;               %Initialize the value of k by 1
(5)m = 0;              %Initialize m matrix to zero
(6)Repeat i = 1: row
(7) Repeat j = 1: col
(8)  if k < N
(9)   m (k) = 2nd bit of S, i.e. (S (i, j),2);
(10)   m (k + 1) = 2nd bit of the next pixel of S, i.e.(S (i, j) +1, 2);
(11)   k = k + 2;
(12)  end
(13) end
(14)end
(15)m;
(16)M = reshape (m,8,[]);
(17)Convert M into a character stream;

5. Example of the Proposed Method

The proposed method can be explained with a suitable example. Let us assume that the secret message to be embedded is m = {01110110}, and the four pixel values being selected are p = {72, 95, 86, 58}.

5.1. At Sender’s Side

The 7th bits of and form the pair “00” but initial two message bits to be inserted are “01.” Therefore, we need to add +1 to the value of . Hence,where is the stego pixel.

Now, add +1 to the second pixel, that is,

The 7th bits of and combine to form the pair “11” and the 3rd and 4th message bits are also “11.” Hence value of

Now, third pixel value, that is

The 7th bits of and combine to form the pair “10” but the 5th and 6th message bits are “01” Hence, we need to add +2 to the pixel value.

Now, third pixel is

The 7th bits of and combine to form the pair “11,” but the 7th and 8th message bits to be inserted are “10,” Therefore, +1 is needed to be done.

Now, the value of pixels in the stego image that is transferred over the internet is

5.2. At Receiver’s Side

The set of selected pixels is {73, 86, 97, 59}.

Now,

The 7th bits combined to form the message bit “01.”

Now, the second pixel value is

The 7th bits combine to form the pair of message bits “11.”

Now, the third pixel value is

The 7th bits combined to form the message bit “01.”

Fourth pixel value is

The 7th bits combined to form the message bit “10.”

Hence, the received message stream at the receiver’s side is {01110110}.

The diagrammatic representation of the proposed method is shown in Figure 2.

6. Experimental Results and Analysis

The efficiency is checked on the basis of two parameters, that is, PSNR [17] (peak signal to noise ratio) and MSE (mean square error). Obtained values show the high efficiency of the proposed method:where and represent the dimensions of the image matrix, represents the original image, and represents the stego image.where represents the maximum possible value of the pixel in an image. PSNR is measured in decibel.

The results of the proposed method with different images and different message sizes are given in Tables 26.

7. Comparison of the Proposed Method with Other Techniques

The PSNR value of the proposed method is compared with different techniques, and the corresponding results are depicted in Table 7. 8 KB message data are taken in binary form and applied to the standard images of resolution (256∗256). These images are taken from USC-SIPI-ID dataset. Table 7 consists of the result of PSNR values of different techniques when applied on different images; these values of PSNR for the other method are taken from [17].

The LSB method can be easily hacked down. The Stego Color Cycle method is only an extension of the LSB method that is applied to the three-color components of the image. PIT method does not allow insertion of data at each pixel. The proposed method tries to overcome the drawbacks of all these methods.

8. Histogram Results for the Images

Histogram results of few images are depicted by applying the proposed method using a 2 KB length of the message. The original image and stego image along with their corresponding histograms are shown in Figures 322.

9. Conclusion and Future Scope

The above discussed steganographic method allows high capacity of data to be hidden inside the gray carrier image. Each pixel stores two bits of message bit inside the pixel, whereas other methods like LSB allow only one bit of message hiding inside every pixel. Our method does not entertain its dependency over the 8th bit as that is found in the case of LSB method. Another advantage that this method comes up is 100% insertion of data inside the selected pixel, whereas methods like “6th, 7th bit” allow only 50% insertion approximately. A very simple mathematical function of comparing the bits is used. One of the major requirements of steganography is to send the secret message inside the carrier image without creating much difference to the original image. Our technique also fulfills this requirement up to a higher extent. A maximum change of +2 or −2 is entertained while transferring the stego image. In the same manner, message can be extracted at the receiver side by using the same method on the stego image. One of the major demands of the good steganography method is to provide good PSNR and MSE values. Our method provides high PSNR and low MSE values when compared with other methods.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.