1 Introduction

Steganography is an art of sending a secrete message under the camouflage of a carrier content. The goal of steganography is to mask the very presence of communication, making the true message not discernible to the observer [5]. On the other hand, steganalysis is the science of revealing the existence of secret messages in a media. The carrier image in steganography is called the “cover image” and the image which has the embedded data is called the “stego image”.

Steganography in LSB is the simplest of methods where data is first compressed and encrypted and then embedded in the LSB of the cover image pixels. LSB embedding can be performed by either LSB flipping (LSB-F) or by LSB matching (LSB-M). In LSB-F technique a data bit replaces the LSB of an image pixel which at most causes a change in the least significant bit of an image. But in the LSB-M method which is first proposed by Sharp, the LSBs are not simply replaced; instead the whole pixel is randomly incremented or decremented if the LSBs differ from data.

Since LSB-M steganography does not create the pair of value (POV) effect it is immune against all attacks that are intended for LSB-F embedding. A number of steganalysis methods are designed for LSB-M and have been successful to some extend but none has been completely effective [16]. In recent years some efforts have been directed toward improving LSB-M which has made it more difficult for the attackers to detect the embedding. In Section 2 of the paper improved versions of LSB-M are discussed and some successful attacks for these methods are reviewed. In LSB-F and LSB-M embedding is the same for all of the pixels of an image. Human vision system (HVS) is sensitive to the changes in the contrasts of an image. Furthermore, HVS is more sensitive toward changes that occur in smooth regions as compared to complex regions with abundance of edges [2]. This means that more data can be embedded in complex regions without creating any suspicion.

A steganographic method using side information is presented in [3] which is called Side Match method. In this method in order to estimate the degree of smoothness or contrast of pixels, correlations among neighboring pixels are calculated. The difference of a pixel with the average of two, three or four of its neighbors is calculated which provides the pixel capacity. The secret message is embedded in the difference value. In [4], Chen et al. proposed a modification to the Side Match method. The advantage of the Chen’s method is the increase of the embedding capacity with little degradation in the image quality.

In 2004, Maniccam proposed an information hiding scheme, which begins by taking a pixel to find out its embedding capacity by examining eight of its neighboring pixels. Not all of the pixels of the image are examined in this scheme and LSB-F is used for the embedding part [14].

In [11], Lu et al. proposed a method, in which a cover image is quantized to generate extra spaces for hiding secret messages. The cover image is divided into a number of non-overlapped 3 × 3 blocks. This scheme applies the complexity analysis of neighboring pixels to find out the number of secret message bits that can be embedded in pixels of a block.

The method of Wu et al. in [20] is based on Pixel Value Differencing (PVD). They divide the cover image into a number of non-overlapping two-pixel blocks. A large difference between these two pixels indicates that the block is in an edged area and more data can be embedded in it. Hence, PVD is an adaptive method and a number of methods are proposed based on it. In these methods, the secret message is embedded by using of LSB-F and PVD. Sabeti et al. successfully attacked some versions of PVD [17, 18].

In adaptive methods images that are more complex and contain more edges have higher embedding capacities as compared to images with more smooth regions. Since the stego image is not identical to the cover image, a big hurdle in adaptive methods is to identify embedded regions in the stego image at the time of the extraction of data. This means that a pixel may be identified as suitable in the embedding process and the embedding may cause it to change. Then, the changed version of it may be identified as non-edge and hence the extraction process fails to recover data from that pixel. To circumvent this problem, the stego image is tried to have as little change in it as possible. To achieve this, adaptive methods usually employ LSB-F as opposed to LSB-M. Only the algorithm proposed in [13, 21] uses LSB-M for embedding while they only use two neighboring pixels to identify a complex region. These identified edges that are based on only two pixels are not very reliable.

Reliable and accurate identification of a complex region can play an important role in an adaptive method. To achieve this accuracy an appropriate neighborhood of the pixel should be looked at. In some adaptive algorithms fixed blocks (such as 3 × 3) are used but not all of the pixels of an image are analyzed and hence not all of the pixels are candidates for embedding [11, 14]. These methods suffer from lack of appropriate capacity. In some other methods, a combination of the neighboring pixels such as top, bottom, left, or right pixels are used to distinguish a smooth region from a complex one [3, 4].

In this paper an algorithm is presented which intends to alleviate the shortcomings of other methods. Our main goal is to improve the security as compared with comparable adaptive methods. We call this method as Complexity Based LSB-M (CBL) algorithm. Firstly, the proposed CBL method uses an 8-neighborhood of a pixel to identify suitable complex regions of an image for embedding purposes. This means that regional complexities can be analyzed more realistically than methods that only use two adjacent pixels. Secondly, these 3 × 3 blocks are overlapped so that all of the pixels are studied which increases the capacity of the algorithm compared to comparable adaptive algorithms. Thirdly, unlike many other adaptive algorithms, LSB-M is used for the embedding process, which has higher security than LSB-F. Provisions are put in place to make sure that when a pixel is identified as complex in the embedding process, the extraction process can correctly identify that pixel and hence, the correct data is extracted.

The paper is organized such that in Section 2 a number of LSB-M based algorithms and some successful attacks for them are presented. The proposed algorithm is presented in Section 3. Implementation results of the algorithm and the results from steganalysis of the method are discussed in Section 4. Concluding remarks and suggestions for the continuation of the work are in Section 5 of the paper.

2 Related works

Since the proposed method is based on LSB-M, in this section we go over some steganography methods that try to improve LSB-M.

In the LSB matching, when the value of a pixel is to changed it is randomly either increased or decreased. In [15], pixels are modified such that the outcome of the binary function is equal to the desired data value. The pair of pixels performs as a unit, where the LSB of one pixel carries one bit of information, and the binary function contains the other bit of information. This method allows embedding of the same payload as LSB matching but with fewer changes to the cover image. It shows a better security than LSB matching.

Li et al., in [10], proposed a generalized LSB matching (G-LSB-M) scheme by generalization of the method in [15] and LSB matching. Liu et al., in [12], proposed a content-adaptive scheme which they claimed to have better security as compared with LSB-M and G-LSB-M. In their method, if the secret message bit does not match the LSB of the corresponding cover pixel value, the choice of modification direction is not random and is tried to have the best correlation with the neighboring pixels.

In 2010, Luo et al. proposed an algorithm which is called ALSBMR [13]. This is one of the rare adaptive methods which uses LSB-M for the embedding process. Luo et al. use a combination of the idea of LSB-M, known as LSB-M revisited [15], and the idea of adaptive embedding. It chooses pairs of pixel to determine the complex regions of the image, suitable for embedding.

To show the security of our algorithm we used five steganalysis attacks which we briefly explain in the followings. One of the detectors for LSB-M in the literature belongs to Harmsen et al. [7]. This method relies on the fact that LSB-M tends to smooth out the histogram of an image. This causes a shift of the center of mass of the histogram’s spectrum toward the origin. To address this shift of center of mass in the histogram’s spectrum, Ker [9] proposed two methods of applying the histogram characteristic function (HCF). These methods are based on (1) calibrating the output through the use of a downsampled image, and (2) obtaining the adjacency histogram instead of the usual intensity histogram. Hence, major improvements in detection of LSB-M in grayscale images became possible. We refer to these two methods as Ker1 and Ker2.

In [6], Goljan et al. proposed a blind steganalysis technique which estimates the stego noise through denoising of the detail bands of a first order wavelet decomposition of an image. Hence, this method is referred to as Wavelet Absolute Moment (WAM) steganalysis. They use a feature vector consisting of 27 moments (9 per band).

Zhang et al. [22] presented a scheme to work on the local extrema of the histogram. The filtering operation can reduce the amplitude of local extrema. Cancelli et al. [1] extended this strategy by analyzing four 2D adjacency histograms In addition to the other mentioned features, these adjacency histograms result in a 10-dimensional feature vector. We refer to this attack as Amplitude of Local Extrema (ALE) method. In [8], Huang et al. suggested a method for detection of the LSB-M stegonagraphy when applied to uncompressed gray scale images. An image is formed by combining the least two significant bit-planes and partitioning it into 3 × 3 overlapped blocks. The blocks are categorized into four types based on their number of gray levels. Through embedding a random sequence by LSB matching and then computing the alteration rate of the number of elements in group 1, it is claimed that normally the alteration rate is larger in the cover image than in the stego image. We refer to this attack as CNGL.

3 Proposed method

In this section we present a general description and definitions used in an adaptive steganography method, which embeds data in spatial domain based on the complexity features of an image. Then based on the presented definitions we explain the proposed CBL steganography method.

Let us assume that an m × n cover image is described as a set I, consisting of elements I(i, j) such that

$$ I = \left\{ {I(i,j)\left| {1 \leqslant i \leqslant m,1 \leqslant j \leqslant n} \right.} \right\} $$
(1)

The secrete data (message) consists of elements d(k) and when embedded in the cover image will generate the stego image S with S(i, j) as its elements as described in Eqs. 2 and 3.

$$ Data = \left\{ {d(k)|1 \leqslant k \leqslant w} \right\} $$
(2)
$$ S = \left\{ {S(i,j)|1 \leqslant i \leqslant m,1 \leqslant j \leqslant n} \right\} $$
(3)

The cover image could be colored, grayscale, or black and white. It is assumed that the length (number of data elements) of the message is w. In adaptive embedding methods it is possible that some of the pixels are not embedded in and they are only used to determine that capacity of other pixels. In another words, \( I = \left[ {I\prime, I\prime {\prime} } \right] \), where data set \( I\prime \) consists of the used pixels and data set \( I\prime {\prime} \) is the set of the reference pixels. Embedding is only performed on the \( I\prime \) pixels and only after the capacity of each member pixel is determined. The capacity depends on the local complexity of that pixel which in turn is a function of the value of that pixel and those of some of its neighboring pixels. Hence, the complexity of a pixel I(i, j) is defined as:

$$ complexity\left( {I(i,j)} \right) = f(I(i,j),N(i,j)),\quad \forall I(i,j) \in I\prime $$
(4)

where N(i, j) is a set of some of the neighboring pixels:

$$ N(i,j) = \left\{ {I(i + u,j + v)|u \subset [ - m,m],v \subset [ - n,n]} \right\} $$
(5)

Then the capacity, C(I(i, j)), for a pixel I(i, j) can be a function of the complexity of that pixel.

$$ C\left( {I(i,j)} \right) = f\prime (complexity(I(i,j))) $$
(6)

In many of the existing adaptive methods, to determine the capacity of a pixel a set of threshold values are used. When the capacity of a pixel is determined as c = C(I(i, j)), then data elements \( D = \left\{ {d(q), d(q + 1), \ldots, d(q + c - 1) } \right\} \) are embedded in that pixel. Hence, the embedding function Emb (.) applies to each member of \( I\prime \) using the local complexity of each member pixel. The embedding procedure produces stego pixels, S(i, j).

$$ S(i,j) = Emb\left( {I(i,j){ },D} \right) $$
(7)

Different adaptive algorithms present different embedding functions. For every embedding function there should exist an extraction function, Ext(.), where the initial embedded data is recovered from the stego image:

$$ D = Ext\left( {S(i,j)} \right) $$
(8)

Now we explain the proposed algorithm. Basic steps of the embedding algorithm are shown in Fig. 1.

Fig. 1
figure 1

Steps of embedding procedure

In the LSB-M embedding algorithm all of the pixels have the same priority for embedding and the only means of knowing which pixel is embedded in is the key that is shared between the sender and receiver of the image. No means of prioritization of pixels are employed.

To identify smoothness of a region in an image we need to define a criterion. In the followings we refer to complexity as a criterion. For embedding based on complexity we need to measure the complexity of each pixel. Embedding is only performed for pixels that posses complexity value which is higher than a certain threshold. An important point is that the receiver side should be able to accurately identify the pixels that are embedded in. Any inaccuracy in the extraction phase could result in the loss of the entire data which is usually compressed and encrypted prior to the embedding process.

In following subsections details of each part of the algorithm and the extraction procedure are explained.

3.1 Variable initialization

It is necessary to initialize a number of variables at the beginning of the process. A pseudo random number generator (PRNG) is to be used at different stages of the algorithm. Hence, a seed is to be selected and shared between the sender and receiver. Let I indicate the cover image which has m lines and n columns. A copy of this image is saved as O. Also, let I(i, j) indicate a pixel at row i and column j of image I. The following are performed at the initialization step:

$$ \begin{gathered} set\;PRNG\;seed; \hfill \\ I \leftarrow cover\;image; \hfill \\ O \leftarrow copy\;of\;cover\;image; \hfill \\ \left[ {m,n} \right] \leftarrow dimensions\;of\;cover\;image; \hfill \\ \end{gathered} $$

3.2 Secondary image formation

In this step a secondary image is formed by modifying the initial cover image I. This image will be used for computation of the complexity values of pixels. The goal is that the receiver can replicate this process and come up with the same set of complexity values. The secondary image pixels are forced to have zero at their LSBs. This is performed by the following routine.

figure c

3.3 Pixel complexity computation

As was mentioned at the beginning of Section 3, some adaptive methods consider an image as \( I = \left[ {I\prime, I\prime {\prime} } \right] \), where only the \( I\prime \) pixels are embedded in. In our proposed algorithm all of the image pixels are potentially candidates for embedding. In another words, in our method \( I = \left[ {I\prime } \right] \). Hence, for every pixel I(i, j) a variable complexity (i, j) is computed. The value of this variable shows the type of region that the pixel belongs to. One can come up with different means of defining this complexity criterion. What we suggest is to use the sum of absolute values of differences of the pixel with its neighbors. Different types of neighborhoods can be defined. But the correlation between the value of a pixel and its neighboring pixels is reduced as the distance between them increases. Hence, the use of 8-neighbor seems to give a good sense of the type of region that the pixel is residing in. We therefore refer to the mentioned complexity measure as octonary. Figure 2 shows the neighborhood for pixel I (i, j).

Fig. 2
figure 2

Pixel I (i, j) and its 8-neighborhood

Equation 9 shows how complexity (i, j) is computed:

$$ complexity\left( {i,j} \right) = \mathop{\sum }\limits_{{u = - 1}}^1 \mathop{\sum }\limits_{{v = - 1}}^1 \left| {I\left( {i,j} \right) - I\left( {i + u,j + v} \right)} \right| $$
(9)

Based on the above definition of complexity, we see that the higher value of complexity (i, j) means that pixel I(i, j) is in a location where large fluctuations in the intensities of pixels are experienced. Similarly, lower values of complexity indicate smooth regions. Hence larger values of complexity (i, j) identify the pixel as appropriate for embedding purpose. For further illustration three example images of Lena, Peppers, and Baboon are shown in Fig. 3. Also shown in this figure are corresponding images of the octonary complexity measures. For illustration purposes complexity values are scaled. We see that smooth regions have smaller complexity values and are illustrated by dark pixels in Fig. 3d, e and f.

Fig. 3
figure 3

Test images and their corresponding octonary complexity values of a,d) Lena, b,e) Peppers, c,f) Baboon

3.4 Threshold computation

The complexity value of a pixel alone cannot identify a pixel as belonging to a smooth area or otherwise. Complexity by itself is a relative criterion and requires a threshold value to be compared with. The result of this comparison can then be used to categorize the pixel as belonging to an edge or smooth area.

To come up with a suitable threshold we need to know the fraction of the capacity of the image that is going to be embedded. This is done by knowing the number of bits in the secrete message and the number of pixels of the image. If p percent of the pixels are to be embedded then an appropriate threshold T can be computed. The value of T is chosen such that at least p percent of the pixels are labeled as complex and are embedded with data. Equation 10 shows how T is computed.

$$ T = max\left\{ {{t_0}\left| {} \right|\left\{ {\left( {i,j} \right)|complexity(i,j) \geqslant {t_0}} \right\}| \geqslant (p * m * n/100)} \right\}\quad 0 \leqslant p \leqslant 100 $$
(10)

While the value of T is dependent on p it is mainly an attribute of the image textures and pattern. For a given p different T values may be produced by different images. This is illustrated in Table 1 where three images of Fig. 3 are tested with p values of 30, 50, and 80. We see that threshold values vary in the range of 18 to 182 for these specific images. Lena image has more smooth regions as compared to the Baboon image. That is why threshold values in Baboon is much higher than those of Lena.

Table 1 Threshold values for different embedding rates and different images

3.5 Embedding

After the appropriate pixels are labeled, the embedding process is performed in those pixels. The following shows the embedding procedure, where d is the string of message bits:

figure d

It should be noted that the same PRNG is used with the same seed as was used in the I image formation. This procedure guarantees that the value of each pixel, which has a complexity value lower than T, is replaced by its corresponding value in the O image. This means that those pixels that are not embedded in are not changed at all. This reduces any unnecessary changes in the image.

The value of those pixels that have complexity values larger than T must be changed such that their LSB values correspond to the message bits. Since the LSB of all pixels of image I were changed to zero, if the intended embedding bit is zero there is no need to change that pixel. But if the message bit is 1 then the pixel value has to be either increased or decreased. If a pixel originally had an LSB of 1 is being embedded with a 1 then the original pixel value is produced in this embedding procedure.

3.6 Extraction procedure

Extraction procedure at the receiver should be performed so that the exact embedded data string is obtained. Based on basic ideas of steganography, the receiver has no access to the cover image. Hence, the extraction procedure, just by knowing the T value, should be able to correctly identify the complex pixels and obtain the message. Once the complex pixels are identified the extraction process is the same as the LSB matching algorithm. This means that the LSB of the complex pixels will comprise the embedded data.

The receiver should implement the same four steps that are performed in the transmitter to correctly identify the embedded pixels. The only difference is that the transmitter performed these four steps on the cover image and the receiver implements these steps on the stego image. The required steps for the extraction process are shown in Fig. 4.

Fig. 4
figure 4

Steps for extraction procedure

The following pseudo code illustrates the detail of the extraction procedure.

figure e

4 Implementation results

Since CBL is an adaptive algorithm it is expected that most of data is embedded in edges. To illustrate this phenomenon, we can produce the difference between the cover and the stego images. In Fig. 5 the difference images for three embedding rates of 0.2 bpp, 0.3 bpp and 0.5 bpp are shown for Lena cover image. White spots in difference images are pixels where the embedding was performed. As the embedding rate is increased more edges are pronounced in the difference image.

Fig. 5
figure 5

Difference images with embedding rate of a) 0.2 bpp, b) 0.3 bpp, c) 0.4 bpp

4.1 CBL versus adaptive LSB-F based methods

For an adaptive algorithm such as the suggested CBL, it seems that it should be compared with some of the existing adaptive algorithms. But there is no specific steganalysis method for these adaptive methods. Hence, we use the stego image quality based on PSNR as the means of comparing our algorithm with some of the adaptive algorithms. Three 512 × 512-pixel standard images of Lena, Baboon, and Peppers, as shown in Fig. 3, are used to compare CBL with other algorithms in terms of PSNR.

Three other adaptive algorithms that are compared with our CBL are Maniccam [14], Side Match [3], and PVD [20]. Each algorithm is used to embed three different data rates of 0.3 bpp, 0.5 bpp, and 0.8 bpp. Table 1 compares PSNR values of the stego image as compared with the cover image for the four comparing algorithms. Since Maniccam was not able to embed at 0.5 and 0.8 bpp we left the corresponding PSNR values in Table 2 as blank. It is noticed that our CBL algorithm in all of the images and all of the embedding rates would produce better PSNR values. This advantage of CBL is due to the fact that we only change a pixel by one grey level while other algorithms may embed more than one bit in a pixel.

Table 2 Comparison of PSNR values between CBL and other adaptive algorithms

4.2 CBL versus non adaptive LSB-M based methods

From another point of view we need to compare CBL with other LSB-M based methods. A recent LSB-M based method is CAS-NE [12] which is more secure than other comparable algorithms such as G-LSB-M [10]. Any of the steganalysis methods mentioned in Section 2 can be used for comparison purposes. We used Ker1, Ker2, WAM, ALE, and CNGL attacks to LSB-M, our CBL, and CAS-NE algorithms. Out of the mentioned five attacks, WAM is a blind method and the four are specifically designed to discover LSB-M embedding.

Different image databases exist that are used for testing of steganography algorithms. Images of each database usually have certain characteristics. Hence we used two different databases. The first one was NRCS Photo Gallery which is maintained by the United States Department of Agriculture [19]. This database has 2,375 photos related to natural resources such landscapes from across the USA. The second database that we used was Camera Images that is a collection of 3,164 images captured using different digital cameras by researchers from Binghamton University, NY, USA. Images of natural landscapes, buildings and object details are included in this database without applying any lossy compression.

Implementation of different algorithms and different attacks were performed by Matlab 7.6.0. Results of a number of experiments on images using different embedding rates are presented in the following. Receiver operating characteristic (ROC) curves were used to show the results of the experiments.

Figure 6 shows the results from attacks of Ker1, Ker2, CNGL and ALE attacks when database images where 50% embedded. We have also experimented with 25% and 80% embedding rates but their ROC curves are not presented here. It is concluded that the securities of LSB-M and CAS-NE against Ker1 attack are the same and are degraded as the embedding rate is increased. On the other hand the security of our CBL against Ker1 attack is much better and even at 80% embedding it remains undetected.

Fig. 6
figure 6

Security of proposed CBL compared with LSB-M and CAS-NE for embedding rate of 50% when attacked by a) Ker1, b) Ker2, c) CNGL, and d) ALE

Results from Ker2 attack are shown in Fig. 6b. These results too are from embedding with 50% rates in images of NRCS database. While at 25% embedding rate CBL has not much advantage over LSB-M or CAS-NE, when embedding rate increases the higher security of CBL becomes apparent.

Another attack which was applied was CNGL [8]. This attack is designed to detect LSB-M embedding in uncompressed images. Hence we applied our CBL, LSB-M, and CAS-NE method to embed data in images of Camera database which contains uncompressed images. Different embedding rates were again used to compare these three algorithms. Figure 6c shows the ROC curve produced from the application of the CNGL attack. The superiority of our CBL is apparent even at low data rates. This particular steganalysis operates on changes that occur in smooth regions of an image. Since CBL does not embed in smooth regions, it has very low vulnerability to this attack. Even though CAS-NE is more successful than LSB-M but it has no defence against CNGL for uncompressed images.

Steganalysis attack of ALE [1] was also tested to compare our CBL algorithm with the other two LSB-M schemes. An ROC curve representing the comparison of the security of algorithms against ALE are shown in Fig. 6d. CBL turns out to be completely secure against ALE as opposed to the other two schemes which at higher embedding rates become less secure.

So far, the attacks that were presented were all specifically designed to detect LSB-M. There are blind attacks that are designed to detect any type of embedding algorithm. A blind attack that is used in many of the references to detect LSB-M and similar algorithms is WAM. Hence, we used this last attack to test the security of CBL against the security of the other two schemes for embedded images of Camera database. Figure 7a shows comparisons of the security of the three embedding algorithms against WAM. This attack is more successful in detecting LSB-M based algorithms but our CBL has lower vulnerability against WAM in comparison with the other two schemes. At all three embedding rates our ROC curves fall below those of LSB-M and CAS-NE.

Fig. 7
figure 7

Security of proposed CBL compared with LSB-M and CAS-NE for embedding rate of 50% when attacked by WAM for image database of a) Camera and b) NRCS

We also applied WAM to images of NRCS database, embedded with the mentioned three schemes. Figure 7b shows the results for this attack. The WAM attack on NRCS images is less successful as compared with the results obtained from the Camera database. Our experiments show that for embedding rates below 70% our CBL performs better than CAS-NE and LSB-M. Only in embedding rates that are higher than 70% we see that CBL’s performance falls below that of CAS-NE. This is due to the fact that when embedding rate increases towards 100% and all of the pixels of an image are to be embedded, then CBL has no advantage over LSB-M. The strength of CBL comes from its selection of more secure regions. Hence, at lower embedding rates superiority of CBL is more apparent.

4.3 CBL versus ALSBMR

It is mentioned in [13] that their adaptive steganography algorithm, called ALSBMR, is the most secure LSB-M based method. Therefore, we compare our work with ALSBMR for a number of targeted attacks. The comparison was performed on some embedded images using all of the 5 previously mentioned attacks. Table 3 presents the results of these attacks against the proposed CBL, ALSBMR, and LSB-M. Security of each algorithm was measured by plotting ROC curves and extracting two different features from each curve.

Table 3 Security comparison between CBL, LSB-M and ALSBMR against 5 different attacks

One measure of security of an algorithm, indicated by \( {\left\{ {FA} \right\}_{{50\% }}} \), is the rate of false alarms that are produced at the 50% true positive point on a ROC curve. The closer that \( {\left\{ {FA} \right\}_{{50\% }}} \)is to 50% point the more secure is the steganography method and the performance of the attack is closer to random guessing. Another measure of security is Accuracy which is the area between the ROC curve and the diagonal. This area is normalized so that a perfect detection has an accuracy of 1. When this area is zero the ROC curve is the same as diagonal and the attack’s outcome is identical to random guessing. In Table 3, bolded values indicate occasions that our method is more secure than the other methods.

It can be seen from Table 2 that the security of CBL is either higher or comparable with ALSBMR. Besides having better security, CBL has other advantages of:

  1. 1-

    CBL can be used in any types of images, while ALSBMR could fail in some cases. There is a readjustment stage in ALSBMR which requires an extracted threshold from the image, for the required amount of embedding, to be less than 31. For situations that the image has plenty of edges and the amount of embedding is low, the readjustment stage fails. CBL has no readjustment stage and always successfully embeds in any type of image.

  2. 2-

    In ALSBMR only the threshold value is transmitted to the receiver. There is a possibility that the embeddable pixels for the transmitted threshold are more than the number of data bits. This causes an ambiguity at the receiver side. In CBL the length of data stream is specified and hence certainty exists during extraction stage.

  3. 3-

    Both ALSBMR and CBL use LSB-M for embedding, hence, both methods embed, at most, one bit per pixel. While in this paper we only used maximum of one bit per pixel, CBL has the advantage of generality and can embed more bits in each pixel.

5 Conclusion

In adaptive algorithms the embedding rate for each pixel of an image is determined by the human visual system. In these algorithms higher embedding rates are performed in the edge areas of images. Smooth regions are either left alone or lower embedding rates are performed in them. A short coming of the existing adaptive algorithms is that they embed data using LSB-F routine. We eased this problem by embedding based on LSB-M algorithm. Furthermore, we presented a complete scheme which identifies edges in the cover image and after altering the image by embedding data in it, allows the receiver to identify the exact same edges for the extraction purposes.

Two large databases were used to show the performance of our CBL algorithm as compared to three comparable algorithms. Both blind and specific steganalysis methods were applied to the produced stego images. These experiments showed the superiority of our algorithm over LSB-M, CAS-NE (non adaptive and LSB-M based) and ALSBMR (adaptive and LSB-M based) algorithms.

The proposed CBL algorithm is similar to LSB-M in the sense that it embeds at most one bit of data in each pixel. As a future work we intend to increase the embedding rate by embedding more than one bit in each candidate pixel by using the improved versions of LSB-M algorithm.