A Fragile Watermarking Scheme for Image Authentication with Tamper Localization Using Integer Wavelet Transform

Problem statement: In recent years, as digital media are gaining wider popularity, their security related issues are becoming greater concern. Method for authenticating and assuring the integrity of the image is required. Image authentication is possible by embedding a layer of the authentication signature into the digital image using a digital watermark. In some applications tamper localization is also required. Approach: In this study, we proposed a fragile image authentication system with tamper localization in wavelet domain. In this scheme, secret data to be embedded is a logo. Watermark was generated by repeating logo image so that size of watermark matches with the size of HH sub-band of integer wavelet transform. To provide additional level of security, the generated watermark was scrambled using a shared secret key. Integer Haar wavelet transform was applied to obtain wavelet coefficients. Watermark was embedded into the coefficients using odd-even mapping. Results: Experimental results demonstrated that proposed scheme detected and localized tampering at pixel level. Proposed scheme was tested with images of various sizes and tampering of various sizes. It provided good results for tamperings ranges from single pixel to a block of pixels. Conclusion: Watermarking was done in wavelet domain; conventional watermarking attacks were not possible. The resolution of tamper localization was achieved at pixel level. The watermarked image's quality was still maintained while providing pixel-level tampering accuracy. Proposed scheme can be used in insurance, forensics departments.


INTRODUCTION
In recent years, as digital media are gaining wider popularity, their security related issues are becoming greater concern. Digital watermarking is a technique which allows an individual to add copyright notices or other verification messages to digital media. Image authentication is one of the applications of digital watermarking, which is used for authenticating the digital images. The objective is not to protect the contents from being copied or stolen, but is to provide a method to authenticate the image and assure the integrity of the image. The way to realize this feature is to embed a layer of the authentication signature into the digital image using a digital watermark. In the case of the image being tampered, it can easily be detected as the pixel values of the embedded data would change and do not match with the original pixel values [1] . There are many spatial and frequency domain techniques available for authentication watermarking [2][3][4][5][6][7][8] .
In message authentication, only the image integrity is verified, but sometimes this is not sufficient in digital images and tamper localization is also required. The situations include forensics, crime, insurance. Tamper localization is used to identify the specific positions where the tamper has occurred.
To achieve tamper localization many existing schemes use block-based approach [9][10][11][12] . One of the first fragile watermarking techniques proposed for detection of image tampering was based on computing check-sums of gray levels which is determined from the seven most significant bits of the image. The check-sum is embedded into the Least Significant Bits (LSBs) of pseudo-randomly selected pixels [9] . One weakness of this scheme is that it is possible to swap blocks in an image without causing a detectable change. It is called as Vector-Quantization (VQ) attack or transplantation attack. But, VQ attack can be avoided by including the block position or block index to the image data before hashing [10] . The watermark can be calculated in a multi level hierarchy so that both VQ attack resiliency and high accuracy for tampering localization is achieved [11] . The watermark may include not only the block location but also a content-feature of another block and a Cyclic Redundancy Check (CRC) checksum [12] . The CRC checksum is used to authenticate the block inspected where as the block location and content-feature of another block are used for complicating the VQ attack. The localization accuracy of this scheme is stated as 8×8.
Some schemes provide pixel-wise tampering localization [13][14][15][16][17][18] . One of the first pixel-wise authentication schemes was proposed in [13] . A secret binary function is used to map the value of each pixel to a preset logo bit. But, this scheme is vulnerable to many attacks [19][20][21][22][23] and it can be overcome by introducing the neighborhood dependency in mapping a pixel to a logo bit [14] . The pixel-wise schemes are vulnerable to oracle attack if the pixel scan order is public [24] .
Recently, the researchers have focused on waveletbased watermarking schemes for image authentication [25][26][27][28][29][30][31] . Some tamper localization schemes are proposed in wavelet domain [26,30] . In [26] , the watermark is generated using DWT and embedded into the Least Significant Bits (LSB) of host image. In [30] , a semi-fragile authentication scheme is proposed in which selective rounding of coefficients is carried out to embed the secret information. The techniques which uses transform domain are more complex and computationally expensive. Yet, they offer high degree of robustness against common image processing operations [30] .
Almost all the pixel-wise schemes proposed in literature watermark pixels sequentially, one pixel at a time [13][14][15][16][17][18] . In these schemes, an image is scanned in a certain order to embed the watermark. The scan order may be public or secret. In [14] the image is scanned in a row-by-row scan order. In [15] the image is scanned in a zig-zag scan order. A neighborhood-dependent mapping function is used to map each pixel value to a desired logo bit. A special symmetry structure in the logo is used to authenticate the block content, while the logo itself carries information about the block origin (block index, the image index or time stamp, author ID).
In block-based approach, the image is divided into sub-blocks and the watermarking information is embedded into each and every block. Each individual block is authenticated by the successful retrieval of the watermark embedded in it. If the watermark of a particular sub-block is not retrieved successfully, then that sub-block alone is identified to be tampered and the remaining part of the image is authenticated. In these types of schemes, the localization resolution is based on the size of the sub-blocks. In [12] , the size of the subblocks is 8×8 and hence the detection resolution is 8×8. The smaller sub-block size is required to increase the detection resolution. But this will lead to higher watermark payload. In [9] , an image divided into nonoverlapping blocks of W×H pixels. The watermarking is done for each block separately. Two versions of the algorithm have been proposed. In the private key version, the seven most significant bits of all pixels in the block are hashed using a secure key-dependent hash. The hash is then XORed with a chosen binary logo and inserted into the LSBs of the same block. Verification is done in the reverse order. Comparison with the logo indicates tampered blocks. In the public key version, the 7 MSBs are hashed using a fixed hash, XORed with the logo and then encrypted using a public key encryption method. The encrypted bit-stream is again inserted in the LSBs of the same block. During the verification process, first the hash of the 7 MSBs of all pixels in that block is calculated, XORed with the decrypted LSBs and the result is compared with the binary logo. The ability of this scheme to localize modifications is very satisfactory. The block size should be chosen so that the whole hash (128 bits) can be embedded. For example, block sizes of 8×16 or 12×12 pixels are possible. The logo can be either a binary picture with a graphical meaning or a randomly generated black and white pattern.
Since the block-based schemes embed watermark locally, they are vulnerable to local attacks. The major weakness of the block-wise schemes is VQ or transplantation kind of attack in which it is possible to swap blocks in an image without causing a detectable change. If an attacker has a database of images authenticated with the same key, it is possible to take an arbitrary image and modify it to make it authentic. One can divide the image into blocks and for each block perform a search through the blocks in the same position in all database images. The original block is then replaced with the closest match. This kind of VQ attack is applicable to schemes in which it is possible to identify disjoint groups of image elements that are modified without context. Consequently, most schemes that can localize changes are vulnerable to this attack [24] . This problem could be avoided by including the block position or block index to the image data before hashing [10] . In [24] , VQ attack is overcome by XORing more block information such as block position, image index, camera ID.
There are few papers in tampering localization in wavelet domain [31][32][33][34] . In this model, DWT is applied to the original image to obtain the four sub-bands LL, HL, LH and HH. The watermark used here is usually a random binary string or a logo kind of image. The watermark bits are embedded in either of the sub-bands. Embedding data in high frequency sub-bands generates watermarked images with less distortion. The watermark bits are embedded in sub-bands by modifying the wavelet coefficients. To improve security, the coefficients can be selected in random order. Tamper localization model in wavelet domain overcomes the problems of the other two models. VQ attack and oracle attack are not possible in wavelet domain model. Hence, it is more secure than the other two models.

MATERIALS AND METHODS
The proposed scheme performs watermark embedding in wavelet domain. The image is decomposed by integer Haar wavelet transform. The watermark is embedded only in the HH sub-band. But, coefficients of all the sub-bands are considered in watermark embedding process. The proposed scheme finds tampering positions at pixel level.

Preprocessing:
The following steps are carried out as preprocessing activity before embedding the watermark: • Apply integer Haar wavelet transform to decompose the original image • Rearrange the coefficients of sub-bands • Permute the coefficients The preprocessing steps are shown in Fig. 1. At first, the original image is decomposed by applying integer Haar wavelet transform to get LL, HL, LH and HH subbands. The coefficients of the sub-bands are combined together to form a new image. The coefficients in the sub-bands which corresponds to the same spatial location are grouped together to form a 4-coefficient block. Let C LL , C HL , C LH , C HH are the coefficients of LL, HL, LH and HH sub-bands respectively. The coefficients are rearranged as shown in Fig. 2.
The grouped coefficients form a new rearranged image (RImage) which is of the same size as the original image. The RImage is divided into sub-blocks of size 2×2. Each sub-block consists four coefficients where C LL is placed at (0,0), C HL is placed at (0,1), C LH is placed at (1,0) and C HH is placed at (1,1). Hence each sub-block represents the coefficients of all the subbands corresponding to the same spatial location.
Then these sub-blocks are randomly permuted by a secret key to obtain a permuted image (PImage). The original image is scrambled in wavelet domain but, the coefficients corresponding to same spatial location are preserved which enables easy tamper localization. Now, the PImage is ready for embedding the watermark in it.
To achieve statistical independency with respect to the image structure, the sub-blocks are permuted. The permutation can be viewed as a bijective mapping [2] of the sub-blocks indexes: where, S is the total number of sub-blocks. Permutation is achieved by a two steps process. In the first step, S numbers of pseudo random numbers are generated by using Linear Congruential Generator (LCG). The second step is to sort the generated random numbers and identifying their index in the sorted list. The index list is nothing but the expected permuted list.
When the increment c = 0, it is called as multiplicative congruential method. The seed plays an important role for the LCG. It determines the sequence, the LCG will generate. Hence, the permutation key shared between the sender and the receiver is used as the seed for LCG. At the receiving side, the same sequence of random numbers can be generated by giving the same permutation key as the seed for LCG. Here, the 2×2 sub-blocks are shuffled and permuted order is generated randomly and the watermark is embedded in the permuted sub-blocks. The same shuffling needs to be performed at the receiver side also.

Watermark embedding:
The watermark to be embedded is taken as a either a logo or a random sequence of predefined bits which is known to both the sender and the receiver. The advantage of using the logo is that cropping can be easily detected.
The watermark is generated by repeating the logo image so that the size of the watermark matches with the size of the HH sub-band of Integer Wavelet Transform. Figure 3 shows the watermark generation process for Lena image (256×256). The size of HH subband is 128×128 and the size of the logo is 42×27. The HH sub-band and the original logo are shown in Fig. 3b and 3c respectively. To provide additional level of security, the generated watermark is scrambled using a shared secret key. Figure 3d and e shows the generated and scrambled watermark.
The PImage is divided into sub-blocks of size 2×2. Let the sub-block is represented as F i . As already stated, each sub-block consists four coefficients where C LL is placed at (0,0), C HL is placed at (0,1), C LH is placed at (1,0) and C HH is placed at (1,1). The coefficients are added to produce the sum of that sub-block. The sum is used to represent the embedded watermark bit.

Fig. 4: Watermark embedding process
Odd-even mapping is the simplest and well known scheme in spatial domain. If the sum is an odd number, it is assumed that bit-1 is embedded, otherwise (even number) it is assumed that bit-0 is embedded. If the sum matches with the bit to be embedded then no change is made to the coefficients. Otherwise, the coefficient of HH sub-band ([F i ] 2,2 ) is either incremented or decremented to have the required value. Here, all the four sub-band coefficients are considered for computing the sum, but only the HH sub-band is modified to embed the watermark.
After the embedding process is over, inverse permutation is applied to get the rearranged form (RImage) of original image. Then, the coefficient values are separated from the 2×2 sub-block and restored back to LL, HL, LH and HH sub-bands. Now, inverse integer Haar wavelet transform is applied to get the final watermarked image. Figure 4 shows the watermark embedding process.
Watermark extraction: At the receiving side, the receiver does the same process as the sender for preprocessing step. At first, the watermarked image is decomposed by applying integer Haar wavelet transform to obtain LL, HL, LH and HH sub-bands. Then the coefficients of sub-bands of watermarked image are rearranged (WRImage) and permuted to obtain Watermarked-Permuted-Image (WPImage). The WPImage is divided into sub-blocks of size 2×2. Let the sub-block is represented as F i * . As already stated, each sub-block consists four coefficients each from the four sub-bands. The coefficients are added to produce the sum of that sub-block. If the sum is an odd number, it is assumed that bit-1 is embedded, otherwise (even number) it is assumed that bit-0 is embedded. One bit is retrieved from each of the 2×2 sub-blocks. The bits are retrieved from top left corner of the watermarked image. Figure 5 shows the watermark extraction process.

RESULTS
The effectiveness of the proposed scheme is explained using the following experimental results. Figure 6a and b are the watermarked and tampered watermarked image. Figure 6c is the generated watermark for the Barbara image (130×130). At the receiving side, once the watermark is retrieved, it is compared with the original watermark. Since the retrieved watermark is in permuted form, the receiver must generate the watermark as per the size of the received image and permute it using the same key. Now the two watermarks are compared for equality. If they differ at some position, then the respective 2×2 subblock is marked as black as shown in Fig. 6e. Figure 6d shows the retrieved watermark after applying the inverse permutation. It reveals that some tamperings have been occurred in the watermarked image. After applying inverse permutation to Fig. 6e, the tampering positions are clearly located as shown in Fig. 6f. The tampering positions are marked in white blocks in the watermarked image as shown in Fig. 6g. The proposed scheme is able to identify even a single pixel modification. Table 1 shows the PSNR and MSE of the watermarked images.

DISCUSSION
The proposed method is tested on several grayscale images of various sizes and can be extended to color images also. The main objectives are to provide image authentication and to localize tamper positions.
The embedded watermark is distributed in the wavelet coefficients in such a way that it does not causes perceptual artifacts. The quality of the watermarked image is not affected even though it provides localization at pixel level. The PSNR of different images shows that the system is successful in hiding the authentication signature without making noticeable changes in the original image.
Protection against VQ attack is a major issue for authentication and localization schemes. In the proposed system, the security of the whole system against VQ attack is achieved by permutation of wavelet coefficients. But, still it provides pixel-level tamper localization.

CONCLUSION
A wavelet-based fragile watermarking scheme for secure image authentication has been presented. In the proposed scheme, the embedded watermark is generated and scrambled based on the size of the image to be watermarked. This provides more protection to the watermarking system. Integer wavelet transform is applied and the proposed watermarking system localizes the tamperings at pixel level. Simulation results have been given to demonstrate the efficiency of the proposed scheme.