A New Method of Coding for Steganography Based on LSB Matching Revisited

,


Introduction
ese days, the extensive application of the Internet has made transmission of information very easy and quick. Since the data are communicated through a public network such as the Internet, the security of the data is still an important challenge. Information hiding is an applicable technique to provide security for data communication.
is technique hides the secret data within a cover data to generate a stego data [1][2][3]. e main techniques in information hiding include steganography, watermarking, and cryptography. A steganography method aims to hide any relationship between the sender and the receiver by embedding the data within the cover text. A watermarking method aims to protect the copyright of digital content owners. A steganography technique hides both the secret data and the relationship between the sender and the receiver, while a watermarking method protects only the secret data [4]. In a cryptography method, both the sender and the receiver can be identified and the main objective is to protect the content of the secret data.
A steganography technique employs a key and a media called cover data, to hide the secret data. e main objective of a steganography method is to hide the sender, the receiver, and the content of the secret data, which makes the secret data visible only to the receiver [4,5]. e steganography word is originally derived from two Greek words: stego means hidden and grafia means writing [6]. Steganography is a method to transfer secret data embedded within cover data through a public communication channel such as the Internet. In this method, an attacker cannot extract the secret data from the cover data [7,8]. ere are three important parameters for evaluating a secret data communication technique, namely, capacity, robustness, and transparency. Increasing these three parameters raises the confidentiality of the data communication technique. However, increasing all these three parameters simultaneously is a very daunting task. is is because increasing the transparency and capacity decreases the robustness, and increasing the robustness of the technique against the attacks decreases the transparency and capacity of the technique.
us, an information-hiding technique must declare its main objective to improve some of these parameters. For example, a watermarking technique often accords the highest priority to robustness, while a steganography method accords higher priority to capacity and transparency compared to robustness. In another word, transparency is the highest priority in a steganography approach followed by capacity. e cover data in steganography can be an image, voice, video, text, protocol, etc. [9][10][11]. Images are employed as the cover data to a great extent in steganography techniques as they provide higher capacity, suitable flexibility, and extensive utilities for end users. Hiding secret data within an image is called image steganography. e image steganography must keep the main features of the image when it embeds the secret data inside of the image.
Image steganography methods can be divided based on their context into two groups: those in the Spatial Domain and those in the Transform Domain. e spatial domain steganography methods change some bits of the pixels in the cover image. e pixels employed for hiding the secret data are selected using a simple and random method. us, these methods provide insufficient robustness. e transform domain steganography methods hide the secret data within the transform coefficients of the cover image. ey use various transforms such as Discrete Cosine Transform (DCT), Discrete Fourier Transform, and Discrete Wavelet Transform [10]. ese methods provide a high level of robustness and low capacity. e capacity and transparency (quality) of the stego image are the most important features of an image steganography technique. e capacity is the amount of data that can be hidden in a cover-image while maintaining the imperceptibility. Increasing the capacity must protect the secret data from being detected through the HSV or other statistical recognition methods.
us, increasing the capacity while maintaining the imperceptibility is still a challenging task in image steganography [1]. Transparency is also indicated as the security of an image-steganography technique. Transparency means that the steganography process must not generate any type of perceptual distortion or changes in the statistical features of the cover-image that lead to the perception of the process by a steganography analyzer. Making a trade-off between capacity and security is a significant challenge in designing an image steganography algorithm [12].
We can divide the LSB-based steganography methods into two categories: LSBR (LSB replacement) and LSBM (LSB matching). LSBR simply replaces each bit of the secret message into the lowest bits in the cover image. However, LSBM randomly chooses to increment or decrement some pixels in the cover image in which their lowest significant bits are different from the appropriate bits in the secret message. In both categories, the receiver can simply extract the secret message from the lowest significant bits in the stego image [12,13].
LSB MR (LSB Matching Revisited) is another LSB-based approach proposed for image steganography. Although both LSBM and LSBR choose the pixels independently, LSB MR considers every two continuous pixels in a single group. In this method, two bits of the secret message are hidden in two pixels with only one change. In LSB, the first pixel is used to hide the first bit of the secret message, and the second bit of the message is also hidden based on the even or odd relationship between two pixels of the cover image [12]. But this method has no idea for hiding a message with a large number of bits. In other words, this method works only for n � 2. erefore, it is not possible to accurately compare the capacity of the proposed method with the LSB MR method. e F5 method works for n > 1. Also, the F5 method is a kind of coding method and is similar to the proposed method. erefore, the capacity of the proposed method compares with the F5 method.
To address the abovementioned challenge, in this paper, we propose a method that works for n > 2, called here the Advanced LSB MR. e proposed method is a new method of coding for steganography and can be used in the first step of every steganography method to reduce the change in the stego image. For example, in [14], secret data are embedded within the skin region of the image in which for three bits of secret data, three coefficients of DWT have to be changed. ese changes are reduced to one coefficient using the proposed method in the embedding step compared to the literature where four coefficients are required. For three bits of secret data, the coefficient changes decreased from 3 to 1, and the number of coefficients increased from 3 to 4. Using the proposed method in one of the steps of every steganography method, the changes of coefficients are reduced and as a result, the security and the resistance of the steganography method against steganalysis are increased while the capacity is reduced. e suggested method proposes a novel mapping function to generate a number of 2 n different states for n bits of the secret message with only one change (additive or subtraction). is helps to hide a number of n bits in a number of 2 n− 1 coefficients only by one change. It is noted that most of the steganography approaches assume that n < 5 where the capacity decreases sharply with increasing value of n. For example, to hide one byte, the data are divided into two 4-bit sections, and then the embedding operation is performed, and when only 16 coefficients are needed while n � 8, the number of required coefficients becomes 128. e rest of the paper is structured as follows. Section 2 provides the related work. Section 3 describes the Basic Concepts used in our image steganography scheme. Section 4 presents our novel steganography scheme. Section 5 describes our experimental result. Finally, the conclusion is drawn in Section 6.

Related Works
F5 is a promising approach in steganography, which provides a high level of capacity.
is method employs hamming coding to reduce the number of changes in the LSB coefficient of the cover image. Such reduction in the changes lead to a higher level of security in F5. e F5 scheme hides n bits of the message into 2 n − 1 coefficients. us, by increasing the value of n , we need more coefficients, which leads to lower steganography capacity [15]. In other words, the capacity of a steganography scheme decreases as the value of n increases. us, it is recommended to set n � 3 for most real applications to avoid reducing the capacity of the steganography. e F5 algorithm is vulnerable against many statistical attacks such as histogram attack and χ 2 attack [16]. e F5 algorithm uses DCT and the generated coefficients are decimals in this transform. e technique embeds the secret message in these coefficients. It is possible that some parts of these coefficients are removed in the inverse of the transforms, and this could result in the embedded bits of the secret message being removed in such a procedure. erefore, the F5 algorithm uses the DCTcoefficient after quantization in JPEG. e quantized DCT coefficient matrix elements in JPEG are saved and the embedded secret message in the quantized DCT coefficient is extracted directly. e IDCT is used for both decoding and displaying a JPEG image [16]. In order to fairly compare our approach against F5, we converted the hamming coding used in F5 into the spatial domain before comparing the two schemes.
ere are several types of research conducted to improve the capacity, processing time, and the method of finding the position to embed the message. In [1], a method based on a quantization table is proposed to raise the capacity of the F5 algorithm. is method also provides some improvement in the processing time of F5. e method proposed in [17] focuses on choosing a suitable position for embedding the message. e main contributions of this method include fewer changes in the cover image and robustness against statistical attacks compared to the original F5 algorithm.
LSB is a simple and challenging algorithm method in steganography. In this method, replacing fewer bits of LSB makes the difference between cover image and stego image very difficult to spot [10]. However, changing a large number of bits in the cover image is one of the challenges of LSB. In some cases, there is less change in the cover image when the complement of the message is hidden. Using the complement of the message for reducing the changes in the cover image makes a new version of the LSB method, called reverse LSB [18]. e PI method is proposed to improve the security level of LSB [19]. is method hides the secret message into the 24-bit color channel of the image. e PI method generates less visible corruption when the hiding rating is less than three bits. is secures the scheme against both visibility and histogram attacks. Another extension of the LSB algorithm is OPAP (Optimal Pixel Adjustment Procedure) [16]. e OPAP scheme computes the difference between pixels in the cover image and the stego image and then changes the hidden bits to improve the transparency of the steganography process [20]. us, OPAP provides a high value of PSNR (Peak Signal-to-Noise Ratio) for widely used images such as Baboon and Lenna [21]. Another extension of the LSB algorithm is a mixture of adaptive pixel value differentiating between PVD and LSB. e method is proposed for increasing the data hiding capacity [22].
Another method for steganography is image realization steganography, which is based on a secure key and employs image realization in spite of directly hiding the secret information. is method uses a mapping matrix for hiding the secret message and is robust against both brute-force attack and statistical attacks such as histogram attack [23]. Roy and Changder in [24] extended this method by proposing a confidential mapping technique that is based on the Longest Common Subsequence.
is method is robust against the brute-force attack and also provides a promising hiding capacity.
Wu and Tsai in [25] proposed an image steganography method called PVD (pixel-value differencing). is method first divides the cover image into no-overlapping blocks. en, the difference between every two pixels in each block is computed and all these differences are grouped into some ranges. After that, the differences are replaced by some new values to embed some bits of the secret message. e number of embedded bits in a pair of pixels is determined based on the size of their difference range. A combination of LSB and PVD can improve the capacity and transparency of the cover image [26]. is method first computes the difference between every two continues pixels using PVD. It is to be noted that such a difference in the smooth positions is low and in the edges is high. erefore, LSB and PVD are used for smooth positions and edges, respectively.
Raja et al. in [27] proposed a combination of LSB, DCT, and compression techniques to extend the LSB algorithm. In the first step, they use LSB to embed the secret message into the cover image. en, the obtained image is transformed into the frequency domain using DCT. Finally, to improve the security level, they compares the image using quantization and run-length coding algorithms.
Bhardwaj and Sharma in [2] proposed an LSB-based steganography method in which the pixels are groups based on their values in second and third bits to reduce the number of changes needed during the embedding phase. After applying inverted LSB, the number of changes for each group is computed and then a group which highly changes pixels is inverted. While this method chooses only one group of pixels, our method employs all groups of pixels to reduce the number of changes. Moreover, our approach increases the number of groups and grouping is based on the second, third, and fourth bits of each pixel.
Valandar et al. in [28] proposed a transform domain steganography scheme based on integer wavelet transform (IWT) for digital images, and it also used a chaotic map. ey also proposed a steganography technique based on 3D sine chaotic map.
is map is used in embedding and extracting processes to increase the security of the steganography scheme [29]. Gutub and Al-Ghamdi in [30] proposed a multimedia image steganography for countingbased secret sharing. e proposed method in this article is different from the above methods as it extends the LSB encoding. Moreover, we believe that the extended LSB encoding proposed in this paper can be used for improving the aforementioned research.
Reversible data hiding (RDH) has received great attention recently in the field of information hiding Security and Communication Networks [22,[31][32][33][34]. A significant challenge in RDH-based techniques is increasing the data hiding capacity along with image quality [31]. Singh in [22] proposed a new data hiding scheme using a mixture of adaptive pixel value differencing (PVD) [35] and LSB in order to increase the data hiding capacity. Kaur et al. in [32] proposed an extension of the existing pixel value ordering methods to improve the quality of the stego image. Kumar et al. in [33] employed Lempel Ziv Welch (LZW) encoding to improve the hiding capacity of the RDH. Other compression methods, such as AMBTC image compression, can be used for improving the quality of the stego image [36]. Sahu and Swain in [37] combined LSB and PVD to propose a novel data hiding scheme. ey also leveraged the idea of pixel overlapping to improve the capacity and PSNR of an image steganography scheme [38]. In another work, they proposed a n-rightmost bit replacement image steganography scheme [39]. Sahu et al. in [40] proposed several dual-layered-based RDH methods using modified LSB. An interesting research issue is to investigate the possibility of applying our encoding method for improving the hiding capacity of RDH that we leave for future work.

Basic Concepts
In this section, we introduce several concepts used in our image steganography scheme.

Steganography.
For the first time, steganography was performed by a Greek king who was held captive by King Darius. is Greek king formed steganography by carving a message on his slave's head. Soon after that, a message were inscribed directly on a wooden tablet before a wax was applied, and also invisible writing was employed by lemon juice in Roman's ancient era. Also, steganography was performed at World War II to use in Null cipher message Text [41,42]. e objective of steganography is to hide the nature of secret messages from an unauthorized person, so that an invader cannot discover transmitted messages in the background of a general communication [7]. In cryptography, the sender, the receiver, and the encrypted message are obvious, but in steganography, hiding the sender, the receiver, and the secret is the main issue.
We can mention industrial steganography, linguistic steganography, and digital steganography as the main methods in this field. In industrial steganography, we use different sciences, such as engineering, physics, etc., to hide information. In the field of linguistic steganography, information hiding is done through writing. Also, the definition of digital steganography is to hide the messages inside digital media, such as voice, image video, and text.
In 1983, Simmons et al. represented a system based on steganography. In this system, two prisoners, named Alice and Bob, intended to plan an escape. To sketch an escape plan, Alice wants to send a message to Bob. e communication between Alice and Bob is checked by Willi, who is a prison officer. Alice should send her message to Bob in the form of a hidden message in the regular message so that Willie does not suspect and Bob will be able to fully understand the message [15]. is basic system is misused on various platforms.
Today, due to the wide variety of images, the image is used as a safe enclosure to conceal a message and is referred to as a cover. e image, which is produced after the inclusion of confidential data, is called stego. In steganography methods, we often use a key to clutter the message so that the content of the message won't be discovered clearly if the secret message is compromised or is being exposed. e general Schema of steganography with the key is shown in Figure 1.
Spatial methods are also steganography methods in the image field. In these methods, some pixels of our image are changed directly to hide secret data. In these methods, RGB or brightness intensity is used in latent data information. LSB is one of the image steganography methods in the spatial domain that will be described in detail next section. [43] proposed the LSB MR (LSB Matching Revisited) method in 2006. While both LSBR and LSBM independently consider each pixel, the LSB MR method pairs pixels in the cover image.

LSB MR Method. Mielikainen in
us, it simultaneously embeds the secret message into a pair of two pixels. Although LSB MR reduces the expected changes per each bit in the message compared to both LSBR and LSBM from 0.5 to 0.375, it has no improved hiding capacity. Moreover, LSB MR generates less distortion in the image and thus makes the identification of the changes harder [44].
Assume that the brightness of two continuous pixels is indicated as x i and x i+1 , and we aim to hide two bits of the secret message into the brightness of these two pixels. After embedding the message, the first bit of the message is equal to the lowest significant bit of x i . e second bit of the message is obtained using a function of both pixels in the cover image. In this method, when the first bit of the message is equal to the lowest significant bit of x i , there would be no change in x i . us, in order to obtain the position of embedding the second bit of the message, the function must return different values for the incremented and decremented values of the first pixel.
In case the first bit of the message is equal to the lowest significant bit of x i , there would be no change in such a bit in x i . erefore, we need to change the lowest significant bit of x i+1 in order to hide the second bit of the message. In fact, the function must hold an additional property in which it must return different values when the second argument of the function changes as x i+1 + 1 and x i+1 − 1.
According to the above two properties, we employ function us, embedding of two bits of the message (m i , m i+1 ) into two pixels (x i , x i+1 ) is executed as follows: To extract the message, we only need to obtain m i from the LSB of the first pixel and m i+1 from the function introduced for the embedding phase [43].
In LSB MR, every two bits of the message are hidden into the brightness of two continuous pixels with only one change. is method can be applied only for hiding two bits. In this paper, we extend LSB MR to hide three bits with only one change. Such reduction in the number of changes leads to increasing the PSNR metric, and it, therefore, consolidates our method against attacks for discovering the secret message.
e LSB-based approaches randomly apply their changes without considering the statistics of the image. Huang and Ouyang in [45] proposed a method to select the suitable positions for embedding in LSB. ey called regions of the image as smooth regions, redundant image regions, and regions with redundant pixels as the fragile regions. A little change in the fragile regions of an image makes the image detectable. us, the authors proposed to protect the fragile regions by not embedding messages within such regions.
Lou et al. in [46] reported that the statistical properties of the edges in an image are more complicated than the surface regions. After that, they proposed a steganography scheme to better keep such statistical properties. ey proposed an adaptive steganography scheme based on LSB MR, called EAMR. In this method, they employed the difference between the brightness of two continuous pixels to identify the embedding regions. Huang et al. [44] proposed a method to improve the robustness of EAMR against the identification attack by changing the pixel selection algorithm. In this method, the image is divided into nonoverlapping blocks with 3 × 3 pixels. In spite of choosing the continuous pixels, this method randomly chooses every paired pixel from each block (a block contains four pairs of pixels) in the vertical, horizontal, or convex directions. is method is a promising method to improve the security of EAMR against the identification attacks.
In this paper, we extend LSB MR to hide a number of n bits of the secret message in 2 n− 1 pixels or coefficients with only one change. Such reduction in the number of changes leads to increasing the PSNR metric, and it, therefore, consolidates our method against attacks for discovering the secret message.

The Proposed Method
As mentioned, F5 is a promising method in image steganography in which the Hamming coding is employed. Using such coding decreases the number of changes in the LSB coefficients of the cover image, and consequently, it raises the security level of the steganography scheme. is method hides n bits within 2 n − 1 coefficients. erefore, increasing the value of n needs more coefficients and consequently decreases the capacity of the steganography. us, in most of the real applications, we let n � 3 to prevent declining capacity.
For n � 2, there are three coefficients in the F5 algorithm while the LSB MR needs only two coefficients. In other words, the capacity in LSB MR increases by 50% more than F5. us, using the LSB MR method for n > 2 helps us to increase the security level of the steganography.
is is because we can hide a message with fewer changes in the cover image.
In this paper, we propose a novel mapping function to generate 2 n states with only one change (additive or subtraction). is helps us to hide n bits in 2 n− 1 coefficients only by one change. In this paper, for n � 3 (three bits of the secret message), four coefficients and choosing a suitable function, 8 different states can be obtained by modifying, increasing, or decreasing, the values of the coefficients. In general, the number of 2 n states can be obtained for the number of 2 n− 1 coefficients.
Considering function f(x i , x i+1 ) � LSB(⌊x i /2⌋ + x i+1 ) generates 7 states for three coefficients. is function was proposed in LSB MR and we aim to employ this function to generate 2 n states for 2 n− 1 coefficients. In the first step, we employ this function to generate 7 states for 3 coefficients. For three coefficients and using add and subtraction over the least bit of each coefficient, we obtain the following function: For example, for coefficient values (8,14,21), we obtain three values x i � 8, x i+1 � 14, x i+2 � 21. Now, by manipulating one bit in the coefficients, we obtain 7 different values (shown in Table 1). As one can see in Table 1, the secret message with value of 2 is not generated for any coefficient changes. is is because of the fact that there are at most 7 states for a message with three bits. It is to be noted that one state must be excluded according to the coefficients' values.
As one can see in Table 1, the function leads to a change in one bit of the message due to the change in a coefficient, while another bit of the message stays steady for the same operation of the coefficient and changes for another operation of the same coefficient.
For example, the first bit of the message (MSB) is changed for manipulating the first coefficient, and the third bit of the message (LSB) is only changed for decreasing the coefficient while there is no change in the bit for increasing the coefficient.
is generates two new states. us, by defining a suitable function, we can generate two new states for the change in each coefficient. More specifically, we can generate 6 new states for three coefficients and 8 new states for four coefficients.
It is to be noted that these 7 states cannot hide three bits. is is because it is needed to generate 8 states for hiding three bits with only one change in the coefficients. We can hide three bits in four coefficients as it can generate 9 states by only one change in each coefficient. us, we can embed 8 different states of a three-bit secret message using an appropriate mapping function. e significant point in these states is that changing only one coefficient leads to generating such states. In other words, there is no need to change more than one coefficient for having such a number of states. To this end, we first investigate the various states of the message. Assume that using the proposed function and without any change in the message, a three-bit message is generated. Such a message in bitstream format is in the range of 000-111. We aim to generate the appropriate message by changing only one of the coefficients. To generate a new message, we must change the bitstream value of the initial message from one to three. We divide such changes into categories containing two items to simulate the changes using the proposed function. In these categories, only one bit must be different. For example, for a three-bit message, we categorize the various states of the message as shown in Table 2. As one can see in this table, there are eight states for this example. For a three-bit secret message, we have four categories, for example, the first category contains 000 and 001, the second category contains 010 and 011, the third category contains 100 and 101, and the forth category contains 110 and 111. As one can see, the two messages inside of each category are distinguished at only one bit.
It is possible to design the proposed function using Table 2. ere are three states for each category in this table. Each bit in the new message compared to the initial message is either constant, changed, or constant for a state and changed for another state. In the case of constant, there is no need for any coefficient in the function. In the case of changed, there is one coefficient in the function, and for the third case we consider ⌊coefficient/2⌋ in the function.
For example, in order to achieve the first category, we propose function f(x i , x i+1 , x i+2 , x i+3 ) � LSB(⌊x i /2⌋) that shows the first bit of the message. us, if the coefficient x i is even, increasing the coefficient remains the message constant, while decreasing the coefficient changes the message. In the case of an odd coefficient, we have a reverse situation. For example, if x i � 2, both increasing and keeping the coefficient constant set the first bit of the message to one, while decreasing such coefficient sets the first bit of the message to zero. So, by changing the coefficient with one value and keeping the coefficient constant, we can obtain a message in the first category.
For achieving a message in the second category, we propose equation (7) that shows the first and second bits of the message. us, by changing this coefficient, the second bit is changed and the first bit is changed in a state and remains constant for another state.
Moreover, to obtain a message in the third category, we propose equation (8) that shows the first three bits of the message. us, by changing this coefficient, the third bit is changed and the first bit is changed in a state and remains constant for another state.
Moreover, to obtain a message in the fourth category, we propose equation (9) that shows the first three bits of the message. us, by changing this coefficient, the second and third bits are changed and the first bit (MSB) is changed in a state and remains constant for another state. e following example provides more details about the proposed approach.
For example, for numbers (8,14,21,29) we obtain values x i � 8, x i+1 � 14, x i+2 � 21, and x i+3 � 29. Clearly, we can generate different values by increasing/decreasing each of these coefficients. Table 3 shows these different values. is table shows that for n � 3 (a numerical message in the range of [0, 7] ) and four coefficients, we need only one change in the coefficient to generate the message. us, by using the proposed mapping function, we can hide the secret message only by one change. It is to be noted that Table 3 shows 9 numbers for 9 different states in which one of the numbers is replicated.
For the n-bit message, we have to categorize the various states of the message like Table 2. en, we have to propose a function similar to n � 3.
Our proposed mapping function is inspired by LSB MR while it can embed n bits into 2 n− 1 coefficients. Moreover, the proposed function needs fewer changes compared to LSB MR when n > 2. Also, the capacity of the proposed function is 75% higher than the F5 method for n � 3 and that is over 75% higher than the F5 method for n > 3. Now we leverage our mapping function to propose an image steganography scheme. e proposed scheme contains two phases including embedding messages and extracting the message. We explain these two phases in more detail in the next sections. Embedding message and extracting the message perform for n � 3 (a numerical message in the range of [0, 7] ) and four coefficients. For the n-bit message (n > 3), we have to propose the function similar to n � 3 and embedding message and extracting the message perform similar to n � 3.

Embedding Phase.
e main steps in the embedding phase of our steganography approach are shown in Figure 2. In the embedding phase, we perform the following steps: (i) We first convert the secret message into binary and thus we obtain a bitstream as the result of this step. (ii) We divide the obtained bitstream into a set of groups with three bits in each group. To this end, from the least significant bit, we group every three continuous bits in a group. (iii) In this step, a set of pixels from the cover image is selected based on the key to embedding the secret message. It is to be noted that the number of pixels selected in this step is 1.33× length of the secret message. is is because every three bits in the secret message are hidden into four pixels of the cover image. (iv) Now we generate Table 3 for every four coefficients.
Note that by only one change in each coefficient we have a number in the range of [0, 7]. (v) Based on the bits in the secret message, we choose the operations needed to generate such a message.   (vi) Now we perform the obtained operations over the coefficients to hide the secret message.

Extracting
Phase. e main steps in the extracting phase of our steganography approach are shown in Figure 3.
In the extracting phase, we only need to perform the mapping function over each group of four coefficients from the received image. As a result, we obtain a secret message. For example, for coefficients x i � 8, x i+1 � 14, x i+2 � 20 , and x i+3 � 29 we obtain the secret message m � 111.
In the extracting phase, we perform the following steps: (i) We first extract pixels of the cover image based on the key in the embedding phase (ii) We divide the pixels into a set of groups with four pixels in each group (iii) We extract a secret message according to the four pixels and equation (9) for each group (iv) We add the secret messages to each other and thus we obtain a bit-stream of secret messages as the result of this step

Experiments
In this section, we evaluate the performance of our approach.

Experimental Environment.
We evaluate our method using several public datasets. We also measure the performance of our approach based on PSNR, MSE, capacity, and SSIM metrics. We also provide a comprehensive steganalysis to study the detection of hidden messages in our steganography scheme. All the experiments were conducted on a PC with 2.00 GHz Intel Core 2 Duo processor and 8 GB RAM running Windows 10. e program code was written in Matlab 2018a.

Evaluation Metrics.
To evaluate the performance of the stego image, we employed two metrics related to the quality of the image: Mean Square Error (MSE) and Peak Signal-to-Noise Ratio (PSNR). e MSE metric indicates the pixel-by-pixel difference between the cover image and stego image, which is calculated as follows: where C(i, j) and S(i, j) are the illumination severities in the cover image and stego image, respectively. Moreover, M and N are the dimensions of the cover image and the stego image, respectively. e lower value of MSE means less difference between the two images. Moreover, lower MSE indicates a higher quality of the stego image, higher transparency, and security. Another metrics for evaluating the stego image is PSNR, defined as follows: P � max(C(i, j), S(i, j)).
A larger value of PSNR indicates that the steganography scheme highly protects the quality of the image.
Another performance measurement is capacity. Capacity is the amount of data that can be hidden within the cover Selecting four pixels of the cover image based on the key to embedding the secret message Generating Table 3 for every four pixels Changing the pixels according to the secret message and Table 3 Hiding each group of secret message, respectively

Divide into a set of groups with four pixels in each group
Extracting secret message according to the four pixels and equation (9) Extracting secret message for each group image, which shows that the max message size can be inserted into an image and is calculated as follows [47]: Capacity � Total number of bits embedded into image Total number of pixels . (13)

PSNR and Capacity Analysis.
In this section, we evaluate the performance of the proposed scheme over three popular images in steganography including Cameraman, Coins, and Football as the secret message. Using such images generates a very large secret message for our scheme. is helps us to employ the whole capacity of the steganography scheme and fairly evaluates the capacity of the steganography scheme. e secret message is hidden within six images as the cover images including Lenna, peppers, Baboon, Autumn, Kids, and Office. For example, we embedded the Cameraman image within the Lenna image. Figure 4 shows these two images before and after steganography.
To evaluate the effectiveness, we measure the MSE and PSNR for our approach and four other recent approaches: LSBR, Inverted LSB [2] (called ILSB), LSB MR [43] (called LSB MR), and F5 [16]. Note that the F5 scheme is in the frequency domain while our proposed approach is in the spatial domain. In order to fairly compare our approach against F5, we need a synchronization phase. us, we converted the hamming coding used in F5 into the spatial domain and we then compare two schemes. It is to be noted that using the Hamming coding into the spatial domain increases the capacity of the steganography approach. is confirms that our comparative evaluation of the capacity of two schemes is fair. Table 4 reports PSNR of Advanced LSB MR and other four approaches to the mentioned images. Figures 5-7 show the PSNR values for different capacity values of Advanced LSB MR and four other approaches. As one can see in the results, our approach outperforms other schemes for PSNR. Consequently, Advanced LSB MR provides a higher level of confidentiality. Moreover, the PSNR for ILSB is higher than the basic LSB model (LSBR). is is because the ILSB reverses only the least significant bit for a group of pixels based on a predefined priority. is applied fewer changes in the cover image compared to the LSBR model. e results in Table 4 show that the LSB MR presents higher PSNR compared to both LSBR and ILSB. is is due to the fact that the LSB MR embeds every two bits of the secret message by changing the maximum one pixel of the cover image. Note that the capacities for all three methods LSBR, LSB MR, and ILSB are identical.
In the image steganography based on Hamming coding, such as F5, we can consider various values for the number of bits in the secret message (value of n ). In our experiments, we first set n � 3 and observed that none of the secret images fit in the cover image. However, for n � 2, we observed that all three secret images could fit within the cover images.
us, Table 4 reports only the results of experiments for n � 2 for the F5 scheme where every two bits of the secret message is embedded within three pixels of the cover image with maximum one change in each pixel. us, the number of changes in F5 is less than both LSBR and ILSB while it is very close to the number of changes in LSB MR. Similarly, F5 presents higher PSNR compared to both LSBR and ILSB, and its PSNR is slightly close to PSNR in LSB MR. It is also to be noted that F5 needs three pixels of the cover image to hide two bits of the secret message, while the other three schemes (LSBR, ILSB, and LSB MR) need only three pixels to hide two bits. is fact makes the capacity of F5 around 33% less than the capacity of the other three schemes. Such a decrease in capacity is obtained from the following equation: where C H is capacity of the steganography scheme based on hamming coding, C C indicates the capacity of the other steganography schemes (LSBR, ILSB, and LSB MR), and RCChtoCc is the change ratio of capacity of the steganography scheme based on hamming coding to the other steganography schemes. e results presented in Table 4 show that the increase in PSNR leads to a decrease in the capacity of a steganography scheme. In steganography, security is a significant metric. Since there is a considerable difference between the PSNR in F5 and two other schemes, LSBR and ILSB, the difference between their capacities is negligible. On the other side, F5 and LSB MR present approximately similar PSNR and we can similarly rank the performance of these two schemes.
For n � 3, in the proposed scheme, we embed three bits of the secret message into four pixels of the cover image with the maximum of one change in each pixel. us, the number of changes needed in our proposed method (and consequently PSNR) is considerably less than the other four schemes. It is to be reminded that the other three schemes including, LSBR, ILSB, and LSB MR, need four pixels for embedding four bits. erefore, the capacity of the proposed method is 25% less than these three schemes. Such a decrease in capacity is obtained from the following equation: where NC proposed,4 and NC LSBMR,4 indicate the number of changes for the proposed method and LSB MR in four pixels, respectively. Also, C P is the capacity of the proposed scheme, C C indicates the capacity of the other three steganography schemes, and RCCptoCc is the change ratio of capacity of the proposed scheme to the other steganography schemes. One can also see in Table 4 that our scheme provides higher capacity and PSNR compared to F5. e capacity of our scheme for n � 3 is 12.5% higher than the capacity of F5 for n � 2. Such a difference between the capacity of our scheme and F5 is obtained from the following equation: Security and Communication Networks 9 where NC proposed,12 and NC F5,12 indicate the number of changes for the proposed method and F5 in 12 pixels, respectively. Also, C P is the capacity of the proposed scheme for n � 3, and C H indicates the capacity of the F5 scheme for n � 2, and RCCptoCh is the change ratio of capacity of the proposed scheme to the steganography scheme based on hamming coding. For n � 3, our scheme provides a higher capacity compared to F5. e capacity of our scheme is 75% higher than the capacity of F5. Such a difference between the capacity of our scheme and F5 is obtained from the following equation: where C P is the capacity of the proposed scheme for n � 3 and C H indicates the capacity of the F5 scheme for n � 3. For n > 2, the capacity of the proposed scheme is (((2 n − 1)/2 n− 1 ) − 1) × 100% higher than the F5 method. Such a difference between the capacity of our scheme and F5 is obtained from the following equation:

SSIM Analysis.
In this experiment, we aim to evaluate our approach based on the structural index similarity (SSIM) metric, which is a tool used to measure image quality [49]. Especially in the image steganography, SSIM and PSNR are used to measure the quality of imperceptibility. SSIM is designed based on brightness, contrast, and structure to      better suit the performance of the human visual system [49]. SSIM can be defined as follows: where μ x and μ y are the sample standard deviations of x and y, respectively; μ xy is the sample correlation coefficient between x and y; and μ x and μ y are the sample means of x and y, respectively. e constants C 1 and C 2 are used to stabilize the algorithm when the denominators approach to zero. ese statistics are calculated within a local window. Table 5 reports SSIM of Advanced LSB MR and other three approaches to the mentioned images. e results show that Advanced LSB MR presents higher SSIM compared to LSBR, ILSB, and LSB MR. is is due to the fact that the Advanced LSB MR embeds every three bits of the secret message by changing the maximum of one pixel of the cover image. For n � 3, the capacity of the proposed method is 25% less than these three schemes.

Steganalysis.
Steganalysis is the study of detecting messages hidden using steganography. In this section, we perform security analysis to show the resistance of the proposed work against steganalysis. e proposed method is a new method of coding for steganography and can be used in the embedding step of every method of steganography to  reduce the change in the stego image. erefore, to evaluate the performance of the Advanced LSB MR, we used Advanced LSB MR in the embedding step of HILL [50] and S-UNIWARD [51] for two payloads of 0.2 and 0.4 bpp (bits per pixel), respectively. We use the Advanced LSB MR with n � 3 (bits of the secret message) for embedding secret messages in coefficients selected by each steganography method. Also, SRNet [52] is used for steganalysis. e S-UNIWARD method can be applied for embedding in an arbitrary domain. e embedding distortion is computed as a sum of relative changes of coefficients in a directional filter bank decomposition of the cover image. e directionality forces the embedding changes to such parts of the cover object such as textures or noisy regions while avoiding clean edges or smooth regions [51].
e HILL method presents a cost function for spatial image steganography. e cost function is designed by using a highpass filter to locate the less predictable parts in an image, and then using two low-pass filters to make the low-cost values more clustered [50].
e SRNet method is a deep residual architecture designed to minimize the use of heuristics and externally enforced elements.
is method provides state-of-the-art detection accuracy for both spatial-domain and JPEG steganography. We used BOSSbase 1.01 database [53] to evaluate the results of the proposed method. e specifications of the BOSSbase images are as follows: (i) e resolution of these images is 512 × 512 (ii) Images are taken by eight different cameras (iii) ese images are uncompressed (iv) e number of the image is 10000 (v) e image format is PGM (vi) e images have different properties regarding textures and smooth areas Some samples of images of the BOSSbase database are shown in Figure 8. e database is randomly split into two batches of 5000 images. e 5000 images have been used for SRNet training and the 1000 images have been used randomly for testing. e detector accuracy was reported using the minimal total detection error on the testing set under equal prior M E � min M FA (1/2)(M FA + M MD ), where M MD and M FA are the missed-detection and false-alarm probabilities. e detection error M E for HILL [50] and S-UNIWARD [51] with and without Advanced LSB MR for two payloads is shown in Table 6.
As one can see in Table 6, the detection error for SRNet for different payloads using Advanced LSB MR in the embedding step of HILL and S-UNIWARD is increased in both steganography techniques. erefore, Advanced LSB MR can be used in the embedding step of every method of steganography to reduce the change in the stego image. e ROC curve is a graph of the true-positive rate to the false-positive rate. e ROC curve for a complete detector reaches a point at FPR � 0 and TPR � 1. ROC curves, independent of their decision thresholds, allow a reliable evaluation of steganalysis detectors [54]. In this paper, the ROC curves are shown the false-alarm rates for stego-image detection probability M D � 1 − M MD � 0.5 and 0.3. Figure 9 shows four ROC curves including SRNet for S-UNIWARD, S-UNI with Advanced LSB MR, HILL and HILL with Advanced LSB MR for payload 0.4, and the false alarm rates M FA for two test powers. For the payload 0.4 bpp, M D � 1 − M M D � 0.5 can be achieved with M FA � 6 × 10 − 4 for S-UNIWARD, 14.8 × 10 − 3 for S-UNI with Advanced LSB MR, 4.2 × 10 − 3 for HILL and 32.5 × 10 − 3 for HILL with Advanced LSB MR (see Table 7).
As shown in Figure 9, the area below the ROC curve for SRNet using Advanced LSB MR in the embedding step of HILL and S-UNIWARD is decreased in both steganography    techniques. erefore, the change in the stego image has been decreased by Advanced LSB MR and the detection error for SRNet has been increased.

Conclusions
In this paper, we proposed a novel and LSB-based approach for image steganography. In the embedding phase of our steganography scheme, we first divide the secret message into groups of n bit, and then we choose 2 n− 1 pixels of the input image to hide each of these groups. Our experiment results show that our proposed scheme needs fewer changes compared to the basic LSB method. Moreover, the capacity of the proposed method is (((2 n − 1)/2 n− 1 ) − 1) × 100% higher than the F5 approach. Also, our scheme provides a high PSNR value of hiding secret message bits in the image compared to the state of the art in the image steganography community, which decreases the chance of detecting the secret message from the stego image. e coding methods can be used in the first step of each steganography method to reduce the change in the stego image. e proposed method is a new method of coding for steganography and this method can be used in the first step of every method of steganography. For future work, we plan to apply our idea for providing a video, audio, and text steganography scheme. For example, three bits of the secret message is hidden in four coefficients with only one change.
e coefficients can be Spatial Domain and Transform Domain (DCT, DWT, or others depending on the steganography method). ey can also be further upgraded by examining other coding methods and their disadvantages.

Data Availability
No data were used to support this study Disclosure is article does not contain any studies with human participants or animals performed by any of the authors.

Conflicts of Interest
e authors declare that they have no conflicts of interest.