# A Novel Fragmented Approach for Securing Medical Health Records in Multimodal Medical Images
## 3 Materials and Methods
### Proposed Modified LSB Embedding Process for Medical Images  
The process that is needed to hide a secret message in a cover image to generate a new image is called the embedding process. When any information is hidden, there is a stego-key, which could come in different forms, such as a password or face recognition for more security measures. The output of hiding a secret message inside a cover image is called stego-image or stego-object. The following are the proposed steps for the securely embedding phase of the patient's prescription text to the medical images. 1. The patient's confidential text-based information is encrypted using a well-known encryption algorithm (e.g., AES128) with the secret key (password) to generate the ciphertext. 2. The ciphertext document is fragmented into several documents, each containing a portion of the original message, which is not comprehendible on its own, even if it is detected and decrypted. 3. Typically, 100 to 180 medical images (CT/MRI/Ultrasound) are captured for analysis of a particular human brain; therefore, only selected medical images are used to embed the cipher text instead of using all medical images, which makes it more challenging to find the images with the patient information. 4. A key generator is proposed to randomly select the medical images for a patient according to the number of files generated from the fragmentation. 5. Each fragmented cipher text is embedded into the corresponding image using the modified LSB insertion mechanism with an offset value. 1. The LSB insertion mechanism consists of randomly inserting the hidden text bits within the image to be verified by the offset. This mechanism applies to every bit to embed the hidden message into 8 pixels. The secret of this operation is the offset number or hop number, which is basically the power of two (2, 4, 8, \(\ldots\)32). For instance, when the offset is (4), the processor will plug in the first bit in byte number one, the next bit in byte number five, and the third bit in byte number nine. When a particular image end is reached, the loop will start back from byte two to six, then ten, and so on. The randomization aspects ingrained in this process ensure more secure data embedding within the image. The proposed method is not merely a technical procedure but a precisely orchestrated process that enhances data security while maintaining image fidelity. Algorithm 1 presents the steps of the proposed modified LSB embedding process for medical images. The process for embedding encrypted data into an image starts by converting the ciphertext into a one-dimensional array of bits (C) and the image into a one-dimensional array of pixels (M), additionally breaking down each pixel's color channels into a bit stream. A selection is made for the number of least significant bits (LSBs) to replace in the image pixels to embed the encrypted data, offering a choice from one to four bits. The embedding process iterates over the size of the ciphertext, incrementing the pixel position (pj) by an offset iteration (itr) each time. For each bit of ciphertext, the corresponding LSBs in the RGB channels of the pixel at position pj are replaced with the ciphertext bits, advancing through the image's channels and the selected number of LSBs. If the pixel count exceeds the size of the array of pixels (M), the pixel count resets, and the offset iteration increases to ensure a comprehensive and evenly spread embedding. After the embedding is complete, the modified one-dimensional array of pixels is converted back into an image with the original dimensions (height h, width w), now containing the hidden encrypted information. Figure 4: Flowchart for the first phase of the patient prescription embedding to medical images.