Block-Based Steganographic Algorithm Using Modulus Function and Pixel-Value Differencing ()
1. Introduction
Nowadays, digital communications become an essential part of our daily life [1] [2] [3] [4] [5] . A lot of applications are based on the Internet and in some cases it is required that communication have to be secret. The wide proliferation of the Internet and wireless networks makes delivery and exchange the digital data easy [6] - [13] . Apart from the problems of the wireless networks which include low bandwidth, insecure links, and high error rate [14] - [22] . Security is an important matter when exchange data over the internet and wireless networks [23] - [29] .
In security systems, data hiding is a common discipline to protect data. Data hiding, which concerned by concealing a message (a sequence of bits) in a digital object or cover, has two important sub-disciplines: steganography and watermarking [30] [31] . Steganography and watermarking are very close to each other and may be correspond but with different requirements and objectives as well, and thus leads to different technical solutions. Watermarking is a technique with a trade-off between the robustness, embedding capacity, and visual quality. Its aim is to obstruct piracy or to prove the proprietorship by imperceptibly modifying the digital media cover. The goal of steganographic techniques is to modify the cover object in imperceptible way, that is, nobody except the intended recipient can be able to identify the modified cover object [32] .
The steganography term is not new concept [33] . It is believed that steganography was found during the Golden Age in Greece and literally means “concealed/covert writing” which is derived from two Greek words “Stegan Graphien” [34] [35] [36] . Ancient Greek history mentioned that how ancient Greeks dig secret messages into the waxed wooden tablets and then the melting wax was reapplied to the wood, giving the appearance of a new and unused tablet. Thus, the resulted tablets could be transported without anyone doubting about the presences of a secret message under the wax [37] . An alternate smart method was to shave head of a messenger and tattoo a message or an image on the head of messenger. After the hair grew again, the message would not be discovered till the head was shaved again [38] . At the present time, steganographic algorithms obscure secret data as noise in a cover object that is assumed to be harmless [39] .
Generally, the algorithms used in steganography are based on the fact that the modifications occurred in texts, images, audio files and video files are not detected by human visual or auditory systems [40] . There are several stegano- graphic algorithms that have been proposed for data hiding when the cover media is digital images [41] [42] [43] . Since the digital images have a lot of redundant data, there has been an increased interest in using digital images as cover media for steganographic purposes [44] [45] . On the other hand, millions of digital images transfer through the internet each second, therefore it is necessary to say that digital image steganography becomes an important topic in IT security field [46] [47] . However, the remainder of the paper is organized as follows. In Section 2, a literature review of the most related works in the field is presented. Section 3, detailed extensively the proposed algorithm. Experimental results and discussions are provided in Section 4. Section 5 concludes the work and provides future possible directions.
2. Related Work
The first pixel-value differencing (PVD) steganographic algorithm was introduced by [41] . The embedding algorithm of Wu and Tsai’s method uses a cover image I sized by M × N. Bi is a sub-block of I, which has two consecutive pixels pi and pi+1 broken down by partitioning I in raster scan order such that
. The difference value di between pi and pi+1 can be derived by using the following equation:
(1)
On the other hand, in PVD method a range table has been designed with n contiguous sub-ranges Rj (i.e.
. The main job of the range table is to provide the lower and upper bound values for each
that follow each Bi. The lower and upper bound values are called by
and
, so that we have
. Each sub-range Rj has width Wj which is selected to be a power of 2 and can be calculated by using this equation:
(2)
However, using the width Wj of each Rj they can obtain the hiding capacity of two consecutive pixels by using:
(3)
According to the above equation, ti means the number of bits that can be hidden in each Bi. Read ti bits from the binary secret bit-stream and it will be transform into its integer value bi. For example, if ti bits = “100”, then the converted value of bi = 4. Now, a new difference value
can be calculated by adding lj and bi together where:
(4)
You should notice that the calculated
will replace the original di. Finally, the secret data can be hidden into Bi by modifying its pixel values pi and pi+1 as follows:
(5)
where:
. However, all the above steps are repeated for each sub- block until all secret data bits are hidden into the cover-image. Therefore, the stego-image is obtained.
Maleki, et al in [48] proposed an adaptive scheme based on Human Visual System (HVS), thus the pixels in edge regions can tolerate much more modifications than smooth regions. They use five secret keys, which are R1, R2, v1, v2 and T, where v1 ≥ 1, v2 ≥ 1 and (v1 + v2 < 6). First of all, two parameters Kr and Kc are generated using Hr(R1, v1) and Hc(R2, v2), respectively. Then, they calculate the average difference value D of 4-neighborhing pixels in a block as follows:
(6)
According to a threshold secret key T, they classify the current block into edge region or smooth region. Pixels in edge regions are embedding with a larger number of bits than that belongs to smooth regions. On the other words, If D ≤ T that means the block belongs to smooth regions and then Q = v1 bits will be embedded in that block. Otherwise, the block belongs to edge regions and then Q = v1 + v2. They have to determine if the current block is an error block or not by using this condition:
If that condition is satisfy, then this block is called an error block and it is not used to embed secret data.
The main goal of the overlapping PVD (OPVD) method is to maximize the embedding capacity of the original PVD while maintaining acceptable image quality [49] . OPVD method embeds the secret data bits using singular pixels rather than embedding in pixel pairs using least significant bit (LSB) substitution. If the difference value of the pixel pair before and after embedding the secret data bits belongs to the same range, then the embedding procedure is implemented. Otherwise, there is no embedding for secret bits and the second pixel is adjusted. Despite the fact that this method conceals more secret data bits than PVD, its embedding capacity is limited since it still has a large number of unused pixels in embedding process. Moreover, using simple LSB approach and the adjustment process distorts the stego-image histogram. Therefore to increase the embedding capacity and improving the security of OPVD method while maintaining the image quality, [50] proposed a novel steganographic method based on OPVD. Like OPVD, the proposed method uses the difference of a two pixel block to recognize the smoothness and contrast in the current block. Then, it hides the secret bits in the second pixel based on the computed difference. After that, the second pixel is employed as first pixel in the next block and the embedding process is repeated. Moreover, a correction procedure is used to reduce the number of unused pixels.
To overcome the limitation of embedding capacity in PVD method, there are some PVD-based steganographic methods used a combination of PVD and LSB to dramatically enlarge the embedding capacity of secret data [13] [51] . Khodaei and Faez in [52] have proposed a steganographic method based on the PVD and modified LSB to embed the secret data within a greyscale cover-image. Their proposed method firstly divides all possible differences into lower and higher levels with a number of ranges. Secondly, it partitions the cover-image into non-overlapping blocks of three consecutive pixels and obtains the second pixel of each block as the base pixel. Next, by using LSB substitution followed by optimal pixel adjustment process (OPAP) which will described later, they embed k-bits of secret data in the base pixel. After that, they calculate the differences of pixel values between the base pixel and other two adjacent pixels in each block. Finally, they apply the modified PVD algorithm to embed secret data into the two pixels. In this method, each pixel embedded by modified PVD will conceal at least 3 bits, while in the original PVD each pixel pair will conceal at least 3 bits. Therefore, this method can embed large amount of secret data with maintaining acceptable visual quality of the stego-image.
Wang, et al in [53] proposed a high quality steganographic method based on PVD and modulus function, which is more secure against the RS detection attack and performs better than the PVD scheme. This scheme increased the peak signal-to-noise ratio (PSNR) values to 44.15 dB while concealed 51,219 bytes. It exploits the remainder of the two consecutive pixels to record the information of the embedded data, which achieves more flexibility, capable of deriving the optimal remainder of the two pixels at the least distortion. This method increased the PSNR (up to 8.9%) more than the simple PVD method. To maintain the difference in the same range before and after embedding process, this method uses readjusting procedure to alter the reminder of the pixel pair.
Joo, et al. in [54] presented an enhancement on [53] method by embedding different amounts of secret data based on pixel-pair complexity. Tests in this method showed that the difference histogram had a shape closer to the cover-image which was hard to be detected by histogram analysis. Although this method improved the problems of the shapes in the difference histogram, its embedding capacity is not higher than Wang et al. method. In Joo et al. method, the embedding order is diverse for the odd and even embedding areas.
Chen in [55] introduced a PVD method using pixel pair matching (PPM). PPM [56] used two pixels as a unit for embedding a message digit SB in B-ary notational system. In Chen method, the cover-image is partitioned into 2 × 2 embedding cells for embedding by random embedding arrangements. To increase the random embedding characteristic, two reference tables are created. This random mechanism raises the security of the embedded data from detection and other steganalysis attacks. The major contributions of this approach are that: (1) PPM was utilized thus more data was concealed than original PVD, (2) Effectively decreasing the falling-off-boundary problem by manipulating only on Pivot Embedding Unit (PEU). (3) The secret data was concealed based on two reference tables which raised the random characteristic and the visual quality. (4) This method is harder to be detected since its difference histogram demonstrates that the values of the stego-image are very close to the values of the cover-image. Comparison this method with [54] , Chen scheme significantly had higher capacity and image quality.
3. The Proposed Algorithm
3.1. Embedding Phase
The embedding phase for our proposed algorithm used the same equations as employed in [41] [48] [52] [57] . The nitty gritty embedding steps for inserting secret data bits in a cover-image are described as follows:
Input: Cover-image CI, secret data S, and secret keys (R1, R2, α, β).
Output: Stego-image SI.
Step 1. The cover-image is dividing into non-overlapping two-pixel blocks
. In each block, there are two neighboring pixels pi and pi+1, and their corresponding gray values are g0 and g1, respectively.
Step 2. Transform S into a binary bitstream S'.
Step 3. As explained previously, Hr(R1, α) and Hc(R2, β) are used to generate two binary sets Kr and Kc, respectively.
Step 4. Calculate Q as follows:
(7)
Step 5. For the first pixel pi in the block, SQ = Q bits of binary bitstream S'. After that, this SQ is divided into two sub-sets SQ1 and SQ2, where SQ1 has α bits and SQ2 has β bits.
Step 6. Find the indices i and j using SQ1 = Kri and SQ2 = Kcj, where Kri and Kcj are ith and jth binary elements in Kr and Kc sets, respectively.
Step 7. Compute y as follows:
(8)
Step 8. Generate a pixel group G which is a subset of the pixel intensity set
and is generated as follows:
(9)
Thus, the pixel group G is an ordered set
. Then, determine the corresponding stego-pixel from yth element of G where
.
Step 9. For reducing perceptual distortion between the cover and stego images, we use “error reducing process”. Let L
[−1, 0, 1] and n = 2Q. After that, calculate
as in the following:
(10)
Consequently, we get three values for
. We choose one
value, which is the closest value for the original value pi. Thus, the final value for the corresponding stego-pixel
after error reducing process will be the chosen
.
Step 10. Until now, we embed Q bits in the first pixel in the block Bi. Now, compute the difference value between
and the second pixel pi+1 in Bi as follows:
(11)
Step 11. Find the corresponding sub-range
for the resulted difference value di from the dividing range table that is shown in Figure 1. Where li and ui are the lower and higher bounds for sub-range Ri.
Step 12. If Ri belongs to the lower-level, then 3 secret data bits will be embedded in the second pixel pi+1. Unless 4 secret data bits will be embedded in the second pixel pi+1. By considering ti is the number of embedded secret data bits, then, read ti bits from the binary bitstream S' and convert it into its decimal value st.
Step 13. Compute the new difference value ddi as follows:
(12)
Step 14. Calculate the stego pixel value
for the second pixel pi+1 in the block Bi using the following formula:
(13)
Step 15. Now, we are getting the stego-block consisting
and
. After that, repeat the steps from 5 to 15 for the next block until all secret data bits are completely embedded and the stego-image SI is obtained.
Figure 2 shows the flowchart of the embedding process in MF-PVD algorithm.
![]()
Figure 2. Embedding process in MF-PVD algorithm.
Respect to the side information used in MF-PVD algorithm, they are offline, except the amount of the payload which takes 32 bits from the embedding capacity.
・ Embedding Phase: Example
An illustration of the data embedding phase is shown in Figures 3(a)-(h). Suppose that the simple block is comprised by p1 and p2 and their corresponding grey values are (47, 48) as shown in Figure 3(a), and the bitstream of secret data is “1000011”, as shown in Figure 3(b). Also, assume α = 1, β = 3, R1 = 2 and R2 = 2020.
§ Before the actual embedding, we generate the Kr using Hr (2, 1) and the Kc using Hc (2020, 3). All permutations generated by Hr and Hc for Kr and Kc, respectively, are shown in Figure 3(c), Figure 3(d). Thus, Kr = {1, 0} and Kc = {001, 010, 101, 000, 011, 100, 110, 111}.
§ The first pixel is embedded with Q = 4 bits of secret data. Thus, SQ = “1000” will be separated into two sub-strings SQ1 = “1” and SQ2 = “000”.
§ After that, we find the indices i and j where SQ1 = Kri and SQ2 = Kcj. Therefore, i = 1 and j = 4.
§ Using the values of i, j and β to compute y = 2β × (i − 1) + j = 23 × (1 − 1) + 4 = 4.
![]()
Figure 3. (a)-(h): An example of the embedding process in MF-PVD algorithm.
§ Next, the pixel group G is created as shown in Figure 3(e). Therefore, the stego-pixel
can be obtained from the yth element of G (i.e.
= g4 = 35).
§ To reduce the distortion, we use the error reducing process. As shown in Figure 3(f), we will get three values for
, thus, we choose the closest one to the original pixel value 47, which is 51 (i.e.
= 51).
§ Now, we compute the difference value between
and p2 as follows:
where R1 = [0, 7] and t1 = 3 bits. Thus, st = 3.
§ Next, the new difference value is computed as follows: dd = st + 0 = 3
§ Finally, according to step 14, the stego-pixel
=
+ dd = 51 + 3 = 54
Hence, the block after embedding the secret data will be as shown in Figure 3(h).
3.2. Extracting Phase
The details of extracting phase to extract the secret data S are described as follows:
Input: Stego-image SI, and secret keys (R1, R2, α, β).
Output: Secret data S.
Step 1. Similar to the embedding phase, first of all, partition the SI into two-pixel non-overlapping blocks. In each block, there are two neighboring pixels
Step 2. Using Hr(R1, α) and Hc(R2, β) to generate two binary sets Kr and Kc, respectively.
Step 3. Through sets Kr and Kc, form a Cartesian product Kr
Kc. Kr
Kc creates an ordered set of combinations of Kr and Kc with 2α × 2β = 2α+β elements. Each component of the variant Cartesian product Kr
Kc is binary string concatenation which includes the two binary strings Kri and Kcj jointly to form one string which has the length (α + β) bits
(14)
For example, assume α = 1, β = 3, R1 = 2 and R2 = 2020. We generate the Kr using Hr(2, 1) and the Kc using Hc(2020, 3). Thus, Kr = {1, 0} and Kc = {001, 010, 101, 000, 011, 100, 110, 111}. We produce the variant Cartesian product Kr
Kc as follows: {1001, 1010, 1101, 1000, ∙∙∙, 0011, 0100, 0110, 0111}
Step 4. Calculate Q as was in the Equation (7)
Step 5. For the first pixel
in the block create the pixel group G and find the position y of
, since the stego pixel
equals gy (i.e.
= gy, where n = 2Q).
Step 6. Use the Cartesian product of Kr and Kc(Kr
Kc) to extract the yth element which is the secret embedded bits with Q bits, we called this first piece of secret data by SQ.
Step 7. Find the difference value between the first and second pixels in the block where
(15)
Step 8. Find the corresponding range
for the resulted difference value
and compute
.
Step 9. Extract the second piece of secret data St by using:
(16)
Step 10. Transform St into its binary value.
Step 11. Move to next block and repeat Steps from 5 to 11 until all the pieces of secret data are completely extracted. Then, concatenate all the pieces of secret data sub-bitstreams in order to recover the required hidden secret data S.
The error reducing process in our algorithm can work correctly since it is do not change the hidden secret data. To prove that, remember step 5 in the extracting phase. We mentioned that
= gy where n = 2Q, if we applying the following equation:
=
+ L × n, where
, we will get three values (
− 2Q), (
) and (
+ 2Q).
All these resulted values have the same reminder to n. Consequently, in the extracting phase, using each of these three values will lead to extract the same secret data correctly. Detection process for secret data in our method is very difficult to any unauthorized users due to existing many permutations (Kr has 2α!), (Kc has 2β!) and (Kr
Kc has 2α! × 2β!). Thus, an attacker will face more difficult in guessing the secret data. Figure 4 shows the flowchart of the extracting process in MF-PVD algorithm.
4. Experimental Results and Discussions
4.1. Simulation Setup: Simulation Parameters and Performance Metrics
All our experiments are developed using MATLAB 8.2.0.701 (R2013b) software on Windows 7 platform with an Intel Core i7-4600U CPU working at 2.1 GHz with a 4 MB cache and 4 GB RAM. We used different benchmark gray level images with size 512 × 512 from various databases such as (USC-SIPI Image Database) and (UWATERLOO-LINKS Image Repository) [58] [59] . Also, we used various formats for images, such as: Tiff, Jpg, Bmp, and Gif. In addition, we use randseq ( ) function to generate random secret message to be embedded in the cover image.
The effectiveness of our proposed algorithm is verified using different performance metrics such as PSNR and structural similarity index measure (SSIM). In general, PSNR and SSIM are used evaluate the overall image quality. PSNR is computed using the following equation [41] [60] - [68] :
(17)
where Imax equals to 255 for 8-bit gray level images, which means the maximum intensity value of each pixel. Mean square error (MSE) is calculated using:
(18)
![]()
Figure 4. Extracting process in MF-PVD algorithm.
where MN is the total number of pixels for both cover and stego images. xij and
represent the pixels in the cover image and stego image, respectively. SSIM is calculated as follows [69] [70] :
(19)
where
and
which are two constants to stabilize the division when the mean and variance get close to zero. L represents the maximum possible value for image pixel,
(where Nbpp is the number of bits per pixel).
and
denote the mean and variance of
, respectively.
and
denote the mean and variance of
, respectively,
refers to the covariance of x and y. The value of SSIM lies in the interval [zero, one]. The value “one” means that both images, cover image and stego image, are precisely the same, and the value “zero” means that they are absolutely unrelated. However, for each image, there are several SSIM indexes where each one is calculated within (11 × 11) local window using a certain circular-symmetric Gaussian weighting value (between zero and one) and the final SSIM image index is the average of these indexes.
4.2. Experimental Results and Discussions
The maximum embedding capacity (EC) in our algorithm can be computed by using the following equation:
(20)
where Nfp is the number of first pixel blocks, Nsp1 is the number of the second pixel blocks that belongs to the lower-level and Nsp2 is the number of the second pixel blocks that belongs to the higher-level.
We have implemented using a series of α and β secret keys. The value we got from adding α and β values will be embedded in the first pixel in each block (i.e. α + β bits). Figure 5 and Figure 6 demonstrate the experimental results of six stego-images resulted by our algorithm with different values for α and β on Elaine and Splash images.
Elaine Cover Image
Stego Elaine with α = 1 and β = 1
Stego Elaine with α = 2 and β = 1
Stego Elaine with α = 2 and β = 2
Splash Cover Image
Stego Splash with α = 1 and β = 1
Stego Splash with α = 2 and β = 1
Stego Splash with α = 2 and β = 2
Tables 1(a)-1(c) shows the results of our adaptive algorithm in terms of the maximum embedding capacity, SSIM and PSNR values. As shown in Table 1, our proposed algorithm is scalable and flexible, so that larger values for α and β improve the embedding capacity whereas a lower values of α and β improve the stego-image quality. Moreover, it is noteworthy that the complexity time presented by our algorithm almost is O(n2), which is less than or equals to 59 s.
Our algorithm outperforms Maleki, et al. scheme [48] since we have not error blocks which is not used to embed secret data. On the other hand, using the PVD method for embedding the secret data in the second pixel according to the specific range table significantly increases the capability of embedding. Therefore, our method is extremely superior Maleki et al. scheme in terms of the embedding capacity. Table 2(a), Table 2(b) demonstrates a comparison between our algorithm and Maleki et al. algorithm. As shown in Table 2, in all different values of α and β, our method provides the highest embedding capacities. In addition to improve the embedding capacity, our method does not degrade much on the visual quality of the stego-image. The embedding rate and the visual quality of the stego-image in our algorithm can be modified depending on the requirements of the practical applications. In other words, if we need high embedding rate, we have to choose larger values for α and β, but if we need high visual quality, we have to choose smaller values for α and β. Compared Maleki et al. algorithm with our proposed algorithm in terms of the EC, the average improvement ratio (AIR) is about 47%, 20%, 25% and 12% when using (α = 1 and β = 1), (α = 2 and β = 1), (α = 2 and β = 2) and (α = 3 and β = 1), respectively. Unfortunately, this will be at the cost of decreasing PSNR values. The average degradation ratio (ADR) is about 18%, 10%, 5% and 8%, respectively. Although, there are decreasing in PSNR values, the stego image visual quality does not show any distortion to be suspected by unauthorized observers.
Results shown in Table 3(a), Table 3(b) demonstrates that our algorithm outperforms to [50] and [52] algorithms in terms of the embedding capacity. The AIR is about 12% and 2%, respectively. Moreover, our algorithm provides better PSNR values in most stego images than El-Alfy and Al-Sadi. Although our
![]()
Table 1. (a)-(c): Experimental results of MF-PVD algorithm.
![]()
Table 2. (a) (b): Comparison of the results between Maleki, et al. scheme [48] and MF-PVD algorithm.
![]()
Table 3. (a) (b): Comparison of the results between our MF-PVD algorithm against [50] and [52] methods.
algorithm does not greatly increase the embedding capacity than Khodaei and Faez, our algorithm does not degrade on the image quality and it provides higher level of security. The level of security in our proposed algorithm is high, due to two reasons, which are: 1) We have two methods to individually embed each pixel in a block, 2) Our algorithm provides hard detection for the hidden secret data bits due to existing: many permutations and dividing range table.
Table 4(a), Table 4(b) shows the comparison of the results between our algorithm against [53] [54] [55] algorithms. In fact, our algorithm is superior to these three approaches in two features, namely embedding capacity and level of security. The AIR in terms of the embedding capacity is about 62%, 61% and 55%, respectively. However, as inevitable result of the increasing in the embedding capacity, the PSNR is decreased. The ADR in terms of the PSNR is about 11%, 11% and 19%, respectively. Our algorithm has higher level of security than these three methods for the same reasons listed previously.
5. Conclusion and Future Work
We have proposed a new block-based steganographic algirthm using PVD and modulus function techniques, namely, MF-PVD. To evaluate the performance of MF-PVD algorithm, we compare it with six pertinent state-of-art algorithms,
![]()
Table 4. (a) (b): Comparison of the results between MF-PVD algorithm, [53] , [54] and [55] methods.
which are existed in [48] [50] [52] [53] [54] [55] . As a matter of fact, our MF-PVD algorithm is outstanding to these mentioned methods in two main features, the embedding capacity and the security. In fact, the security of our algorithm is high due to generating many permutations and existing the dividing range table.
Many trends can be given for further improvements to the proposed algorithm. The algorithm’s framework can be extended to the RGB color images for improving the capability of embedding. Moreover, it can be a good addition to develop an approach that takes into account the hybrid domain. As well, there are future plans to develop modulus function-based schemes for another media such as audios and videos.