Abstract
Digital image steganography algorithms usually suffer from a lossy restoration of the cover content after extraction of a secret message. When a cover object and confidential information are both utilised, the reversible property of the cover is inevitable. With this objective, several reversible data hiding (RDH) algorithms are available in the literature. Conversely, because both are diametrically related parameters, existing RDH algorithms focus on either a good embedding capacity (EC) or better stego-image quality. In this paper, a pixel expansion reversible data hiding (PE-RDH) method with a high EC and good stego-image quality are proposed. The proposed PE-RDH method was based on three typical RDH schemes, namely difference expansion, histogram shifting, and pixel value ordering. The PE-RDH method has an average EC of 0.75 bpp, with an average peak signal-to-noise ratio (PSNR) of 30.89 dB. It offers 100% recovery of the original image and confidential hidden messages. To protect secret as well as cover the proposed PE-RDH is also implemented on the encrypted image by using homomorphic encryption. The strength of the proposed method on the encrypted image was verified based on a comparison with several existing methods, and the approach achieved better results than these methods in terms of its EC, location map size and imperceptibility of directly decrypted images.
Keywords
Introduction
In the past several years, cryptography [1] and steganography [2–4] have become two widely used techniques to protect confidential information when communicating over an untrusted medium. Cryptography ensures security by converting readable data into an unreadable form. Steganography protects a secret by concealing its existence; hence, in steganography, the communication is also made secretly and is a means of inserting covert information into a digital cover file. Despite communication being visible to everyone, cryptography methods are used to transfer images in a highly secured manner [5–7].
Steganography algorithms can be classified into two classes, namely, irreversible steganography and reversible steganography. The primary focus of irreversible steganography is hiding a secret in a digital cover medium for secret communication. Various steganography techniques such as substitution, transform domain, and statistical methods have been developed under this irreversible technique. Although irreversible steganography is used to transmit secret data, as one significant limitation securely, the host image cannot be recovered at the receiver side after the extraction of a secret. In some unique applications such as medical imaging, military imaging, and law forensics, the restored property of a digital cover is essential because the digital cover is too valuable. For example, in electronic healthcare, the patient electronics records (PERs) and their medical images are transferred separately to obtain an expert suggestion. A PER can be transferred by embedding it into a medical image. Under this circumstance, extracting the PER and recovering a cover without any loss of information is extremely important.
In addition to necessitating a high payload capability and stego-imperceptibility, some implementations also require a precise recovery of the cover image, for example, geographic maps, diagnostic medical images, remote sensing images, military maps, and images regarding legitimate issues such as e-signatures or legal or other official documents. The proposed algorithm retrieves the secret and fully recovers the cover without any loss. The developed pixel expansion reversible data hiding (PE-RDH) scheme achieves a good imperceptibility, reversibility, and EC compared to several existing RDH systems. PE-RDH achieves an average structural similarity index metric (SSIM) value of 0.9136 and an average peak signal-to-noise ratio (PSNR) of 30.89 dB for an average EC of 0.75 bpp. The size of the location map for the developed PE-RDH scheme is 30 bits for a 100,000-bit payload. The recovered image and secrets are the same as in the original, and thus 100% reversibility is proved. In addition, PE-RDH is implemented on an encrypted image to provide security for the cover image. In this method, any third party may embed the secret without the knowledge of the original image.
The remainder of this paper is organised as follows. Section 2 describes related work; Section 3 describes the proposed method. The results and a discussion are then given in sections 4 and 5, respectively. Finally, section 6 provides some concluding remarks and future direction.
Related work
From 2000, reversible steganography was developed to overcome the significant disadvantages of irreversible steganography. The three main reversible algorithms are a difference expansion (DE) [4], histogram shifting (HS) [5], and pixel value ordering (PVO) [6]. The DE method achieves reversibility by calculating the average value and difference in the adjacent pixels [4]. With this method, only one bit can be embedded in every pair of pixels. Also, Alatter [7] developed an enhanced DE scheme by inserting three bits in every group of four pixels(quad). A difference expansion procedure along with a streamlined location map (LM) and expandability is provided in [8] and [9] for obtaining a larger entrenching capacity. Reversible data hiding is achieved in [8] using sorting and wavelet techniques, and in [9] a quasi-Laplace distribution of the difference values is used for data embedding. Reduced difference expansion (RDE) approaches to decrease the difference expansion value by using a transformation function [10, 11]. In [12], the differences are expanded in two directions to increase the EC.
With the HS method, the reversible data hiding (RDH) can be achieved by adjusting the histogram of an image. In [5], embed the data by shifting the histogram toward the left, from the peak to zero points. This approach was extended in [13]. In [14], the image is divided into several blocks; in every neighbourhood, the data are embedded in the neighbouring pixels of the peak point to increase the EC. The histogram shifting of n-bit planes is used for lossless data hiding in [15]. An adaptive prediction-error expansion (PEE) and pixel selection are proposed in [16]. With this method, the image pixels are divided into two segments to obtain flat and rough regions. The secret bits are embedded in a flat area and leave a rugged region unchanged.
The incorporation of pixel-value-ordering (PVO) into PEE is introduced in [6]. With this method, the image is divided into several non-overlapping blocks, and in each block, the difference between the first and second maximum pixel values is calculated. If the difference is 1, that block is then used for secret data embedding; otherwise, embedding skips to the next block. Improved PVO (IPVO) [17], using a block with a difference of zero or 1, is applied for embedding, which increases the EC; this approach is extended in [18–22]. The variance of each block is used in [23] to achieve RDH. The reversible integer transform (RIT) is used in [24] to create RDH. In [25], a new PVO-based RDH method was introduced for improving the intrinsic correlation between adjacent pixels in an image block. With this method, the image is divided into several non-overlapping regions based on the pixel values. Each part is divided into several blocks, and these blocks are then classified for data embedding based on predefined threshold values and the local complexity. Next, the same PVO method is applied in the selected blocks for data embedding. Although DE methods [4, 7–12] provide a high EC, there is less imperceptibility, and the location map (LM) is enormous. The histogram shifting method [5, 14] and PVO [6, 25] increase the imperceptibility but with a low EC.
Data outsourcing relies on third parties for processing and storage. In RDH, when users outsource the data embedding process, both cover and secret should be encrypted to protect the cover as well as secret. As a result, reversible data hidden in encrypted images emerge. In which the secret can be embedded in a digital cover without the knowledge of cover and secrecy. The paillier encryption algorithm has a homomorphic property, and by using this property, the data can be embedded in the encrypted image using a difference expansion method similar to the tians’ [4] method. In this method, the secret is embedded in each pixel pair, and the maximum possible embedding capacity of this method is 0.5 bpp.In [28] the image is encrypted by stream cipher, and the data are embedded by difference histogram shifting and prediction error histogram shifting. In the histogram shifting method, the secrets are embedded only in the highest bin of the histogram, which reduces the embedding capacity. In [29], the data is embedded in the image using the Rhombus Pattern Prediction scheme and homomorphic property of ECC-ElGamal. The secret can only be embedded in each pair of pixels in the Rhombus Pattern Prediction scheme, which reduces the embedding capacity. To increase the embedding capacity, a pixel expansion method is introduced in the proposed method.
From the above discussion, a good RDH algorithm should offer salient features such as a good EC, high imperceptibility, and smaller location map size. To address these challenges, a novel RDH algorithm is proposed based on the pixel expansion method. The RDH method provides security for secret data and does not protect digital cover. Therefore, the proposed RDH is implemented on an encrypted image using homomorphic encryption, as shown in Fig. 1.

The overall framework of the proposed scheme. (a) PE-RDH framework (b) PE-RDH framework in encrypted image.
The method contains two phases. In the first phase, the secret data are encrypted by using the Advanced Encryption Standard (AES). It is a viral and effective algorithm for text encryption. It has three variants for the key size such as 128, 192 and 256 bits which results in the rounds of operation of 10, 12 and 14 rounds respectively. Substitution and permutation are the two major operations have been carried out in the AES with a series of linked operations. AES has Key expansion, AddRoundKey, SubBytes, ShiftRows and MixColumns blocks to encrypt a plaintext. In this work, AES – 128 has been adopted to encrypt the secret bits before it embedded into the host image. This method enhances the security of the secret in addition to the hiding strategy. Depends on the image size, the secret has been chosen. Hence, padding of bits has been utilised to create 128 bits of plaintext whenever it is necessary. Then the encrypted secret is embedded by expanding the pixel values. In the second phase, the secret data are extracted without any error, and the cover image is recovered without any loss. Table 1 lists the notations used in the proposed method.
Notations used in PE-RDH
Notations used in PE-RDH
The cover image is divided into several non-overlapping blocks with a size of M×N, and each block has a set of MN pixel values. The pixel values (P1, P2, P3 ... PMN) in a block are sorted according to their values to obtain (Pq (1) , Pq (2) , Pq (3) ... , Pq (MN) ), where q:1,...MN⟶1,.., MN is a unique one-to-one mapping such that Pq (1) ≤Pq (2) ≤Pq (3) ≤... Pq (MN) . In addition, q(i) <q(j) if Pq (i) =Pq (j) and i < j. In the sorted pixel values, the median, minimum, and maximum pixels are Pq (median) , Pq (min) , Pq (MN) , respectively.
The position of the median pixel value is calculated using Equation (1). Then, the differences (Pq (i) diff) between Pq (median) and the other pixel values (Pq (i) ) are calculated using Equation (2). The secret bits are embedded only in those blocks whose Pq (i) diff values are less than or equal to the acceptable difference (AD). The AD is the minimum positive integer value whose acceptable range is 0 to 30.
If the AD exceeds the acceptable range, then the image quality decreases. Hence, to obtain a good stego image quality, the AD should be at a minimum. The embedding of a secret bit and creation of a stego pixel are shown in Equation (3). If the Pq (1) diff or Pq (MN) diff values are higher than the AD in a block, then such blocks are not used for embedding. In these blocks, the stego pixels are calculated using Equations (4) and (5).
The value of Si should be within 0–255. If it is not within this range, then all operations conducted on these particular blocks are revoked, and these blocks are considered as invalid blocks. Then these invalid blocks are later identified based on the location map. The overall data embedding procedure is shown in Fig. 2. Algorithm1 shows the data embedding procedure in a step-by-step manner.

Data embedding.
The stego image is divided into several non-overlapping blocks with a size of M×N, and each block has a set of MN pixel values. The pixel values (S1, S2, S3 ... SMN) in a block are then sorted according to their values to obtain (Sq (1) , Sq (2) , Sq (3) ... , Sq (MN) ), where q:1,...MN⟶1,.., MN is a unique one-to-one mapping such that Sq (1) ≤Sq (2) ≤Sq (3) ≤ …Sq (MN) . Here, q(i) <q(j) if Sq (i) = Sq (j) and i < j. Among the sorted pixel values, the median, minimum, and maximum pixels are Sq (median) , Sq (min) , Sq (MN) , respectively. Then, the differences (Sq (i) diff) between Sq (median) and the other pixel values Sq (i) are calculated using Equation (6). The secret bits are extracted only from those blocks in which Sq (i) diff is less than 2(AD) +2.
In these blocks, the pixels with the secret (Sq (i) ) are added to Sq (median) , as shown in Equation (7), the secret bit (b) is extracted using Equation (8), and the pixel values are recovered using Equation (9).
The value of Sq (1) diff or S q (MN) diff is greater than 2(AD) +1 in a block, and such blocks do not contain the secret data. In these blocks, the pixel values are recovered through Equations (10) and (11).
The overall data extraction procedure is shown in Fig. 3. Algorithm 2 shows the data extraction procedure in a step-by-step manner.

Data extraction.
In this method, the image is encrypted by using additive homomorphic encryption[30]. If the sum of the encrypted data is decrypted, the sum of the plain data will be collected. Using this additive homomorphic property, the secret data is embedded in the encrypted image and the secret extraction; image recovery can be carried out in two modes. In mode I, the secret data is extracted from the encrypted image without decrypting it. In mode II the image is decrypted before the secret is extracted.
Image encryption and data embedding
Each block of an image is encrypted by using Equations (12) to (15).
Where ‘SE prkey ’ is a sender’s private key, ‘RE pukey ’ is a receiver’s public key, ‘RanX’ is a random number for block X. ‘Rno’ is a random number to create a public key. The image encryption is shown in Fig. 4. After mage encryption, the secret data are going to embedded in an encrypted image as similar, as shown in Fig. 2.

Image encryption.
The person who needs secret they can extract the secret from an encrypted image as similar, as shown in Fig. 3. After the secret is obtained, the encrypted image is decrypted using Equations (16) and (17) the resulting value is subtracted from the random number to get the recovered pixel(RP i ) using Equation (18). The image decryption process is shown in Fig. 5.

Image decryption.
The image is first decrypted, and then the secret is extracted. The directly decrypted image gives an approximate image. The secret can be obtained from that approximated image; after extraction of the secret, it will provide the original image, which is shown in Fig. 6.

Image decryption and secret extraction.
The proposed method is executed in jdk1.8 using Windows10. To test the efficiency of the proposed method, the experiments were carried out on several grayscale images with a pixel size of 512×512. In this study, the results are shown for six test images, namely, Lena, Sailboat, Peppers, Airplane, House, and Boat. These six test images are shown in Fig. 7 (a–f). The EC, image quality, and location map size of the proposed scheme PE-RDH are calculated for various block sizes (1×2, 2×2, 4×4, and 4×2) using different AD values. Security analysis and time analysis of the proposed scheme are made for different grayscale images with a pixel size of 512×512.

Test imagesImage Quality.
The number of bits that can be embedded in an image is called the EC. The average EC of the proposed method is 0.75 bpp for grayscale images. For acceptable image quality (PSNR >30 dB) a graph is plotted between maximum the EC and the AD values for the various block sizes, the results of which are shown in Fig. 8 (a–f). The embedding capacity of the test images for a block size 4×2 and with different AD values, which are listed in Table 2. The embedding capacity of the test images for AD of 12 and with varying quantities of the block, which are listed in Table 3. Finally, Table 4 shows that the proposed method can achieve high embedding capacity(0.75 bpp) for the block size of 4×2 and with AD of 30.

The maximum EC versus AD values for various block sizes based on the image quality (PSNR ≥30 dB).
EC, location map size, PSNR, and SSIM for different AD values with a block size of 4×2
EC, LM, PSNR, and SSIM for different block sizes with an AD of 12
The maximum EC of the test images and the corresponding location map size, PSNR, and SSIM
The image imperceptibility can be calculated using two metrices, the PSNR and the structural similarity index metric (SSIM). A higher PSNR reflects the high visual quality of an image. The PSNR between the cover image and the stego image is calculated using Equations (19) and (20).
The PSNR value is greater than or equal to 30 dB; it is highly difficult for the human visual system to differentiate a stego image from a cover image.
The SSIM is used to measure the degradation of an image based on the structural data [26]. The SSIM is calculated using Equation (21).
Where μP and σP are the average and variance of a cover image and μS and σS are the average and variance of a stego image, respectively. Besides, σPS is the covariance between cover and stego images, and c1and c2 are predefined constants. To achieve a good visual quality, the SSIM value must be closer to 1, and PSNR value must be greater than 30 dB. The PSNR and SSIM values are calculated for a block size of 4×2 and for different AD values are shown in Table 2, and these values are also calculated for AD of 12 and for different block sizes are shown in Table 3. Finally, Table 4 shows that the proposed method can provide good visual quality (PSNR >30 dB) for its high EC(0.75 bpp).
After embedding the secret, the value of the stego pixel should be within the range of 0 to 255(0≥Si≤255). Even if one pixel in a block is not within this range, then that block is not used for embedding. Such blocks are identified by the location map. The size of the location map is calculated for the test images for a block size of 4×2 and with different AD values, which are listed in Table 2. The size of the location map is also calculated for the test images with an AD of 12 and with different block sizes, which are listed in Table 3. Finally the Table 4 shows, that the proposed method has much smaller location map size(0.005 bpp) for its’ high EC.
Relationship between AD, block size, PSNR, LM
When the AD value is higher, the embedding capacity is high, but the maximum acceptable range of AD is 30 otherwise, the PSNR value will be reduced, and the location map size will be increased. Therefore, the acceptable range of ADs’ is between 1 and 30. As if the block size is greater than 4×2, the difference between the median pixel and the other pixel value in a block becomes higher than AD, so that most blocks are not used for embedding; therefore the embedding capacity is reduced. If the block is not used for embedding, the maximum pixel or the minimum pixel in the block is shifted by the AD value; therefore the PSNR value is reduced, and the location map size is increased. Hence the size of the block and the AD values are should be moderate, respectively 4×2 and 30.
Security analysis
Effective encryption algorithms should convert meaningful data into meaningless data. The security level of the encryption algorithm can be evaluated using some of the analysis provided in [31]. These are encrypted images’ histogram, entropy, deviation from ideality, correlation coefficients and keyspace analysis.
Histogram analysis
If encrypted pixel values are distributed equally, then it is complicated to figure out the statistical nature of the original image. Figure 9 shows that the pixel values of the encrypted images are distributed uniformly, hence it is difficult to obtain the original image information.

Histogram of Lena and encrypted Lena.
The randomness of the encrypted image is measured by Global Shannon entropy; Equation (22) is used to calculate entropy value.
Where ‘I’ is the maximum intensity value of an image, and Pr(SYj) is the probability of occurrence of symbol SYj. In Table 5, the entropy values of the test images are very close to ‘8,’ which makes it very difficult to obtain information about the original image.
The Entropy, Deviation from ideality and correlation coefficient of the encrypted images
This parameter will be used to determine how much the encrypted image is deviating from the ideal image. To determine this parameter, the Equations (23) and (24) are used.
HIS(I) is an ideal image histogram. The lower value of DI is the good randomness of the image. The tabulated values in Table 5 are shown; the encrypted image is very close to the ideal image.
The correlations between adjacent pixels are very low in an encrypted image, then finding the original image information is very hard. Table 5 shows that the correlation coefficients very low, hence the proposed method has excellent confusion properties.
Keyspace analysis
A keyspace is the calculation of the possible number of secret keys that can be generated from the key generator. The larger keyspace offers high security. In this work, four keys have been used, namely SEprkey, REprkey, Rno and seed for generating the random numbers. The keys SEprkey, REprkey and Rno have been generated from the chaotic process where each key has the precision of 1014, and for random number generation, the seed value is 8 bit wide which has the keyspace of 28. Hence the total keyspace will be 2148 (1014×1014×1014 = 1042, which is approximately equal to 2140 + 28), which resists the brute force attack effectively.
Time analysis
Each pixel is encrypted by using Equations (12) to (15). Hence the execution time of the encryption algorithm is O(W×HT); similarly, the decryption algorithm execution time is O(W×HT). For data embedding, in each block, the median pixel value is calculated by using a radix sort. For single block, the sorting time is O(M×N) for total blocks O(W×HT). After finding the median pixel value, the data are embedded by using Equations (1) to (5). The total execution time of the embedding process is O(W×HT) similarly the data extraction and image recovery execution time are O(W×HT)
Performance analysis
In this section, the performance of the proposed algorithm is compared with related methods based on the EC, image imperceptibility, and location map size. The proposed method with a block size of 4×2 and an AD of 12 are distorted by embedding the various numbers of bits, and their visual qualities are compared with various existing methods. The results of which are shown in Fig. 10. The maximum EC of the Lena image for a block size of 4×2 and an AD of 30 is 0.8 bpp with a PSNR of 30.22 dB.

The maximum EC versus imperceptibility.
Further, the proposed PE-RDH is implemented on an encrypted image using homomorphic encryption. In homomorphic encryption, changes in the encrypted domain caused by the data hiding process should also appear in the directly decrypted image at the same location. The embedding capacity, location map size, and visual qualities of instantly decrypted images are compared with various existing methods [27–29], the comparison is shown in Table 6. This result shows that the proposed method has a high embedding capacity, good image quality, less location map size. The visual quality of directly decrypted image for a various number of secret bits with a block size of 4×2 and an AD of are compared with various existing methods. The results of which are shown in Fig. 11.
Performance Comparison of PE-RDH on the encrypted image

The Performance comparison of the directly decrypted image.
This paper presented a novel RDH algorithm for effectively reducing the location map size and improving the imperceptibility and EC. Further, the proposed PE-RDH method was validated using several grey-scale images of different block sizes with different AD values as a benchmark. As a final note, the proposed PE-RDH algorithm has an average EC of 0.75 bpp with an average PSNR of 30.89 dB, which are superior to those of several existing RDH algorithms. A high EC was achieved with minimal overhead, and a lossless recovery can be provided, which are extremely useful for extensive real-time applications such as image authentication, law enforcement, secret communication, e-government, and medical data transmission. There is also a downside to the proposed method, i.e., high visual quality cannot be provided for a low EC as achieved with PVO methods. However, PVO methods cannot offer a high embedding capacity. The proposed method is applied to the encrypted image to ensure protection for the cover as well. In this method, the image decryption and secret extraction can be a separate process. This methodology concentrated on the noise-free channel. In future, we intend to develop a new method to reduce the error in the noisy channel.
Footnotes
Acknowledgments
Authors thank the Department of Science & Technology, New Delhi, for the FIST funding (
