{'fraction_non_alphanumeric': 0.029777057779834915, 'fraction_numerical': 0.008678546632723907, 'mean_word_length': 4.791154791154791, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Medical Image Authentication by Combining Hash Signature and Watermarking Based on Frequency Domains

Medical images are transmitted to other remote places through the E-healthcare system. The protection of medical images is very crucial. Medical images need to be protected against any modification which the attacker may do through the unsecured channel. It is necessary for inspecting the integrity of the ROI (Region of Interest) of the received medical image prior to the adoption of any diagnostic decision to avoid a misdiagnosis. This paper aimed to confirm the integrity and authenticity of medical images by combining the hash signature with the watermarking technique based on the frequency domains. At first, the medical image is divided into ROI and RONI (Region of Non-Interest). The SLT and DCT transformations are employed together to extract the essential features set from ROI and then combined with EPR (Electronic Patient Registration) to produce a watermark, and then it is encoded by a chaotic map with a secret key to provide a signature. On the other hand, the RONI is mapping into randomly subblocks based on the linear system, and then the Signature is embedded in the chosen block using DWT. The hash code of the recovered image and EPR will be compared with the extracted watermark for integrity and authenticity. The experimental results demonstrate the watermark’s robustness against many of the more aggressive and geometric signal processing distortions without affecting the quality of the original medical image. In particular, compared with state-of-the-art technology, the proposed algorithm improves the average NC value larger than 0.90 under all types of attacks.


I. INTRODUCTION
MAGING technology has assumed a critical function in the improvement of the medical services area. Checking medical imaging is an essential source for important membership data [1]. To convey the medical images securely, some security requirements should be met. These necessities are secrecy, legitimacy, and integrity [2]. For the exchange of electronic patient records (EPR) between hospitals, a dedicated communication standard known as digital imaging and communications in medicine (DICOM) is used. The header is attached to the medical image files DICOM in this format, containing valuable patient information. The header may be lost, targeted, or other header files disordered. A good solution to those problems and problems may be found with the digital watermarking of medical images [3]. Watermarking techniques are used to add binary signatures (watermarks) directly to image content. Numerous The details about the medical examinations, tests, and procedures of patients may be double blacked out to protect patients' privacy. Well-organized arrangement of confidential information in the healthcare management system seeks to provide good treatment opportunities based upon the right information to right position at the right time [4,5].
As a compact representation of the original contents is a perceptual hash value, it can be used for robust content authentication. The benefit of perceptive hash algorithms is that they can accommodate the consistency and format variations compared to traditional cryptographic hatch algorithms [6]. Binary representation is no longer necessary and still maps the same content at the same hash value. For the multimedia domain, this is especially useful.
We suggested an original checking method based on both hashing and watermarking principles in this paper. The authentication of image content is analyzed by providing a new algorithm that involves a perceptual hashing scheme for digital images with chaos. The interest was to find an acceptable imaging space with robust features that could create an image hash for digital imagery authentication.
The main contributions of this paper are as follows:

1.
A new algorithm for extracting features of medical volume data based on human visual characteristics is proposed. This algorithm divide the image the subblock then take the SLT all subblock and then apply DCT on the LL subbands for theses blocks in order to contribute all bytes of image in hash code compared with other works that take only the LL suband of whole image only. This algorithm effectively protects the integrity of the medical image and meets the strict requirements of medical volume data for diagnosis. 2. The watermark encryption uses the Chaotic Shift Keying techniques (CSK), which has richer initial conditions and is extremely sensitive to the initial value, thus enhancing the security of watermarking. The watermark becomes chaotic and it is not possible to obtain effective information from it, hence it is highly concealed. If the watermark is modified to the wrong initial parameters of the CSK, it cannot be extracted correctly. 3. The watermark embedding and extraction algorithm design combines the features of perceptual hash and the block mapping based on secret key in order to provide an extra security level. The watermark embedding algorthm provides more durability under various attacks, and such noise affects the random pixels so that the whole image is not affected. Thus the embedded EPR and hash code are not destroyed.
The rest of the work is organized as follows: Section 2 presented the related works; Section 3 describes the proposed system with details; Section 4 shows some experiment results; Section 5 concludes the work.

II. RELATED WORKS
Recently various approaches are available that are guaranteed the security and integrity of medical images. These approaches comprise ciphering [7][8][9], watermarking [10][11][12], image signature or hash [13], the ciphering guaranteed the protection of images. Still, the deciphering will lose safety, whereas the watermarking and hashing can discover if the image has tampered and then the integrity is at risk. Tataru [14] offered an image hashing scheme based on a rugged collection of features extracted using a powerful, chaotic framework from joined DCT-DWT domains. Robustness analysis involves compression, noise, filtering, and geometric transforms. Cedillo-Hernandez et al. [15] proposed, along with the use of digital diagrams and correspondence through normal medical metadata, an extensive watermarking method for medical images, to prohibit the isolation of the relevant EPR data into the watermark. The watermark has been incorporated into the magnitude of the middle frequencies with the high quality of the watermarked images, a discrete transformation of the original medical image in Fourier. The suggested system used three of the most common metrics to test watermarked images: peak signal-to-noise, structural similarity, and visual detail fidelity. The author proposed a tamper-proofing method for digital images using the digital watermarking technique in [16]. The mechanism presented here describes a method for detecting illegally modified regions in the image. Sharma [17] presented a watermarking method based on two common transform domain techniques, discreet DWT and discrete cosine transformation. The cover medical image is divided into two separate parts in the embedding process: the region of interest (ROI) and the non-region of interest (NROI). Several photographs and text watermarks are combined with the ROI and NROI parts of the same media cover item to authenticate the identity. Before embedding, Rivest-Shamir-Adleman (RSA) 's encryption technique is applied to a text watermark to boost the text watermark protection and the encrypted EPR data is inserted into the NROI part of medical image coverage. The conversion method for pixels to blocks (PTB) used by Parah et al. [18], used in order to ensure the reversion of medical images, as an effective and computational solution for interpolations. A fragile watermark and the Block Checksum were inserted into the cover image in order to enable tamper detection and tamper position and therefore contents authentication at the recipient. The EPR, watermarks, and control data were embedded using Intermediate Significant Bit Substitution to avoid widely used LSB removal/replacement attacks (ISBS). The author [19] introduced two separate algorithms in the field of transformation for watermarking medical images. The first technological framework in the two regions: Area of Interest (ROI) and region of noninterest was integrated into digital watermarks and Electronic Patient Records (EPRs) (RONI). The Regions of Interest (ROI) are preserved in the second system for telediagnostics and the Non-Interest Region (NIR) is used to mask the digital watermark and EPR. The watermark/EPR is chosen and their size compared with embedding for each of the two DCT coefficients. Due to the performance of two strategies for different attacks, the proposed algorithms can prove useful in an E-health system. Rakhmawati et al. [20] addressed the concepts and characteristics of a fragile watermarking algorithm. The principal contribution of this paper survey is that it summarizes established procedures for choosing, producing and adding watermarks, detection sites, tampering and recovery processes. A comparison of several watermarking methods are analysed and presented in tabular form with an experimental evaluation of four watermarking schemes in several graphs to demonstrate the efficacy of the auto-embodying fragile watermarking framework. A medical image watermarking (MIW) approach for telemedicine applications is proposed at Khare [21]. The method is effectively utilized in the creation of a watermarking mechanism by transformation by homomorphic transformation (HT), redundant discrete wavelet transformation (RDWT), and singular value decomposition (SVD). The reflecting part of the medical host image is obtained by HT, which includes RDWT and SVD. The RDWT and SVD process the medical watermark image. In order to insert the image of the watermark into the host image, single values (Svs) have been used. The chaotic 2-D Arnold Transform (AT) is used to crypt the watermark image to provide the watermark image with additional security. Moreover, the proposed technique would also test many wavelet families. The robustness and imperceptibility of the proposed technology are increased, as demonstrated in experimental results in various attacks. Swaraja is achieved [22] by hiding dual watermarks in the medical image blocks in the non-interest field, tamper identification and genuineness (RONI). The Human Visual System's (HVS) characteristics are chosen for these blocks, along with the Discrete Wavelet Transformation (DWT) and Schur Transform integration and the algorithm PCS. The lossless compression algorithm Lempel-Ziv-Welch (LZW) compresses two watermarks to improve payload power. Simulation results on different medical image types show that the proposed scheme shows superior clarity and robustness against signal and compression attacks compared to related hybrid optimized algorithms.

III. THE PROPOSED SYSTEM
In this system, a mechanism based on a hybrid frequency domain is used for assuring the integrity and verification level while the encoding is used to maintain authenticity. This methodology is run on two levels. Those are signature generation and watermarking method. Fig. 1 shows the block diagram of the proposed system.

A. Image localization of ROI and RONI
Thresholding is one of the most potent techniques for image localization. The OTSU algorithm is used to generate the threshold value for brain medical image binarization. Detecting the connected region can ensure the bounding box of the central brain region called ROI. The size of the ROI is extended to the multiple of two because of the DWT usage. Fig. 2 depicts the localization process of ROI and RONI in brain medical images.

B. Signature Generation
In the proposed system the ROI is reshaped for obtaining a squared sub-image of size m × m, and then it is divided into k × k pixels sub-blocks. Hash code is generated by calculating the signatures of each subblock. The SLT and DCT are employed together to extract the essential features set. The SLT first level decomposition confirms the sub-block information's isolation in frequency sub-bands LL1, HL1, LH1, and HH1. The LL1 sub-band holds most of the information from each sub-block. Therefore, we take into consideration the LL1 sub-band for the feature extraction method. When decomposing to the n-level, the LLn sub-band is obtained, and the LLn offers a square array that preserves most of the correlation from each block. According to the DCT distribution, the block top-left corner holds the high frequencies while the bottom-right holds the low significant frequencies. Each block has a DC term, i.e. the (0,0) frequency, which includes the most block significant information part. This term is taken from each DCT block and is used to form the hash code.
A feature vector of DC's is obtained for all computed DCT blocks from the LLn subband. Subsequently, the feature vector is binarized, and this is accomplished by comparing each feature set component with the overall set of feature average. Binary 0 is employed to state DC values below the average, and binary one is used to state the DC values exceeding average. Consequently, a binary hash code is obtained for the digital image, as shown in Fig. 3. The hash code is combined with EPR to produce a watermark. A quadratic chaotic map is employed to encode the watermark with a secret key to sign it. Algorithm 1 lists the steps of generating the Signature. (1) Step2: Split ROIimg into the non-overlapping k×k sub-block.
Step4: Apply the DCT transform on the n LL sub-band for each sub-block.
Step5: The DC terms are collected from DCT of each LL sub-band to construct features vector V of the ROIimg.
Step6: Compute the mean value mdc for the features vector V.
Step7: Binarized, the features vector V, to get binary features vector BV using the following formula: Step9: Encode the BEPR and BV using a Quadratic Chaotic map [23]. The following formula generates the random signal: Where 0 < a < 2 and xn Then the two random sequence signals x0 and x1 are the inverted version of each other (x0(t) = -x1(t)). The transmitted signal can then be written as:

C. Hiding Signature
The embedding procedure attempts to insert the Signature bits, including the encoded hash code and EPR, in the RONI. The RONI is split into 2×2 non-overlapping blocks. In the embedding watermark schematic, block mapping is performed before the Signature inserting process. The proposed mapping method included the block mapping phase and block remapping phase. Details about the two phases of our proposed algorithm are described below.

D. Block Mapping Phase
The proposed block mapping is based on using a set of linear equations with n=2, k=2. By the linear transformation presented in Eq. (5), a High pixel correlation can be detached.
Where (x,y) is the original pixel position, (x′, y′) is the transformation pixel position and (x′,y′), (x,y) ∈ [1,N] × [1,N]. The N is the number of sub-blocks in the image, and the K1, K2, and K3 are prime secret keys while K4 is even. This selection of the keys is to ensure that all generating indices are odd.
In the mapping phase, at first, the RONI is rearranged in a symmetric matrix that its size computed from the following substeps: 1. Compute the numbers of bytes in RONI by the following formula: Where R and C are the numbers of rows and columns of the original medical image. At the same time, K and L are the ROI length and width.
Pi is an integer whose value will not be recorded as part of the index values. During the retrieval phase its values will be compensated according to specific integer division rules.

E. Embedding Signature
The domain transformation method offers the potential of embedding more information and stronger resistance to many common attacks. Each bit is embedded in a block of RONI. Their indices are computed from the block indices mapping phase and consider the supposition that the length of a watermark is less than the number of sub-blocks in RONI.
After the mapping phase on RONI blocks is completed, one LWT level is applied to get four subbands (LL, LH, HL, HH) for each block. High frequencies may be lost by compression or scaling; therefore, the watermark will be embedded in the lower frequency by updating its value according to Eq. (9). In addition, a quantization parameter (Qs) can be used to achieve better performance in terms of robustness. Herein we use the LL subband to embed the watermark. LL sub-band first is quantized by a scaling factor (Qs) as in the following Equation: Qs is a scaling factor.
Then embed bits of Signature as in the Eq. (9): for idx = 1 to length(W) After embedding the bit in LL, apply the inverse of LWT on the current block. Finally, when all bits are embedded reconstruct the RONI blocks to get watermarked RONI and then merge ROI with watermarked RONI to get the watermarked medical image. Algorithm (2) shows the steps of the embedding process.
Step2: Repeating step3.1 to step 3.5 for each bit Signature Sig until all signature bits are embedded.
Step2.1: Each bit in the Sig is embedded in a block of RONI whose number is selected randomly using the eq. (1).
Step2.2: Apply LWT on the selected block (the result is LL, HL, LH, and HH).
Step 2.3: Make quantization to LL by using Equation (2).
Step 2.4: Embed one Sig bit in the sub-bands (LL) of each mapping block using Equation (3): Step 3.5: Applying inverse of LWT on the watermarked block. Step5: Reconstruct the blocks of RONI to get watermarked RONI.
Step6: Merge ROI with watermarked RONI to get WMI.
After embedding the bits of Signature in RONI, the remapping is done then rearranges the square matrix of RONI to its original location in the medical image. The watermarked medical images send to the receiver via the internet in a secure manner.

F. Block Remapping Phase
In this phase, the blocks are remapping to their original locations in the RONI by applying the revealing operations performed by algorithm 3. Step2: Create the coefficients matrix, A'(), of the corresponding linear equations, that is; , m=1, 2 and l=1, 2 Step3: Determine the determinant value of A (i.e., D=det(A)), and the corresponding complementary matrix C; such that for all values of j the following condition is satisfied: Here, the matrix element Cij is equal to the determinant of the reduced matrix C (whose i th row and j th column are removed) multiplied by the factor (-1) i+j . Step4 Where wj is an integer number, whose value is multiples of N, such that:

G. Extraction Signature
Firstly, to extract the Signature from RONI, it is divided into non-overlapping blocks of 2 × 2 pixels and performed mapping for sub-blocks. Then bits of the Signature are extracted from RONI blocks by applying one level of LWT on the selected blocks and making quantization to the resulted LL using Eq.
Step2: Partition the RONI into non-overlapping sub-blocks of size 2 pixels. Step3: repeat step3.1 to step 3.5 until all watermark bits are extracted.
Step3.2: Each bit in the Signature is extracted from a sub-block of RONI after mapping.
Step3.2: Apply one LWT level on the sub-blocks (the result is LL, HL, LH, and HH).
Step 3.3: Make quantization to LL (by using Equation (6)) Step 3.4: Extract one encrypted signature bit from the sub-bands (LL) of each subblock by using Eq. (17). After the watermark is extracted represented by an encrypted signature, a deciphering is performed. The decoding of the chaotic map with the same key for enciphering is applied, and then the Hash and EPR is reconstructed.

VI. EXPERIMENTAL RESULTS
A set of samples of EPR and generated hash code by the proposed hashing method are used as a signature for testing, as displayed in Figs. 7 and 8. And also, the performance of the proposed watermarking system is verified in terms of imperceptibility and robustness on 8 bits grayscale of MRI brain medical image of size 512×512 for 1000 images.  Different parameters are set during the simulations for the proposed hash method like the resized image dimension m, n-level for the SLT transformation, and the size of block k×k for the DCT transformation. The performance of the algorithm is tested under the subsequent parameters: n=1, k=32, m=512. The bit error rate (BER) is used as a metric to measure the distance between hash values and it is defined as: Where x and y are two N length binary vectors. A successful algorithm against legitimate distortion is robust. Some distortions -JPEG compression, scaling, medium smoothing, wiener filtering, rotation, and sharpening -are considered legitimate. In practice, they are typically found. It is expected that the hash value is not susceptible to these operations. We measure the average hash distance for each pair of the original image and its distorted version. Table 1 displays the results. The proposed hash code generation results are acceptable in most types of attacks compared with some related researches. The table shows that the proposed scheme provides more durability under mean, median, rotation noise because this type of noise affects the random pixels so that the whole image is not affected. Thus the embedded EPR data is not destroyed. Nevertheless, the approaches demonstrated a vulnerable to geometric manipulations such as rotations.

A. Security Analysis of Chaotic Encryption
To increase the security and robustness of the proposed system, the watermarks are encoded using a chaotic method.
The quadratic map is used to generate a chaotic sequence by using Eq.(3). The sequence is very sensitive to a change in an initial value, where a very small difference in the initial values can cause a large impact on the next values. As illustrated in Fig. 9 two signals are generated with initial condition (x0= 0.5 and x0= 0.50000000000001) from quadric chaotic generator. Fig. 10 presented the auto and cross correlations between these signals. As we see, the cross and auto correlation characteristics look like those of random white noise, even though their initial conditions are somewhat different. It can be concluded that the Quadrate map can generate uncorrelated sequences and exhibit good autocorrelation properties making a call for using in security applications.   Figure. 9. Auto and cross correlation performance for Quadric chaos generator. Fig. 11 depicts the coded Signature in Fig. 9 after applying eq. 4, while Fig. 12 depicts the cross correlation between the encrypted Signature and the original Signature.  From Fig. 12, it is noticed that the characteristics of outputs look like those of random AWGN (Additive White Gaussian Noise).

B. Testing the Fidelity Measures of Proposed Watermarking Method
The watermarking algorithm embeds a signature included an encoded hash code of the sender (doctor) of length 256 bits and EPR of length 512 bits, and then the size of the total length of Signature is 768 bits. The PSNR is used to evaluate the fidelity of the embedding scheme Fig. 13 shows the original and watermarked images with their PSNR values for a sample of images. And the PSNR equation is given by Eq. (15) [28]: Can calculate MSE by Eq. (17) Where R is the maximum fluctuation in the input image data type, Mean Square Error (MSE), PSNR (Peak signal to Noise Ratio), M, P are the sizes of the original medical image (OMI) and the retrieved medical images (RMI), respectively.  The PSNR values are changed according to various factors such as data payload (watermark size), scaling factor and RONI size used in the proposed embedding algorithm. The size of the watermark is fixed, but the RONI size is changeable and the value of scaling factor =2.

C. Robustness Measures of Proposed Watermarking Method against Attacks
The robustness of the system is measured with several kinds of attacks. The BER is used to calculate the difference between the extracted hash code and the hash code generated from the received brain image to check the integrity of ROI. If the integrity of ROI is verified, it means that the region is not tempered, and then the patient information is decrypted. To define the degree of robustness of the proposed embedding method, Normalized Correlation (NC) is calculated between the original and the extracted patient information using the following Equation [29]: Where W is original watermark and W' is recovered watermark with zero mean value each.
By calculating the bit error rate (BER) using Eq. (15). 0.0400 0.9764 To assess the robustness of the presented scheme against several attack attempts, such as mean, median, share. the PSNR is calculated and compared with other related works, and the consequences are arranged in Table 4.  Table 4 shows the time consuming for each step in the proposed system.

V. CONCLUSIONS
To verify the integrity and authenticity of medical image, this paper proposed a method which is combined the hash signature with the watermarking technique based on the frequency domains. The hash code is extracted from ROI by hybrid the SLT and DCT transformations by employing the good features of them to generate robustness hash code then it combined with EPR to form a watermark. To increase the security and robustness of the proposed system, the watermark is encoded by a chaotic map with a secret key to generate a signature. The transformation domain method offers the potential of embedding More knowledge and better attack resistance. The block mapping approach provides extra level of security and high pixel correlation can be detached. The proposed approach demonstrated high image quality as regards robustness in the experimental findings. Furthermore, the proposed approach was shown to be very stable against addition of noise and JPEG compression. Good output has been demonstrated for geometric distortions including scaling, rotation, translation and shearing.