# Secure NIfTI Image Authentication Scheme for Modern Healthcare System
## 4 Proposed Watermarking Method
### Watermark Embedding Process  
In this process, first, the patient's information is separated from the NIfTI image and preserved securely. Then, the focus is on selecting the appropriate slice from the NIfTI image for watermark embedding because it has the number of slices. Generally, some slices at the beginning and end contain less information, so we select the slice from these. The selected slice is subjected to LWT; then, the LL sub-band is transformed by ST, separating it into low- and high-frequency bands (LL, HL, HH, LH). The BSVD algorithm decomposes the LL band, and, after that, the encrypted watermark is embedded into the bidiagonal singular values. We use the ACM for watermark encryption, which provides more robustness. In the last step, the watermarked slices, other slices, and the information on the patient are integrated to produce the watermarked NIfTI image. The procedures required for embedding a watermark are detailed below Algorithm 1:  
```
Input: NIfTI Image \(\mathcal{M}\) (630 \(\times\) 630) \(\mid\) | Watermark \(\mathbb{I}\) (128 \(\times\) 128) Output: Watermarked NIfTI image Step 1. Segregate meta information and select the slice \(S\) as per the above discussion from the image. Step 2. Perform one-level LWT on the original image S \(\text{LWT(S)}=[\text{LH, HL, LL, HH}]\) Step 3. Using Equation (1), apply SLT on the LL band. \(\text{SLT[LL]}=[\text{LH, HL, LL, HH}]\) Step 4. Apply the BSVD on the LL band using Equation (13), so we obtain five matrixes \(\text{U}_{\text{X}}\), \(\text{U}_{\text{W}}\), \(\text{S}\), \(\text{V}_{\text{W}}^{\text{T}}\), and \(\text{V}_{\text{X}}^{\text{T}}\), where the S matrix is the bidiagonal singular matrix of the slice. \(\text{BSVD(LL)}=\text{U}_{\text{X}}\times\text{U}_{\text{W}}\times\text{S} \times\text{V}_{\text{W}}^{\text{T}}\times\text{V}_{\text{X}}^{\text{T}}\) Step 5. Perform ACM on the watermark using the key using Equation (14). \(\mathcal{K}=\text{ACM(\mathbb{I})}\) Step 6. Encrypted watermark's bits are embedded in the singular values of matrix S as \(\text{S}+\rho\mathcal{K}=\text{U}_{\text{X}}\times\text{S}_{\text{C}}\times \text{V}_{\text{K}}^{\text{T}}\) (19) where \(\rho\) is the embedding strength. Step 7. The modified LL band of the SLT transform is evaluated as in Equation (20). \(\text{LL}_{\text{mod}}=\text{U}_{\text{X}}\times\text{U}_{\text{W}}\times \text{S}_{\text{C}}\times\text{V}_{\text{W}}^{\text{T}}\times\text{V}_{\text {X}}^{\text{T}}\) (20) Step 8. Perform inverse SLT transform using \(\text{LL}_{\text{mod}}\) as the following equation \(\text{LL}^{\prime}=\text{ISLT}[\text{LL}_{\text{mod}},\text{ LH, HL, HH}]\) Step 9. To create the final watermarked slice S\({}^{\prime}\), conduct inverse LWT: \(\text{S}^{\prime}=\text{LWT}[\text{LL}^{\prime},\text{ LH, HL, HH}]\) Step 10. To generate the final watermarked NIfTI image M\({}^{\prime}\), we combine the patient's metadata and other slices with the watermarked slice.
```  
**Algorithm 1** Watermark Embedding Process  
The above-discussed watermarking steps can be applied to any slice of the NIfTI image for watermark embedding. If someone is more worried about security, they can insert the watermark into multiple slices of the NIfTI image. As we know, the NIfTI images are an array of slices where some slices at the beginning and end have less medical information. Therefore, the selection from these slices never hampers the patient's diagnosis, but if in-between slices are used for watermark insertion, an incorrect diagnosis may be reached. However, we used these slices for the experiment to prove the superiority of the proposed watermarking approach. Figure 2 provides a graphical representation of the whole process of embedding a watermark in an NIfTI image.