1 Introduction

In the present era, the people are globally connected through various platforms like social media, e-healthcare, e-commerce, e-business, etc. where they share information in the form of different multimedia components. In social media, people share their private data quite easily at any moment and from any location. In e-healthcare based applications, patients are uploading their medical report to receive an expert opinion from any specialized hospitals. Similarly, nowadays, the availability of any particular product is not a big concern due to the advancement of e-commerce and e-business based applications. In all these applications, the gigantic volume of digital data is exchanged through the Internet. However, the Internet itself is not a protected or secured communication medium, so fraudulent users may effortlessly intercept the transmitted data. As a result, security is an integral part of the transmission of secret data. Different security mechanisms have been adopted to protect the security of essential data in terms of confidentiality [23], integrity [23], and authentication [23]. These security services are achieved in different ways like (a) cryptography and steganography for protecting the confidentiality property, (b) cryptographic hash function and fragile watermarking for ensuring the integrity, and (c) digital signature and robust watermarking for holding the authentication property. In this paper, we have addressed the integrity issue in digital images, which are considered as the most widely used multimedia component. In fragile watermarking, the authentication code is computed from some selective components of an image, and thereafter the authentication code is concealed into non selected components of the image to form a watermarked image [10]. In the integrity verification process, the authentication code is computed similarly from the watermarked image. Subsequently, the embedded code is extracted from the watermarked image. Both the codes will be the same if the watermarked image is not manipulated or altered by malicious users. In this paper, we have suggested a novel fragile watermarking scheme with the intention to improve the visual quality of the watermarked image as well as to realize the high level of tamper detection capability. In this work, the payload embedding is carried out based on the suggested embedding approach, i.e., block-level pixel adjustment process (BPAP). The proposed work is presented in two aspects, i.e., Hamming code-based authentication code generation and later concealing the encrypted authentication code into the cover image by BPAP approach.

In literature, a number of the digital image based fragile watermarking schemes are found to protect the integrity property of the image content. He et al. [6] have suggested a block level fragile watermarking method, which works on non-overlapping blocks of size 8 × 8 pixels. The watermark or authentication codes are primarily computed from each block, and later, the same is hidden randomly into the LSB position of the pixels in original image based on the secret key to protect the embedded payload from various attacks. However, the main limitation of their work is that the tampered region is identified on the block of size 8 × 8 (i.e., 64 pixels) even if only a single tampered pixel is found. However, Chang et al. [4] have proposed a fragile watermark embedding process, which divides the cover image into non-overlapping blocks of size 2 × 2. In [7, 8] have suggested an image tamper detection scheme, which divides the digital image into two categories as edge blocks, and non-edge blocks. Watermark is embedded into the digital image based on the characteristics of edge blocks and non-edge blocks and their approaches are found effective to improve the authentication of the digital image.

Several fragile watermarking schemes have incorporated a number of chaotic maps [3, 5, 19, 21] to enhance the security level. Chang et al. [3] have suggested a two-pass logistic-map combining with hamming code to detect tampering in the digital image. The two pass logistic-map contains a private key to resist vector quantization attack. Tong et al. [21] have suggested a fragile watermarking scheme for localization of tampered areas effectively in the digital image which presents the combination of the most significant bit and the least significant bit (LSB) information to embed the payload into the cover image. Chen et al. [5] have presented a self-embedding fragile watermarking scheme using pseudorandom chaos sequence, which is found proficient against various image tampering attacks. Recently, Sreenivas and Kamakshiprasad [19] have proposed an image tamper localization technique, which generates watermark bits or authentication code from 2 × 2 block of the digital image using the chaotic maps and randomly embeds the authentication code or watermark bits into selected distinct blocks. In [20], the authors have computed watermark bits from the first 5 MSBs of each pixel, and later first 3 LSBs of the corresponding pixel are replaced by the watermark bits information. Their scheme also identifies the tampered region successfully. In [11], Nazari et al. have devised another chaotic map based fragile watermarking scheme where the authentication code bits are not fixed throughout the blocks. This adaptive payload embedding approach improves the visual quality of the watermarked image. Trivedy and Pal [22] have presented a fragile watermarking scheme based on pixel-level using logistic-map. The logistic-map generates a chaotic sequence that is used in the key matrix formation, and subsequently the key matrix is realized in the watermark embedding process. Since their scheme is based on the secret key matrix, so it is secure, but it has high computational overhead. Rawat and Raman [17] have developed another chaos based fragile watermarking scheme by employing two chaotic maps, and the initial values are sensitive to the chaotic maps. The parameters of chaotic maps are used as the secret key. This process improves the security-level of the watermark. Researchers also devise several fragile watermarking schemes based on Hamming code [2, 3]. Chana et al. [2] have presented an image authentication using the combination of the Hamming code technique, Torus automorphism, and bit rotation technique to identify tampering effectively. This hybrid scheme can efficiently remove burst bit errors, and recover the pixels. In [13, 14, 18], the common attacks on watermarked images are simply influenced by the eavesdropper. In this way, the tampering is not visually recognizable. This type of attacks causes serious issues in the medical data [1, 25] where the proper diagnosis depends especially on correct medicals reports. Recently, Bravo-Solorio et al. [1] have proposed a fragile watermarking scheme where the computation overhead of the payload embedding process is reduced. Peng et al. [12] have presented an image authentication technique, which is implemented with two identical host images. Their scheme embeds the secret data into one host image and the some supplementary data is embedded into another host image. Yin et al. [26] have proposed the reversible image authentication scheme based on the Hilbert Curve mapping, where pixels are first mapped to a one-dimensional vector using the Hilbert Curve, and divided into non-overlapping sets. The reversible secret data embedding technique embeds the authentication codes into each non-overlapping set. Qin et al. [15] have suggested a novel self-embedding fragile watermarking proposal based on vector quantization (VQ) and index contribution where the embedding of watermark bits depend on hash-bits generation. Later, Qin et al. [16] have given another improved fragile watermarking method based on overlapping embedding strategy with high-quality recovery capability. It is also found effective during localization of tampered regions. Lo et al. [9] have proposed a reversible image authentication scheme for digital images. The watermark or authentication codes are embedded into the cover image, which is generated by the selected random number seed.

The above discussed fragile watermarking schemes are basically suitable for localizing the tampered regions if any image alteration happens intentionally/unintentionally. In this paper, we have suggested another fragile watermarking scheme with enhanced properties. In this contributed work, the authentication code is generated from the most significant bits of pixels using Hamming code, and later the authentication code is further encrypted by secret bit streams which are generated using logistic-map. Further, the encrypted code is embedded into the least significant bits of pixels using the novel BPAP. The indirect payload embedding process is more suitable for retaining the high visual quality of the watermarked image. The above procedure presents an excellent secure fragile watermarking scheme, as well as exhibits the decent visual quality of watermarked images. The main contributions of the proposed work are as follows:

  • Proposed scheme enhances the level of security of a fragile watermarking scheme since the authentication code is generated using the Hamming code and logistic-map.

  • This approach increases the level of visual quality compared to other fragile image watermarking schemes because the watermark embedding process is carried out using the suggested BPAP.

  • Proposed scheme effectively locates the tampered regions if any alteration occurred in the image content.

  • Proposed procedure is effective and acceptable in terms of various perceptual quality measures.

The rest of the paper is presented as follows. In section 2, the related preliminaries are briefly discussed. The proposed fragile digital image watermarking scheme is presented in Section 3, where watermark embedding, watermark extraction, and tamper detection procedures are elaborated in three different sub-sections. The experimental results related to watermark embedding, watermark extraction, and tamper detection procedure are demonstrated in Section 4. Finally, the conclusion of the paper is drawn in Section 5.

2 Preliminaries

In this section, the logistic map based key sequence generation, and (7, 4) Hamming codes are discussed briefly. These are used in the proposed work for generating secure watermark bits. Subsequently, the suggested BPAP is based on pixel-value differencing (PVD) concept, so the working process of PVD is also described briefly.

2.1 Logistic map based key sequence

The logistic map based key sequence is commonly used in various security mechanisms. It has wide applications in the field of watermarking. A secret key sequence can be produced by considering the seed values of the logistic map. In this work, a secret key matrix is derived using the logistic map. It effectively generates a random sequence using the Eq. 1 and Eq. 2 respectively. The initial parameters like β and α0 are considered as seed values. The subsequently generated sequences are as follows:

$$ {\alpha}_1=\beta \times {\alpha}_0\times \left(1-{\alpha}_0\right)\kern0.1em $$
(1)
$$ {\alpha}_{\left(\mathrm{i}\right)}=\beta \times {\alpha}_{\left(\mathrm{i}-1\right)}\times \left(1-{\alpha}_{\left(\mathrm{i}-1\right)}\right) $$
(2)

The sender and the receiver are able to produce the same sequence if they are using the same seed values i.e., β and α0.

2.2 Hamming code

In coding theory, the Hamming code is one of the popular linear error correcting codes. This section presents the (7, 4) Hamming code which has four data bits and adds three parity bits. Hamming codes are generated by multiplying the information bits with the generator matrix.

The systematic generator matrix for the (7, 4) Hamming code is given below:

$$ G=\left[\begin{array}{l}1\kern0.85em 0\kern1.05em 0\kern0.85em 0\kern0.95em 1\kern0.75em 1\kern0.85em 1\\ {}0\kern0.85em 1\kern0.95em 0\kern0.85em 0\kern0.95em 1\kern0.8500001em 0\kern0.75em 1\\ {}0\kern0.85em 0\kern1.05em 1\kern0.85em 0\kern0.85em 1\kern0.75em 1\kern0.65em 0\\ {}0\kern0.9500001em 0\kern0.95em 0\kern0.95em 1\kern0.8000001em 0\kern0.65em 1\kern0.65em 1\end{array}\right]\kern0.1em $$
(3)

Also, the parity-check matrix in the systematic form is as follows:

$$ H=\left[\begin{array}{l}1\kern0.85em 1\kern1.05em 1\kern0.85em 0\kern0.95em 1\kern0.75em 0\kern0.85em 0\\ {}1\kern0.65em 0\kern0.95em 1\kern0.85em 1\kern0.95em 0\kern0.8500001em 1\kern0.75em 0\\ {}1\kern0.85em 1\kern1.05em 0\kern0.85em 1\kern0.85em 0\kern0.75em 0\kern0.65em 1\end{array}\right]\kern0.1em $$
(4)

2.3 Pixel-value differencing (PVD)

The pixel-value differencing (PVD) [24] is one of the indirect data hiding approaches. In this mechanism, initially the cover image is decomposed into the non-overlapping block of two consecutive pixels i.e., a block of size 1 × 2 pixels. Subsequently, the secret message bits are concealed into each block based on the nature of pixels Qi and Qi + 1 of each block. The difference value, diffi between two pixels is computed by diffi =  ∣ Qi − Qi + 1∣. The diffi value is further quantized into several regions, as shown in Fig. 1. Each region is identified by the lower and upper bound values i.e., [loweri,   upperi]. The number of payload bits (k) in each block depends on the quantization range table and it is determined ask = ⌊log2(upperi − loweri + 1)⌋. The obtained bit sequence is converted into decimal value (kd). Later, a new difference value \( \left({diff}_i^{\hbox{'}}\right) \) is obtained as \( {diff}_i^{\hbox{'}}={k}_d+{lower}_i \).

Fig. 1
figure 1

The quantization range table

The modified pixel values are computed based on the following Eq.5.

$$ \left({Q}_i^{\hbox{'}},{Q}_{i+1}^{\hbox{'}}\right)=\left\{\begin{array}{l}\left({Q}_i+\left\lceil l/2\right\rceil, {Q}_{i+1}-\left\lfloor l/2\right\rfloor \right), if\;{Q}_i\ge {Q}_{i+1}\; and\;{diff}_i^{\hbox{'}}>{diff}_i\\ {}\left({Q}_i-\left\lfloor l/2\right\rfloor, {Q}_{i+1}+\left\lceil l/2\right\rceil \right), if\;{Q}_i<{Q}_{i+1}\; and\;{diff}_i^{\hbox{'}}>{diff}_i\\ {}\left({Q}_i-\left\lceil l/2\right\rceil, {Q}_{i+1}+\left\lfloor l/2\right\rfloor \right), if\;{Q}_i\ge {Q}_{i+1}\; and\;{diff}_i^{\hbox{'}}\le {diff}_i\\ {}\left({Q}_i+\left\lceil l/2\right\rceil, {Q}_{i+1}-\left\lfloor l/2\right\rfloor \right), if\;{Q}_i<{Q}_{i+1}\; and\;{diff}_i^{\hbox{'}}\le {diiff}_i\end{array}\right\} $$
(5)

where, \( l=\left|{diff}_i^{\hbox{'}}-{diff}_i\right| \).

Afterwards, pixels Qi and Qi + 1 of each block are replaced by the stego-pixels \( {Q}_i^{\hbox{'}} \) and \( {Q}_{i+1}^{\hbox{'}} \). The receiver will find the difference of i-th block \( {diff}_i^{\hbox{'}}=\left|{Q}_i^{\hbox{'}}-{Q}_{i+1}^{\hbox{'}}\right| \). The difference \( {diff}_i^{\hbox{'}} \) is used to search the number of concealing bit streams in i-th block using the quantization range given in Fig. 1. Finally, the secret bit streams are obtained after converting the decimal value of \( \left({diff}_i^{\hbox{'}}-{lower}_i\right) \) into binary form. An example of the PVD process is illustrated below.

Example 1

The embedding procedure is illustrated based on consideration of two consecutive pixels i.e., 102 and 120; and the secret message bits stream i.e., (1011)2.

Solution

Calculate diffi = |120–102| = 18, it decides the secret message bits embedding capacity/payload into two consecutive pixels.

$$ {\displaystyle \begin{array}{c}k=\left\lfloor {\log}_2\left({upper}_i-{lower}_i+1\right)\right\rfloor =\left\lfloor {\log}_2\left(31-16+1\right)\right\rfloor =\left\lfloor {\log}_2\left({2}^4\right)\right\rfloor =4 bits\\ {}{diff}_i^{\hbox{'}}={lower}_i+\mathrm{Sec} ret\kern0.2em message\kern0.3em \left( In\kern0.34em decimal\kern0.17em representation\right)\\ {}{diff}_i^{\hbox{'}}=16+11=27\kern0.5em and\kern0.6em l=\left|{diff}_i^{\hbox{'}}-{diff}_i\right|=\left|27-18\right|=9\end{array}} $$

The modified new pixel values are calculated using Eq. 5.

$$ {\displaystyle \begin{array}{l}\left({Q}_i^{\hbox{'}},{Q}_{i+1}^{\hbox{'}}\right)=\left(102-4,120+5\right)\kern0.24em if\;102<120\; and\;27>18\\ {}\left({Q}_i^{\hbox{'}},{Q}_{i+1}^{\hbox{'}}\right)=\left(98,125\right).\end{array}} $$

3 Proposed scheme

In this scheme, the authors have proposed a secure fragile watermarking scheme, where the watermark bits are embedded into a grayscale cover image based on the suggested BPAP. In this work, the authors have considered a new quantization range table for BPAP. The newly modified quantization range table has eight regions: i.e., R1, R2, R3,R4, R5, R6, R7, and R8 respectively. The embedding capacity of each region has a constant size of three bits. The newly quantization range table is shown in Fig. 2.

Fig. 2
figure 2

The new quantization range table

Later, a logistic map generates the chaotic sequence values using Eq. 1 and Eq. 2. The sequence values are found in the range from 0 to 1. This sequence is converted into a binary number of 3 bits representation based on the Eq. (6–9). An illustration of the process of generating the binary secret key sequence is depicted in Fig. 3 where it shows the mapping process of a logistic map based generated real value into corresponding 3 bits binary data.

Fig. 3
figure 3

Process of binary secret key generation

$$ {A}_i={\alpha}_{\mathrm{i}}\times 255\kern0.1em $$
(6)
$$ {B}_i= round\left({A}_{\mathrm{i}}\right)\kern0.1em $$
(7)
$$ {C}_i=\operatorname{mod}\left({B}_{\mathrm{i}},8\right) $$
(8)
$$ {K}_i={\left({C}_i\right)}_2\kern0.1em $$
(9)

The above mentioned newly quantization range table and the logistic map based generated secret key sequence are considered in the watermark embedding procedure, the watermark extraction procedure, and the tamper detection procedure, respectively. In the following subsections, we have demonstrated the working procedure of each process with suitable diagrams along with algorithmic steps.

3.1 Watermark embedding procedure

In this procedure, we have considered the grayscale cover image of 256 intensity levels, and in the watermark embedding process, each pixel is converted into eight bits of binary data representation. The eight bits binary data are divided into two categories, where in the first category, two bits of binary data is obtained from 1st position MSB content and 2nd position MSB content. In the second category, first six LSB bits (i.e. information from 6thLSB, 5thLSB, 4thLSB, 3rdLSB, 2ndLSB, and 1stLSB) are stored collectively. In this paper, the first category is represented as Component-1, and the second one is denoted as a Component-2. Here, we have formed 4 bits of information using Component-1 from a block where each block contains two pixels. Three parity bits is obtained from 4 bits of information using the Hamming code. The 3-bit parity is considered as watermark or authentication code and subsequently, these bits are encrypted after performing XOR operation using logistic map based generated secret 3 bits binary sequence. The encrypted watermark bits are embedded into Component-2 of that particular block. The embedding process is done using the suggested BPAP where our main concern is to retain the high visual quality of the watermarked image. The major steps of the watermark embedding procedure is shown diagrammatically in Fig. 4, and the details steps of the watermark embedding process is depicted with an example in Fig. 5. Further, the watermark embedding procedure of the proposed work is presented in Algorithm 1.

Fig. 4
figure 4

The major steps of the watermark embedding procedure

Fig. 5
figure 5

The details steps of the watermark embedding procedure

figure c

Example 2

An illustration for embedding of the watermark is presented here. Suppose 155 and 120 are two consecutive non-overlapping pixels of a block from the grayscale cover image and a secret key, K is (101)2.

Solution

The first cover pixel, \( P={(155)}_{10}={\left(10\underline{011011}\right)}_2 \) and adjusted pixel value is S=Component-2 in decimal (i.e. information bits from first six LSB position of first pixel, P), so \( S={\left(\underline{011011}\right)}_2={(27)}_{10} \) and x = Component-1 (i.e. information bits from 1st and 2nd position MSB content of P) = (10)2. Similarly, for the second cover pixel, \( Q={(120)}_{10}={\left(01\underline {\kern0.1em 1110\kern0.2em 0\kern0.2em 0}\right)}_2 \) find T=Component-2=\( {\left(\underline {\kern0.1em 1110\kern0.2em 0\kern0.2em 0}\right)}_2={(56)}_{10} \) and y = Component-1 = (01)2 are selected from two consecutive non-overlapping pixels P and Q of a block.

Now, four data bits are z = xy = (1 0 0 1)2

$$ \Upsilon ={z}_{1\times 4}\times {G}_{4\times 7}=\left[1\kern0.9000001em 0\kern0.8000001em 0\kern1em 1\right]\left[\begin{array}{l}1\kern0.85em 0\kern1.05em 0\kern0.85em 0\kern0.95em 1\kern0.75em 1\kern0.85em 1\\ {}0\kern0.85em 1\kern0.95em 0\kern0.85em 0\kern0.95em 1\kern0.8500001em 0\kern0.75em 1\\ {}0\kern0.85em 0\kern0.95em 1\kern0.85em 0\kern0.95em 1\kern0.75em 1\kern0.85em 0\\ {}0\kern0.9500001em 0\kern0.85em 0\kern0.85em 1\kern1.1em 0\kern0.65em 1\kern0.85em 1\end{array}\right]={\left(1001\kern0.5em \underline {1\kern0.3em 0\kern0.4em 0}\right)}_2. $$

3-bit parity (100)2 is obtained from the first 3 bits LSB of ϒ. Consider the parity bits (100)2 as the authentication code or watermark bits (W). The 3-bit watermark, W is encrypted with the 3-bits secret key, K = (101)2 using XOR operation as: EW = W ⊕ K = (100)2 ⊕ (101)2 = (001)2 = (1)10. Now, compute the difference value of S and T based on diff = |S − T| = |27 − 56| = 29. The diff value belong to R4 in Fig. 2. Later, compute diff '  = lower _ rangei + EW = 24 + 1 = 25. Find the difference value, l = |diff − diff'| = |29 − 25| = 4  . Considering the case :   S < T and diff '  < diff.

We have obtained as (Sw, Tw) = (S + ⌈l/2⌉, T − ⌊l/2⌋) = (27 + 2,  56 − 2) = (29,  54).

The original watermarked pixels are obtained based on the following process

$$ {\displaystyle \begin{array}{l} Pw=P-\mathit{\operatorname{mod}}\left(P,{2}^6\right)+ Sw=155-\mathit{\operatorname{mod}}\left(155,{2}^6\right)+29=157.\\ {}\ Qw=Q-\mathit{\operatorname{mod}}\left(Q,{2}^6\right)+ Tw=120-\mathit{\operatorname{mod}}\left(120,{2}^6\right)+54=118.\\ {}\left( Pw, Qw\right)=\left(157,118\right).\end{array}} $$

Finally, watermarked pixels are 157, and 118.

3.2 Watermark extraction procedure

In this subsection, the watermark extraction procedure is discussed. Figure 6 shows the brief outline of the watermark extraction process.

Fig. 6
figure 6

The overview of watermark extraction procedure

In this process, the Component-2 of each block is considered to attain the watermark bits.

The suggested extraction mechanism is employed to extract the watermark bits or authentication code. The detail watermark extraction procedure is further illustrated in Fig. 7. The algorithmic steps of this process are given in Algorithm 2.

Fig. 7
figure 7

The detail watermark extraction procedure

figure d

Example 3

An illustration of the extraction process of the watermark is presented with reference to Example 2. The watermarked pixels are 157 and 118 and the secret key is (101)2.

Solution

The first watermarked pixel, \( Pw={(157)}_{10}={\left(1\kern0.2em 0\kern0.3em \underline {0\kern0.2em 1\kern0.2em 1\kern0.2em 1\kern0.2em 0\kern0.2em 1}\right)}_2 \) and adjusted pixel value is Sw = W _ Component − 2 in decimal (i.e. information bits from first six LSB position of the first watermarked pixel, Pw), so \( Sw={\left(\kern0.2em \underline {0\kern0.2em 1\kern0.2em 1\kern0.2em 1\kern0.2em 0\kern0.2em 1}\right)}_2={(29)}_{10} \). Similarly, for the second watermarked pixel, \( Qw={(118)}_{10}={\left(0\kern0.2em 1\kern0.3em \underline {1\kern0.2em 1\kern0.2em 0\kern0.2em 1\kern0.2em 1\kern0.2em 0}\right)}_2 \) find \( Tw=W\_ Component-2={\left(\underline {1\kern0.2em 1\kern0.2em 0\kern0.2em 1\kern0.2em 1\kern0.2em 0}\right)}_2=54. \) Now, compute the difference value of Sw and Tw based on diffw = |Sw − Tw| = |29 − 54| = 25. The diffw value belong to region R4 in Fig. 2. The encrypted watermark, EW is extracted as follows:

$$ EW= diffw- lower\_{range}_i=25-24={(1)}_{10}={\left(0\kern0.2em 0\kern0.2em 1\right)}_2. $$

The original watermark, W = EW ⊕ K.

Watermark bits, W = (0  0  1)2 ⊕ (1  0  1)2 = (1  0  0)2. Finally, extracted original watermark bits are (100)2.

3.3 Tamper detection and localization region

The recipient received the seed values as secret keys for the Logistic-map from the sender side. Recipient generates 3 bits of the secret key sequence using the Logistic map. Then, the recipient computes three bits of the watermark (W) in a similar procedure as done by the sender side. Further, the recipient extracts the watermark bits from the watermarked image. These bits are checked by comparing the extracted watermark with the generated watermark at the receiver side. If the extracted watermark matches with the generated watermark, then the watermarked image has not tampered. Figure 8 briefly outline the tamper detection procedure, and the detailed procedure is further demonstrated in Fig. 9. Algorithm 3 describes the procedure for tamper detection procedure in proper order.

Fig. 8
figure 8

The overview tamper detection procedure

Fig. 9
figure 9

The details of tamper detection procedure

figure e

Example 4

The receiver side detects the extracted tampered watermark bits. Consider all parameters of Example 2 and suppose the recipient received tampered watermarked pixels as 153 and 116 with secret key bits as (101)2.

Solution

The first tampered watermarked pixels \( {Pw}_T={(153)}_{10}={\left(1\kern0.2em 0\kern0.2em \underline {0\kern0.2em 1\kern0.2em 1\kern0.2em 0\kern0.2em 0\kern0.2em 1}\right)}_2 \) and adjusted pixel value is SwT = W _ Component − 2 in decimal (i.e. information bits from first six LSB position of the first tampered watermarked pixel, PwT), so \( {Sw}_T={\left(\kern0.2em \underline {0\kern0.2em 1\kern0.2em 1\kern0.2em 0\kern0.2em 0\kern0.2em 1}\right)}_2={(25)}_{10} \). Similarly, for the second tampered watermarked pixel, \( {Qw}_T={(116)}_{10}={\left(0\kern0.2em 1\kern0.2em \underline {1\kern0.2em 1\kern0.2em 0\kern0.2em 1\kern0.2em 0\kern0.2em 0}\right)}_2 \) find \( {Tw}_T=W\_ Component-2={\left(\underline {1\kern0.2em 1\kern0.2em 0\kern0.2em 1\kern0.2em 0\kern0.2em 0}\right)}_2=52. \) Now, compute the difference value of SwT and TwT based on diffwT = |SwT − TwT| = |25 − 52| = 27. The diffwT value belong to region R4 in Fig. 2. The encrypted watermark, EW is extracted as follows: EW = diffwT − lower _ rangei = 27 − 24 = (3)10 = (011)2. The extracted watermark bits, W = EW ⊕ K = (011)2 ⊕ (101)2 = (110)2. Later, from first tampered watermarked pixel PwT, x = Component-1 (i.e. information bits from 1st and 2nd position MSB content of PwT,) = (10)2. Similarly, for the second tampered watermarked pixel, QwT, y = Component-1 = (01)2. Now, four bit data is z = xy = (1 0 0 1)2

$$ T={z}_{1\times 4}\times {G}_{4\times 7}=\left[1\kern0.9000001em 0\kern0.8000001em 0\kern1em 1\right]\left[\begin{array}{l}1\kern0.85em 0\kern1.05em 0\kern0.85em 0\kern0.95em 1\kern0.75em 1\kern0.85em 1\\ {}0\kern0.85em 1\kern0.95em 0\kern0.85em 0\kern0.95em 1\kern0.8500001em 0\kern0.75em 1\\ {}0\kern0.85em 0\kern0.95em 1\kern0.85em 0\kern0.85em 1\kern0.75em 1\kern0.85em 0\\ {}0\kern0.9500001em 0\kern0.85em 0\kern0.85em 1\kern1.1em 0\kern0.65em 1\kern0.85em 1\end{array}\right]={\left(1001\kern0.4em \underline{100}\right)}_2. $$

The watermark bits are (100)2.

Hence, watermark bits ≠ extracted watermark bits. So, the block has been identified as tampered in the watermarked image.

4 Experimental results

In this section, the experimental results are demonstrated in two aspects. Firstly, we have presented the experimental results according to the various perceptual quality measures. Subsequently, we have demonstrated the results in order to evaluate the tamper detection capabilities of the proposed work. For depicting the performance of the proposed scheme, eight different types of grayscale cover images have been considered. These cover images are of size 512 × 512 which are shown in Fig. 10(a-h). The resultant images after watermark embedding are exhibited in Fig. 11(a-h) and these results reveal that the visual quality of watermarked images meet the required standards since the watermarked images reveal close similarity with the original cover images under the observation of human visual perception. The perceptual quality of the watermarked images are further measured by some parameters like peak signal to noise ratio (PSNR), structural similarity index (SSIM) and image fidelity (IF). The PSNR is computed based on Eq. 10.

$$ PSNR=10\times {\log}_{10}\left(\frac{255^2}{MSE}\right) dB\kern0.1em $$
(10)

where MSE stands for mean squared error and it is computed using given Eq.11:

Fig. 10
figure 10

(a-h) Original cover images of size 512 × 512

Fig. 11
figure 11

(a-h) Watermarked images based on the proposed methodology

$$ MSE=\frac{1}{M\times N}\sum \limits_{i=0}^{M-1}\sum \limits_{j=0}^{N-1}{\left[{I}_c\left(i,j\right)-{I}_w\left(i,j\right)\right]}^2 $$
(11)

where Ic is a cover image, Iw is a watermarked image, M represents the width and N represents the height of Ic as well as Iw.

High value of peak signal to noise ratio implies higher similarities between a watermarked image and corresponding original cover image. Table 1 depicts that proposed scheme retains considerably high PSNR values even after embedding high payload into the cover image. In all cases the PSNR values are greater than 40 dB. This shows that the watermarked images generated by the proposed procedure, are very close to the original cover image.

Table 1 Experimental results of the proposed scheme

The proposed scheme is evaluated further by other quality parameters like image fidelity (IF) and structural similarity (SSIM) index. The typical SSIM and IF values ranges from 0 to 1. The SSIM values are calculated using following Eq. 12.

$$ SSIM\left({I}_c,\kern0.4em {I}_w\right)=\frac{\left(2{M}_{Ic}{M}_{Iw}+{C}_1\right)\left(2\operatorname{cov}\left({I}_w\right)+{C}_2\right)}{\left({M^2}_{Ic}+{M^2}_{Iw}+{C}_1\right)\left({\sigma^2}_{Ic}+{\sigma^2}_{Iw}+{C}_2\right)}\kern0.1em $$
(12)

where, \( \left\{\begin{array}{l}{C}_1={\left({k}_1D\right)}^2\kern0.6em {k}_1=0.01\\ {}{C}_2={\left({k}_2D\right)}^2\kern0.4em {k}_2=0.03\end{array}\right. \) and.

MIc and MIw are the mean of the original cover image and watermarked image respectively, σ2Ic and σ2Iw are the variance of the original cover image and watermarked image respectively, cov is the covariance of the watermarked image, C1 and C2 are variables for finding constant division with weak dominator and D = 255 which is the self-motivated range of pixel values.

The image fidelity (IF) is another quality measure which can be computed using Eq. 13.

$$ IF=1-\frac{\sum \limits_{i=0}^{M-1}\sum \limits_{j=0}^{N-1}{\left[{I}_c\left(i,j\right)-{I}_w\Big(i,j\Big)\right]}^2}{\sum \limits_{i=0}^{M-1}\sum \limits_{j=0}^{N-1}{\left[{I}_c\left(i,j\right)\right]}^2}\kern0.1em $$
(13)

where Ic is a cover image, Iw is a watermarked image, M represents the width and N represents the height of Ic as well as Iw.

Table 1 also shows the SSIM and IF values obtained on various test images. The proposed watermarking procedure has achieved very high SSIM and IF values which are close to 1. This represents that the watermarked images obtained by the proposed scheme are of notably high quality. So this procedure is suitable in meeting the indispensable criteria required for efficient fragile watermarking in terms of holding high visual similarity of watermarked images with the original cover images. The proposed scheme is also compared with some other related works in terms of perceptual quality of the watermarked images. Tables 2, 3, and 4 show a comparative study of the proposed scheme with other schemes proposed by Chang et al. [3], Tong et al. [21], Nazari et al. [11] and Sreenivas et al. [19] Method-A. The analysis shows that the proposed scheme produces higher quality results as compared to the other works as mentioned in Tables 2, 3, and 4 respectively.

Table 2 Comparison in terms of PSNR values
Table 3 Comparison in terms of SSIM values
Table 4 Comparison in terms IF values

4.1 Tamper detection evaluation

We have carried out several intentional attacks on the watermarked images to validate the effectiveness of the proposed scheme in terms of tamper detection. In the watermarked “Lena” image, the eyes have been altered by adding eyeglasses in Fig. 12b. Figure 12c shows the actually tampered areas for the “Lena” image. The seven other images used in the experiment have been altered in some other way. In the watermarked “Baboon” image, the face of the Baboon has been altered (Fig. 13b); in the “Goldhill” image, a window in the background has been concealed (Fig. 14b); in the “Crowd” image, a boy’s face has been altered (Fig. 15b); in the “Cameraman” image, the tower in the background has been added (Fig. 16b); in the watermarked “Pepper” image the direction of one of the vegetable has been altered (Fig. 17b); in the “Barbara” image the bracelet in the wrists have been added (Fig. 18b), and in the “Boat” image the tower in the boat background has been added (Fig. 19b). In all the cases, the proposed scheme is able to identify the tampered region successfully. The effectiveness of the scheme is estimated by several quantitative measures like false positive rate (FPR), false negative rate (FNR) and true positive rate (TPR). Proposed watermarking scheme obtained very less value of FPR and FNR. False positive rate (FPR), false negative rate (FNR) and true positive rate (TPR) are used to evaluate the tamper detection correctness using Eq. 14 to Eq. 16.

$$ FPR=\frac{FP}{\left( FP+ TN\right)} $$
(14)
$$ FNR=\frac{FN}{\left( FN+ TP\right)} $$
(15)
$$ TPR=\frac{TP}{\left( TP+ FN\right)} $$
(16)

where, FP is the number of false positive pixels, FN is the number of false negative pixels, TP is the number of true positive pixels, and TN is the number of true negative pixels. Proposed fragile watermarking scheme ensures low FPR and FNR. Table 5 shows quite good results in terms of TP, TN, FP, FN, TPR, FPR and FNR. Accuracy (ACC) is another parameter for tamper detection evaluation in watermarked images. The Accuracy (ACC) of tamper detection is derived using Eq. 17:

Fig. 12
figure 12

a The watermarked Lena, b Tampered Lena, and c Actual tampered areas

Fig. 13
figure 13

a The watermarked Baboon b Tampered Baboon, and c Actual tampered areas

Fig.14
figure 14

a The watermarked Goldhill b Tampered Goldhill, and c Actual tampered areas

Fig. 15
figure 15

a The watermarked Crowd, b Tampered Crowd, and c Actual tampered areas

Fig. 16
figure 16

a The watermarked Cameraman b Tampered Cameraman, and c Actual tampered areas

Fig. 17
figure 17

a The watermarked Pepper b Tampered Pepper, and c Actual tampered areas

Fig. 18
figure 18

a The watermarked Barbara b Tampered Barbara, and c Actual tampered areas

Fig. 19
figure 19

a The watermarked Boat b Tampered Boat, and c Actual tampered areas

Table 5 Experimental results of the proposed scheme in terms of TP, TN, FP, FN, TPR, FPR, FNR, Accuracy (ACC) and NC
$$ Accuracy\kern0.3em (ACC)=\frac{TN+ TP}{\left( FP+ TN+ FN+ TP\right)} $$
(17)

where, TP is the number of tampered pixels stated tampered, FP is number of non-tampered pixels declared tampered, TN is number of non-tampered pixels declared non-tampered and FN is number of tampered pixels declared non-tampered. Accuracy value also ranges from 0 to 1. Normalized cross-correlation (NC) is another important quality measure for watermarking schemes which is used for calculating the reliability of extracted watermark bits. The value of NC must is close to 1 for retaining high quality watermark. The NC value is calculated based on Eq.18:

$$ NC\left( OW, EW\right)=\frac{\sum_{i=0}^{M-1}{\sum}_{j=0}^{N-1}\left[ OW\left(i,j\right)- mean\kern0.2em (OW)\right]\times \left[ EW\left(i,j\right)- mean\kern0.2em (EW)\right]}{\sqrt{\sum_{i=0}^{M-1}{\sum}_{j=0}^{N-1}{\left[ OW\left(i,j\right)- mean\kern0.2em (OW)\right]}^2}\times \sqrt{\sum_{i=0}^{M-1}{\sum}_{j=0}^{N-1}{\left[ EW\left(i,j\right)- mean\kern0.2em (EW)\right]}^2}} $$
(18)

where, M and N represents the width and height of images, OW is an original watermark, EW is an extracted watermark, mean(OW) is a mean of original watermark and mean(EW) is the mean of the extracted watermark.

Table 5 also demonstrates the Accuracy and normalized cross-correlation values attained by the proposed tamper detection process. The proposed scheme attains both Accuracy and NC values very close to 1 which validates the effectiveness of the watermark extraction, and the tamper detection process. Tables 6 and 7 shows a comparative analysis of the proposed scheme with the schemes proposed by Chang et al. [3], Tong et al. [21], Nazari et al. [11], and Sreenivas et al. [19] Method-A on the basis of various parameters like true positive rate, false positive rate, tamper detection accuracy, and normalized cross-correlation. The results obtained by the proposed tamper detection procedure is found to be comparable with the other mentioned schemes as the proposed procedure achieves considerably low FPR and FNR values with very high Accuracy and NC values.

Table 6 Comparison in terms of FPR and FNR values
Table 7 Comparison in terms of Accuracy (ACC) and NC values

4.2 Percentage of tampering ratio

Percentage of tampering ratio is another parameter to estimate the performance of any fragile watermarking scheme. This experiment evaluates the efficiency of the watermarking scheme with respect to various levels of tampering.

The percentage of tampering ratio is computed as follows:

$$ \mathrm{The}\ \mathrm{tampering}\ \mathrm{ratio}\%=\frac{Ntb\times 100}{Nb}\kern0.1em $$

where, Nb represents the number of blocks in the test image and Ntb implies the number of tampered blocks found after image manipulation attacks.

We have conducted the experiment with various percentages of tampering ratio as 5%, 10%, 15%, and 20% values and it is found that the proposed scheme has survived against these much distortions. Figures 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 and 35 show the visual results with various percentages of tampering ratio in different images, where all the results depict that the tampered areas have been detected precisely by the proposed procedure. In most of the cases, the proposed scheme has retained acceptable evaluation values in terms of FPR, FNR, Accuracy, and NC as shown in Table 8. In addition, the proposed procedure has been compared with some related works in Tables 9 and 10, where it is observed that in almost all the instances it retains comparable results. Based on the presented experimental outcomes, it is found that the proposed fragile watermarking scheme is highly suitable for detecting tampered regions accurately. In addition, the scheme also enhances the level of security due to consideration of encrypted watermark or authentication code.

Fig. 20
figure 20

a 5% tampered Lena b 5% actual tampered areas, c 10% tampered Lena d 10% actual tampered areas

Fig. 21
figure 21

a 15% tampered Lena b 15% actual tampered areas, c 20% tampered Lena d 20% actual areas

Fig. 22
figure 22

a 5% tampered Baboon b 5% actual tampered areas, c 10% tampered Baboon d 10% actual tampered areas

Fig. 23
figure 23

a 15% tampered Baboon b 15% actual tampered areas, c 20% tampered Baboon d 20% actual tampered areas

Fig. 24
figure 24

a 5% tampered Goldhill b 5% actual tampered areas, c 10% tampered Goldhill d 10% actual tampered areas

Fig. 25
figure 25

a 15% tampered Goldhill b 15% actual tampered areas, c 20% tampered Goldhill d 20% actual tampered areas

Fig. 26
figure 26

a 5% tampered Crowd b 5% actual tampered areas, c 10%tampered Crowd d 10% actual tampered areas

Fig. 27
figure 27

a 15% tampered Crowd b 15% actual tampered areas, c 20%tampered Crowd d 20% actual tampered areas

Fig. 28
figure 28

a 5% tampered Cameraman b 5% actual tampered areas, c 10%tampered Cameraman d 10% actual tampered areas

Fig. 29
figure 29

a 15% tampered Cameraman b 15% actual tampered areas, c 20%tampered Cameraman d 20% actual tampered areas

Fig. 30
figure 30

a 5% tampered Pepper b 5% actual tampered areas, c 10%tampered Pepper d 10% actual tampered areas

Fig. 31
figure 31

a 15% tampered Pepper b 15% actual tampered areas, c 20%tampered Pepper d 20% actual tampered areas

Fig. 32
figure 32

a 5% tampered Barbara b 5% actual tampered areas, c 10%tampered Barbara d 10% actual tampered areas

Fig. 33
figure 33

a 15% tampered Barbara b 15% actual tampered areas, c 20% tampered Barbara d 20% actual tampered areas

Fig. 34
figure 34

a 15% tampered Boat b 15% actual tampered areas, c 20% tampered Barbara d 20% actual tampered areas

Fig. 35
figure 35

a 5% tampered Boat b 5% actual tampered areas, c 10% tampered Boat d 10% actual tampered areas

Table 8 Experiment results of the proposed scheme in terms of various percentage of tampering ratio
Table 9 Comparison in terms of FPR and FNR values under various percentage of tampering ratio
Table 10 Comparison in terms of ACC and NC values under various percentage of tampering ratio

5 Conclusions

A secure fragile watermarking scheme is suggested in this paper. The watermark or authentication code is generated using Hamming code from the most significant bits of each pixel. For maintaining the high level of security, the watermark bits are further encrypted by secret binary bits obtained from the Logistic map. The encrypted bits are embedded into the cover image using the block-level pixel adjustment process. Suggested watermark embedding procedure causes less distortion since it is an indirect data hiding process. The proposed scheme is evaluated on various grayscale images and expected outcomes have been achieved in both perceptual observation as well as computed evaluation parameters like PSNR, IF, Accuracy, NC, TPR, FPR, and FNR. The proposed work has been tested with various percentage of tampering ratios, and the results show that the generated outcomes are of desirable quality. As per the experimental results, it can be stated that the proposed scheme is an effective and secure fragile image watermarking scheme for detecting tampered regions in digital images.