Imperceptible and secure image watermarking using DCT and random spread technique

Watermarking is a copyright protection technique, while cryptography is a message encoding technique. Imperceptibility, robustness, and safety are aspects that are often investigated in watermarking. Cryptography can be implemented to increase watermark security. Beaufort cipher is the algorithm proposed in this research to encrypt watermark. The new idea proposed in this research is the utilization of Beaufort key for watermark encryption process as well as for spread watermark when inserted as PN Sequence substitute with the aim to improve imperceptibility and security aspects. Where PN Sequence is widely used in spread spectrum watermarking technique. Based on the experimental results and testing of the proposed method proved that imperceptibility and watermark security are increased. Improved imperceptibility measured by PSNR rose by about 5dB and so did the MSE score better. Robustness aspect is also maintained which has been proven by the excellent value of NCC.


Introduction
Watermarking is a technique for protecting the copyrights from irresponsible parties [1].Watermarking is a technique similar to steganography because these two techniques both hide data [2].Watermarking can be done in various digital media such as audio, image, and video.The rapid and sophisticated technological developments demand that embedded watermarks can enhance three aspects i.e. robust, secure, and imperceptible [3,4].So research on watermarking is still being developed to improve these aspects.
Watermarking techniques, especially in digital images can be done with two kinds of domains, the spatial domain and frequency domain [3].Spatial domains can be done by the LSB and Zero Distortion Technique (ZDT) methods [5], but they are weak against various image manipulations.Frequency domains with the use of transformations are considered more robust to various manipulating digital images [1][2][3][4][5][6].Transformation domains such as Discrete Cosine Transform (DCT), is a very popular transformation used in watermarking techniques [7,8].
DCT has been widely applied in many image watermarking studies because DCT has many advantages over other transformations.Some of the advantages of DCT are a relatively fast calculation, good energy compactness, and has been embedded on various hardware such as cameras.DCT is also used in JPEG and MPEG compression standards [2][3][4][5][6][7][8][9] .While JPEG is a very popular extension and widely used for image storage.Some DCT research on image watermarking has also proven that is a robust transformation against various image manipulations [7,8].
The imperceptibility aspect can also be enhanced, some studies combine with several other transformations such as wavelet transform or singular value decomposition or both [3][4][5][6][7][8][9][10].However, the combination of some domain transformations does make the calculation code more complex and higher coding complexity.Other technique such as PN sequences can also improve aspects of imperceptibility [11], this technique is widely implemented in spread spectrum technique, and with this technique can improve watermark security automatically [12].PN Sequence is used to embed a watermark with a specific pattern of distribution [13].This makes better imperceptibility and security aspects than without used PN sequence [14,15].
In an effort to improve the security of watermarks, image watermarking techniques are also combined with many cryptographic techniques [8].The popular cryptography used in ISSN: 1693-6930  the watermark image is the chaotic map [7,8,10,16,17].There are various chaotic map methods, such as Arnold map, Logistic map, Kent map, and others.This method is an image scramble technique with a certain iteration so the image looks random, but the pixel value contained in the image does not change.Other cryptographic methods that are also widely applied to the watermark image is a one-time pad (OTP) [2,3,11,18,19].With this method, the image information can be completely random and different from the original image.Commonly, OTP is a derivative of the Vigenere algorithm that can use XOR or modulo functions to perform image encryption.This method is a classical cryptographic method that in its development has several types of algorithms such as Vigenere and Beaufort.Vigenere's algorithm is becoming more popular, but in Alallayah's et.al research [20], it has been proven that Beaufort performs better than Vigenere.So, in this study we combine DCT, Beaufort cipher, to improve safety and robustness, Beaufort key that is generated with random function is also used as a substitute of PN sequence to improve imperceptibility.

Research Method 2.1. Discrete Cosine Transform (DCT)
DCT is a very popular transformation and widely applied in the various science of digital image processing.DCT is also used as a popular JPEG standard compression transformation.Some of the advantages of DCT are its ability to rapidly transform pixel values [3], has a good energy compactness [2], has a low-grade error rate and high compression ratio [21] DCT is also widely implemented in software and hardware of image processing.This makes the use of DCT in image watermarking has many advantages.There are two kinds of coefficients produced DCT, namely Direct Current (DC) and Alternating Current (AC).DC is the coefficient that contains the main information of the transformation, while the AC is a coefficient containing additional information [2].The coefficient of AC is divided into three kinds of frequencies, namely low, mid and high.
Embedding and spreading watermarks on DCT well and able to withstand attacks.The insertion technique and the selection of embedment coefficients also greatly determine the quality of imperceptibility and robustness.Message insertion on DC coefficient and low-frequency coefficient AC can improve the quality of robustness because the energy is concentrated in this passage [9].In matrix 8*8 forward DCT can be defined as follows [3].

Beaufort Cipher
Beaufort cipher is another form of Vigenere cipher that has been widely implemented in one-time encryption pad (OTP).OTP is cryptography can be used for text and image.Vigenere is one of the most popular substitution cipher .While the Beaufort cipher uses a substitution technique similar to Vigenere [20].Encryption using Beaufort cipher in the image is defined by formula (4).Where E is encrypted message, K is the key generated by the random function, M is the message, V is maxed value of the pixel, and xy is coordinate of the pixel.As for the decryption is defined by the formula (5).
In order to ensure the safety of the Beaufort cipher algorithm, the keys used must be random, once used and the size is the same as the plain message [2].In this study, the random key will also be used as a substitute of PN Sequence to insert a watermark.Utilization of the random key is used to improve the imperceptibility of watermark [11].

Image Watermarking
Image watermarking is a copyright insertion technique into an image in order to protect the copyright.There are two main processes in image watermarking, namely the insertion process and the encryption process.Both processes are performed in the frequency domain.
The study proposes DCT to transform images into frequency domains, to improve safety, Beaufort ciphers are proposed for watermark encryption.The random function is used to generate Beaufort key as well as utilized in the insertion and extraction process to improve the watermark imperceptibility aspect.While the tools used in this research is Matlab R2015 For more details can be seen in the following sub-chapters.

Proposed Embedding Method
In the embedding process required three inputs, namely a cover image, watermark image and Beaufort key.Perform transformations on matrix blocks using DCT.g.Insert encrypted watermark with Beaufort cipher on DC coefficient using factor value ().
The insertion is done by the Beaufort key (Bk) using (6).The value will affect the aspects of imperceptibility and robustness.
h. Perform inverse DCT on each block that has been inserted a watermark.i. Combine all DCT inverse blocks into one to get the watermarked image.

Proposed Extraction Method
This stage is part of doing watermark extraction from the watermarked image.The proposed method is a non-blind method.This method requires a cover image for the extraction process.So at this stage, it takes the watermark image, the original cover image, and the Beaufort key, to gain a clearer understanding of the steps can see the decryption of the extraction step in Figure 2.

Measurement Tools
This study uses several measuring tools to determine the quality of watermarking.The quality of the watermarking algorithm is measured in two aspects, namely imperceptibility and robustness.The imperceptibility of the watermarked image can be measured by means such as mean square error (MSE), and peak signal to noise ratio (PSNR).MSE and PSNR are commonly used measuring tools for measuring image quality.MSE is an estimate of the mean value of the squared error of reconstruction of the cover image after the watermark inserted.Increasing MSE values indicate that more errors, while the MSE value near 0 indicates better image quality.PSNR is the value of the ratio of the noise value that can damage the image representation with the maximum value of the signal strength of an image.In contrast to MSE  ISSN: 1693-6930 the better the PSNR value is the greater value, the perfect PSNR value is infinity.The MSE and PNSR formulas are respectively shown in (8), and (9) [23].
Where  is a cover image,  is a watermarked image,  is number of row,  is number of coloumn.In this study, the quality of robustness is measured by normalized cross-correlation (NCC).The NCC value is generated from the comparison between the original message image and the image of the extracted message.Perfect message extraction will result in NCC value 1. NCC value ranges from 0 to 1, that's mean if the value of NCC close to 0 then the quality of extraction is getting worse [24].Watermarks should be resistant to various image manipulations.To test the watermark resistance in this study the watermarked image will be tested with JPEG, mid filter, crop, scaling, Gaussian noise, and salt and pepper attacks.The NCC can be calculated by the formula (10).

𝑛𝑐𝑐 =
×′ × (11) This study also measured the computational performance of the proposed algorithm using tic toc function in Matlab to find out the time required to perform the watermarking process.

Results and Analysis
The image dataset used in this research are grayscale images with size 512*512 which can be downloaded at http://sipi.usc.edu/database/[25].While the watermark used is a black and white image with size 64*64.Figure 3 shows the cover image used, while figure 4 is a watermark image.Before the process of embedding, encryption is imposed on the watermark image watermark to improve security.Watermark image encryption is performed with the Beaufort algorithm.Figure 5 shows the Beaufort key used and the watermark encryption results.Based on the hypothesis that has been discussed on Beaufort cipher key background will be utilized to improve security and imperceptibility of the watermark.This key will be used to Based on the observation in Table 1, it can be concluded that the use of Beaufort key at the time of embedding watermark proved to improve the quality of imperceptibility, and of course also the security of watermark.The mean difference of PSNR value reaches 5.3519 dB and MSE reaches 5.6470.Extraction can also be done perfectly as evidenced by the value of NCC 1.Although the invisible eye does not appear a significant difference as shown in Figure 6.

Without Beaufort key
Using Beaufort key Without Beaufort key Using Beaufort key Figure 6.Sample the watermarked image and extracted watermark result Robustness testing is done by giving some manipulation to the watermarked image.After the watermarked image manipulation is extracted to get the watermark image.After manipulation is usually a watermark image cannot be extracted perfectly, but at least the watermark can still be identified.Table 2 shows the comparison results of the watermark resistance test against various attacks.JPEG compression, mid filter, crop, scaling, Gaussian noise, and salt and pepper.
The last test in this study is the computational performance test of the algorithm.In this study only gauge the time required when computing.This time is measured by tic toc function in Matlab.The use of the tic toc function will indeed result in different times on each computer.But at least the measurement results with the tic toc function can provide an overview of the time required to compute the embedding process, encryption, extraction and watermark decryption.Computers used in this research is a desktop computer with Intel i3 processor, 4GB memory, and onboard VGA.Table 3 shows the calculation of each process in each image with the tic toc function.

Figure 3 .
Figure 3. Cover image used

Table 1 .
spread encrypted watermarks.Table 1 shows the value of MSE, PSNR watermarked image and NCC values of non-attack image extraction.Table 1 also compares the embed results by utilizing Beaufort and without Beaufort keys.MSE, PSNR, SSIM and NCC Value of Watermarked Image without An Attack

Table 2 .
NCC Value of the Watermarked Image with Various Attack