1 Introduction

The telemedicine framework is renewing the conventional healthcare system by improving efficiency, bringing down expenses, and set the consideration back on better patient care. Telemedicine has offered to ascend to E-healthcare and its focus is on improving the healthcare framework. In the current scenario, a standout among the most significant issues is the exchange of electronic patient information (EPI) between patient and a doctor that are remotely connected. A minute change to EPI may result in a wrong diagnosis for the patient. In such type of scenario, researchers have been looking out for alternative approaches to secure the EPI in a progressively effective manner. Data hiding has been found as an alternative to such type of scenario where steganography and watermarking are the two most common methods for data to hide. Steganography is the art of hiding secret messages into an audio, video, image, or text file to avoid detection whereas secret message is then extracted at its receiver end respectively. Sometimes, during the data hiding process, receiver is not able to reconstructed cover image successfully while in few applications, for example, medical, military, and law crime scene investigation, loss of cover image is not permitted. In these cases, an extraordinary sort of data hiding strategy called reversible or lossless data hiding is utilized. Reversible data hiding meant to embed the secret message in cover image in such a manner that at the receiver end, secret message, as well as the cover image, is retrieved successfully.

2 Literature review

There is a lot of research done in reversible data hiding domain; some are illustrated as follows- Firstly, the idea of hiding information from attackers was presented by Shi (2004). Afterward difference expansion based reversible data hiding technique was proposed by Tian (2003), where a single bit was embedded between two close-by pixels through difference computation. Ni et al. (2006) had given a scheme where the secret message is embedded at the histogram’s peak point of the cover image. Afterward, Xiao et al. (2010) had given a method where the cover image is segmented into equal-sized blocks and each block’s histogram embedded secret message in it. Celik et al. (2005) depicted a steganographic methodology for compressed cover image pixels. Qian et al. (2016) exhibited a separable reversible data hiding algorithm where the cover image is encrypted through a block cipher algorithm. In this paper (Zhang 2011), firstly segmented cover image into equal-sized blocks, and after that each block is further subdivided into two sub-blocks where one bit of secret message is embedded in it. The secret message is extracted through the computation of fluctuation function corresponding to each block. But during the computation of fluctuation function, boundary pixels are to be excluded which results in high bit error rate value. Xiaotian and Sun (2014) exhibited a method where blocks are further segmented into two sub-blocks. Embeddable pixel’s neighbors are not selected for data embedding which results in high peak-signal-to-noise-ratio (PSNR) value and low bit error rate respectively. Hong et al. (2012) included boundary pixels during computation of fluctuation function which results in the same PSNR value and low bit error rate value as compare to Zhang (2011). In this paper Kim et al. (2015) segmented cover image into equal-sized blocks and after that each block is further subdivided into two sub-blocks where one bit of secret message is embedded in it using the concept of a lattice. Embeddable pixel’s four-connectivity neighbors are not selected for data embedding which results in high PSNR value and low bit error rate value. Ma et al. (2013) proposed a reversible data hiding method where embedding space is reserved before encryption of cover image. Liao and Shu (2015) improved computation of fluctuation function by calculating the mean difference of neighboring pixels. Paillier cryptosystem (Paillier 1999) is utilized for encryption of cover image in Chen et al. (2014) where one bit of secret message is embedded per pixel pair. Tai and Chang (2018) proposed a separable reversible data hiding algorithm where embedding space is reserved before encryption of cover image. Puech et al. (2008) proposed a method of the local standard deviation of the encrypted image for the extraction of hidden data during the decryption phase. Bhardwaj and Aggarwal (2018) introduced a reversible data hiding algorithm in an encrypted domain where n secret bits are embedded per block by segmenting them into n sub-blocks. The drawback of this method is that for small block size, the secret message is not extracted correctly which results in a high bit error rate.

Tzu-Chuen et al. (2015) had given a method where dual stego images are generated by folded secret message centrally. Yao et al. (2017) described a dual-image method based on pixel co-ordinate system which results in minimum distortion of pixel’s coordinate value. Lee and Huang (2013) presented a method where dual stego images are generated through an orientation combination of pixel coordinates. Here, binary secret message by changed over it into \(base_{5}\) numeral framework is embedded which results in improved embedding rate. Chi et al. (2018) presented a dynamic encoding scheme where the frequent occurrence of secret digits is encoded as the minimum absolute digit. The favored stance denotes that for the same embedding rate, the proposed method gave a higher PSNR than existing methods. Tzu-Chuen et al. (2017) proposed a frequency encoding method to eliminate the disadvantage of Tzu-Chuen et al. (2015) strategy.

Shiu et al. (2017) employed a reversible scheme for preservation of patient information in ECG signals through error correcting-coding method where \((n-m)\) bits of secret message are embedded into n number of signals with the help of (nm) hamming code successfully. Bhalerao et al. (2019) embedded patient data in ECG signals using a prediction error expansion scheme where prediction of the sample values is performed through deep neural network respectively. The most significant commitment of proposed work is its multipurpose nature: ownership detection, tamper localization, and 100% reversibility. Mansour and Abdelrahim (2019) proposed a highly robust reversible data hiding method in encrypted domain where patient data is hidden in medical images with the help of discrete ripplet transformation technique successfully. The most significant commitment of proposed work is to employ adaptive genetic algorithm for optimal pixel adjustment process that enhances embedding capacity as well as imperceptibility features also.

The remaining paper is organized as follows—Sect. 3 carried out a brief description of the proposed algorithm. Further, discussions are conducted in Sect. 4 for comparison of embedding performance and visual quality of the proposed algorithm with the compared algorithms. At last, Sect. 5 concluded the paper.

3 Proposed algorithm

Nowadays, patient data privacy and security is one of the most significant challenges for telemedicine applications. Consider a scenario where the patient’s data is sent to the doctor/surgeon; the hacker may observe the healthcare information. Later, an attacker may float this information on social sites and this action may put tremendous threats to the patient’s confidentiality. The appropriate encryption and authentication schemes can be useful to prevent these types of attacks. Thus, an enhanced reversible data hiding method in the encrypted domain has been introduced here that gives higher embedding rate than all the looked at reversible data hiding methods by embedding k, (\(k\ge 1\)) binary bits of electronic patient information by changed over it into \(base_{10}\) numeral framework at every pixel of the cover image without any occurrence of underflow and overflow problem. The data embedding algorithm is discussed in detail in Sect. 3.1 while as data extraction and image recovery algorithm is discussed in detail in Sect. 3.2.

3.1 Data embedding phase

The cover image was set to CI = [\(P_{1,1},P_{1,2},\ldots ,P_{M,N}\)],where M and N are the image height and width, respectively. To avoid image distortion caused by a large value of EPI (w), it was further reduced by using (Tzu-Chuen et al. 2015)’s method as follows:

$$\begin{aligned} w_{u,v}^{'}=w_{u,v}-2^{k-1} \end{aligned}$$
(1)

Now, the range of secret message is changed from \(R=[0,1,2,\ldots ,2^{k}-1]\) to \(R^{'}=[-2^{k-1},-2^{k-1}+1,\ldots ,-1,0,1,\ldots ,2^{k-1}-2,2^{k-1}-1]\).

The following algorithm demonstrates the data embedding phase of our proposed approach:

figure a

3.2 Data extraction and image recovery phase

The process of extraction of secret message in \(base_{10}\) numeral framework and recovery of cover image is shown in the following algorithm:

figure b

Example

Detailed execution of proposed algorithm \((k=3)\) is shown in Table 1.

Table 1 Execution of proposed method
Fig. 1
figure 1

Test images

Fig. 2
figure 2

Watermark

4 Results and discussions

Here, we examine the performance of the proposed method which is evaluated using metrics like peak signal to noise ratio (PSNR), mean square error (MSE), structural similarity index matrix (SSIM), normalized cross-correlation (NCC), normalized absolute error (NAE), bit error rate (BER) and embedding rate (bpp) respectively. PSNR, SSIM, NCC are used to evaluate the quality of stego images while BER is used to evaluate the error between embedded and extracted watermark. The experimental study is performed on test images of size \({512 \times 512}\) and binary watermark of size (\(256 \times 256\)), as shown in Figs. 1 and 2. Let f(xy), \({\hat {f}} (x,y)\)denote the value of pixel (xy) in the cover and stego image of size \(M \times N\) and sm and \(sm^{'}\) is embedded and extracted watermark, where \(A \times B\) is the size of the watermark.

These metrics are defined as follows:

$$\begin{aligned} PSNR=10 \;log_{10} \frac{255^2}{MSE} \end{aligned}$$
(4)

where

$$\begin{aligned} MSE= & {} \frac{1}{M\times N}\sum _{x=1}^{M}\sum _{y=1}^{N}(f(x,y)-\hat{f}(x,y))^2 \nonumber \\ SSIM(x,y)= & {} \frac{(2\mu _x\mu _y+c_1)(2\sigma _{xy}+c_2)}{(\mu _x^2+\mu _y^2+c_1)(\sigma _x^2+\sigma _y^2+c2)} \end{aligned}$$
(5)

where \(\mu _x\) is average of x, \(\mu _y\) is average of y, \(\sigma _x^2\) is variance of x, \(\sigma _y^2\) is variance of y, \(\sigma _{xy}\) is covariance of x and y, \(c_1=(k_1L)^2, c_2=(k2L)^2, L=(2^8-1), k_1=0.01\) and \(k_2=0.03\) respectively.

$$\begin{aligned}&NCC=\frac{\sum _{x=1}^{M}\sum _{y=1}^{N}f(x,y)\hat{f}(x,y)}{\sqrt{\sum _{x=1}^{M}\sum _{y=1}^{N}f(x,y)^2\sum _{x=1}^{M}\sum _{y=1}^{N}\hat{f}(x,y)^2}} \end{aligned}$$
(6)
$$\begin{aligned}&NAE=\frac{\sum _{x=1}^{M}\sum _{y=1}^{N}\mid f(x,y)-\hat{f}(x,y)\mid }{{\sum _{x=1}^{M}\sum _{y=1}^{N} \mid f(x,y)} \mid } \end{aligned}$$
(7)
$$\begin{aligned}&R=\frac{Payload}{M \times N} \end{aligned}$$
(8)
$$\begin{aligned}&BER = \frac{\sum _{i=1}^{A}\sum _{j=1}^{B}{(\,sm(i,j) \oplus sm^{'}(i,j)\,)}\times 100}{Count\_of\_embedded\_bits} \end{aligned}$$
(9)

4.1 Imperceptibility analysis

Imperceptibility points out to the capability of a data hiding method that assures, no perceptible degradation occurs to cover image during the data embedding process respectively. Here, we examined the performance of the proposed method with the existing state-of-the-art algorithms of Tzu-Chuen et al. (2015), Yao et al. (2017), Lee and Huang (2013), Chi et al. (2018) and Tzu-Chuen et al. (2017) respectively. It is obvious from the obtained values of quality metrics, average PSNR value (48.65 dB), high SSIM value coupled with NCC value of approximate unity specify that proposed algorithm is capable of providing high-quality images for a payload of 262,144 bits respectively (Table 2). Table 3 demonstrates the examination of the proposed algorithm with all other compared algorithms regarding the embedding rate and PSNR value attained on test images exhibited in Fig. 1 respectively. It is examined from the Table 3 that the proposed algorithm gives a high embedding rate in encrypted domain with content authentication at receiver end while all other compared methods did not. Embedding capacity and PSNR value are reciprocal to each other, with the increase in embedding capacity there is an inherent loss of PSNR value respectively. Even then, the PSNR values obtained by the proposed approach are quite comparable to those obtained by compared methods. From the Table 3, it can be examined effectively that the proposed scheme gave maximum embedding rate for all test images with maintaining a good visual quality of stego images respectively. For some test images, after data embedding phase, the proposed method successfully preserved original pixel values of the cover image which implied that cover image and stego image are identical to one another and yield a PSNR value \(\infty\) dB (Fig. 3a).

Table 2 Study of proposed method in terms of imperceptive parameters (payload=262,144 bits)
Fig. 3
figure 3figure 3

a, b Graphs comparing PSNR value on different payload values obtained by the proposed and the compared methods

Table 3 Comparative study of proposed method

It is noted from Fig. 3 that even at high payloads, the proposed method gave good quality stego image while compared methods did not because their decreased embedding rates can’t work at high payloads. The unparalleled performance of the proposed method on all test images is ascribed to its capacity to deal with the low as well as high-intensity pixels which can arise the underflow and overflow issue during data embedding phase in compared methods. Some compared methods, simply avoid these pixels, or as it named them as non-embeddable cases. Noted that, in natural images, the proportion of low-intensity pixels is extremely less as compared to medical images. So that, all the compared methods have good embedding rate in contrast with those achieved by them on medical images. The embedding rate of the proposed strategy is most prominent than other compared methods and the visual quality of stego image produced by the proposed method is at standard with all the compared methods (Fig. 4). The predominant performance of the proposed methodology on medical images is credited to its ability to deal with the low-intensity pixels, which can cause the underflow problem while embedding data into them. In the compared methods, they overlooked these low-intensity pixels, or at the end of the day name them as non-embeddable cases. Since, in medical images, the number of low-intensity pixels is exceptionally high, neglecting them causes loss of embedding rate. The proposed method has not been suffering from underflow and overflow problem so that empowering it to embed and recover information precisely from low-intensity pixels too. This property makes our proposed method truly reasonable for its utilization on medical images. In this manner it very well may be inferred that, for medical images, the proposed method altogether beat all the compared methods in its ability to embed secret information and precisely recover it with maintaining the visual nature of stego images too.

Fig. 4
figure 4

Comparative study of proposed method

4.2 Security and robustness analysis

4.2.1 Histogram analysis

Stego images attained through a specific data hiding method are generally exposed to histogram analysis by attackers to get a hint about what has been embedded in it. Generally, a steganalyst gets a hint about embedded information through a comparison of corresponding histograms. A data hiding method is viewed as robust to this sort of attack if corresponding histograms are closely identical to each other. Figure 5 show histograms of different medical cover images and corresponding stego images. As is observed from the Fig. 5 that the proposed method is robust to this attack because corresponding histograms are closely identical to each other and their absolute difference is zero for almost all the intensity values.

Fig. 5
figure 5

a Histogram of cover images, b Histogram of corresponding stego images

4.2.2 Authentication analysis

To evaluate the performance of the proposed method for its hidden message authentication, we subject stego image to well-known image processing attacks. As the secret message is embedded in the spatial domain so that the proposed algorithm is fragile in nature. The authentication analysis is carried out to calculate the degree of degradation in secret message due to a predefined attack which has been calculated in terms of BER (bit error rate) respectively. For the hidden message authentication at the receiver end, we embedded a watermark inside the cover image. At the receiver end, the extracted watermark is compared with the original one, if both watermarks are not matched with each other, it is accepted that the stego image and the hidden message is not legitimate. To assess the performance of the proposed method for its embedded message authentication, we subject stego image to well-known image processing attacks on random test images with the embedding of the watermark (cameraman) of size \((256 \times 256)\) respectively. From the outcomes for different attacks which are referenced in Table 4, it is obvious that our strategy is profoundly fragile to every one of the attacks completed on different stego images and is approved by the way that the recovered watermark in the majority of the cases is not recognizable, thus demonstrative that the stego image has been attacked during transmission. Bit error rate value is around (35–55)% which concluded that extracted secret message in all of the cases is not recognizable, hence this is indicated that stego image has been attacked during transmission. High bit error rates for test images, approve the way that the proposed method is profoundly fragile, irrespective of the type of cover image.

Table 4 Authentication analysis

4.3 Reversibility analysis

At the receiver end, after extraction of the secret message, cover image is also reconstructed through stego image successfully. Table 5 shows reversibility analysis of the proposed method which consists of the original cover image, corresponding recovered image, difference image, and PSNR value between the original and reconstructed cover image in dB. From the outcomes which are referenced in Table 5, it is obvious that the difference image is perfectly black with each pixel intensity equivalent to zero and corresponding PSNR value is \(\infty\) dB thus demonstrative that the proposed scheme is purely reversible in nature. Similarly, all pixel values of the cover image are retrieved and finally, the extraction of secret message and reconstruction of the original cover image is not done successfully at the receiver end. So, it is to be concluded that stego image has been attacked during the transmission process.

Table 5 Reversibility analysis
Table 6 Computational complexity comparison of proposed method

Theorem 1

The proposed method can not extract the secret message and reconstruct the original cover image at the receiver end successfully if stego image has been attacked during transmission.

Proof

Consider any pixel value \((P_{u,v}= 2^{k})\) in cover image (CI) which is divided into two units \(x_{u,v}\) and \(y_{u,v}\) as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} P_{u,v} = x_{u,v}+y_{u,v}\\ where\quad x_{u,v}=\lfloor \frac{P_{u,v}}{2}\rfloor =2^{(k-1)}\quad \\ y_{u,v} =P_{u,v}-x_{u,v}=2^{(k-1)}\\ \end{array}\right. } \end{aligned}$$

To avoid image distortion caused by a large value of \(w_{u,v}\) (EPI), it was further reduced by using (Tzu-Chuen et al. 2015)’s method as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} w_{u,v}^{'}=w_{u,v}-2^{k-1} \end{array}\right. } \end{aligned}$$

After embedding \(w_{u,v}^{'}\) into \(x_{u,v}\) and \(y_{u,v}\), they will be changed into \(x^{*}_{u,v}\) and \(y^{*}_{u,v}\) as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} x_{u,v}^{*}=2^{(k-1)}+w_{u,v}^{'}\\ y_{u,v}^{*}=2^{(k-1)}-w_{u,v}^{'} \end{array}\right. } \end{aligned}$$

Assume noise (\(\delta\)) is introduced due to attack on stego image which has been taken place during transmission process. It is introduced into \(x^{*}_{u,v}\) and \(y^{*}_{u,v}\) as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} x_{u,v}^{*}=2^{(k-1)}+\delta +w_{u,v}^{'}\\ y_{u,v}^{*}=2^{(k-1)}-w_{u,v}^{'} \end{array}\right. } \end{aligned}$$

At receiver end, firstly compute \(d_{u,v}^{'}= x_{u,v}^{*}-y_{u,v}^{*}=2w_{u,v}^{'}+\delta\)

$$\begin{aligned} {\left\{ \begin{array}{ll} Now \;d_i^{'} \in [(-2^{k}-1)\ldots (2^{k}-1-2)]\\ d_{u,v}^{'}\; \%\; 2 \ne 0\; \\ \;w_{u,v}^{'}=\frac{d_{u,v}^{'}+1}{2}=\frac{2w_{u,v}^{'}+\delta +1}{2}\\ w_{u,v} =w_{u,v}^{'}+2^{k-1}\;\\ =\frac{2w_{u,v}^{'}+\delta +1}{2}+2^{k-1}\ne w_{u,v}\\ z_{u,v} =x_{u,v}^{*}+y_{u,v}^{*}= 2^{k-1}+\delta +2^{k-1}=2^k+\delta \ne P_{u,v}\\ \end{array}\right. } \end{aligned}$$

\(\square\)

Theorem 2

The proposed method is reversible in nature so that after extraction of the secret message, it reconstructs the original cover image at the receiver end successfully.

Proof

Consider any pixel value \((P_{u,v}= 2^{k})\) in cover image (CI) which is divided into two units \(x_{u,v}\) and \(y_{u,v}\) as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} P_{u,v} = x_{u,v}+y_{u,v}\\ where\quad x_{u,v}=\lfloor \frac{P_{u,v}}{2}\rfloor =2^{(k-1)}\quad \\ y_{u,v} =P_{u,v}-x_{u,v}=2^{(k-1)}\\ \end{array}\right. } \end{aligned}$$

So that, to avoid image distortion caused by a large value of \(w_{u,v}\) (EPI), it was further reduced by using (Tzu-Chuen et al. 2015)’s method as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} w_{u,v}^{'}=w_{u,v}-2^{k-1} \end{array}\right. } \end{aligned}$$

After embedding \(w_{u,v}^{'}\) into \(x_{u,v}\) and \(y_{u,v}\), they will be changed into \(x^{*}_{u,v}\) and \(y^{*}_{u,v}\) as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} x_{u,v}^{*}=2^{(k-1)}+w_{u,v}^{'}\\ y_{u,v}^{*}=2^{(k-1)}-w_{u,v}^{'} \end{array}\right. } \end{aligned}$$

At receiver end extract the secret message \(w_{u,v}\) and reconstruct cover image (CI) as follows:

Firstly, compute \(d_{u,v}^{'}= x_{u,v}^{*}-y_{u,v}^{*}=2w_{u,v}^{'}\) as follows:

$$\begin{aligned} {\left\{ \begin{array}{ll} Now \;d_{u,v}^{'} \in [-2^{k}\ldots (2^{k}-2)]\\ d_{u,v}^{'}\; \%\; 2 =0\; \\ \;w_{u,v}^{'}=\frac{d_{u,v}^{'}}{2}=w_{u,v}^{'}\\ w_{u,v} =w_{u,v}^{'}+2^{k-1}\;=w_{u,v}\\ z_{u,v} =x_{u,v}^{*}+y_{u,v}^{*}= 2^{k-1}+2^{k-1}=2^k=P_{u,v}\\ \end{array}\right. } \end{aligned}$$

\(\square\)

4.4 Computational complexity

The time complexity is computed when proposed method and compared methods are run on a laptop with Intel i5@2.40 GHz CPU and 8 GB RAM. As shown in Table 6, execution time of proposed method is more as compared to the methods of Tzu-Chuen et al. (2015), Yao et al. (2017), Lee and Huang (2013), Chi et al. (2018), Tzu-Chuen et al. (2017) for test medical images but the embedding rate of the proposed strategy is most prominent than other compared methods and the visual quality of stego image produced by the proposed method is at standard with all the compared methods (Fig. 3).

5 Conclusion

In this work, an enhanced reversible data hiding method in the encrypted domain has been implemented and tests against well-known image processing attacks also. The proposed algorithm has not been suffering from underflow and overflow problem and altogether beat all the compared methods with yielded an embedding rate of three bits per pixel (\(k=3\)) for medical images respectively. In future, the focus will be on improving the robustness of the proposed method because it has been carried out in the spatial domain so that not robust to various image processing attacks.