## 3 The Proposed IoMT Model
### Secure Data Transmission and Storage  
Maintaining security requirements during data transmission is of paramount importance for reliable and dependable communication. For confidentiality in the communication, the message being transmitted must be encrypted by the client (sender) before transferring it to the recipient. Thus, illegal access to the message being transferred is prevented [(60; 61)]. Integrity, authentication, authorization, and non-repudiation can be obtained through the process of signing and verification of the transmitted data. A client that wants to store information in the cloud has to create public and private keys using the agreed EC. The recipient (HC) verifies if the request is coming from a registered member. The request is granted by the HC if the HC generates its own private and public keys and sends the public key as a response to the request. Both the client and HC form a shared secrete key, ssk, for the encryption and decryption for the communication. Figure 2 depicts the scenario. Figure 3 describes how patients' information is stored in the cloud being used by the HC where the patient has registered and how the information can be retrieved anywhere, anytime by the patient or any authorized user. The message originating from a client is first encrypted. The hash value of the encrypted message is taken and converted to an integer. The encrypted message is then appended with time stamp T and signed using ssk before it is sent to the cloud. When the message is received in the cloud, the message is authenticated to be sure that the message is from a registered client of the cloud and has not been tampered with during transmission. If it is found to be registered, the cloud uses the integer generated from the hash value to determine the location in the cloud where the information is to be stored using B+ file organization and updates the patient record with the integer. The encryption and decryption processes in the proposed model are discussed as follows:  
1. **Encryption of the message**  
The data to be encrypted are divided into blocks. Each block is converted to binary digits. Algorithm 4 describes how plaintext is divided into blocks of an equal number of characters. Figure 3: Secure information storage and retrieval from the proposed IoMT model. Figure 2: Formation of the shared secrete key using ECDH. ```
Input: Ptext Output: blocks // a set of strings with equal number of characters

1. LET M = number of characters in Ptext
2. COMPUTE the size of each block from the chosen elliptic curve, \(N=FLOOR\left(\frac{p-8}{8}\right)\)
3. COMPUTE the number of blocks in the Ptext \(numblocks=CEIL\left(\frac{M}{N}\right)\)
4. LET B = [ ]
5. t = 1
6. FOR i = 1 TO num blocks
7. B[i] = Ptext[!t: t+ N]
8. t = t + N
9. ENDFOR
10. \(blocks\ \longleftarrow\ B\)
11. STOP
```  
**Algorithm 4**Conversion of plaintext into blocks of an equal number of characters  
A modified version of the Caesar algorithm is used for encryption and decryption purposes. The modification to the existing Caesar algorithm became very necessary as a result of its vulnerability to different cryptanalysis attacks, low key space, and lack of diffusion and confusion properties which are required for modern-day cryptographic algorithms. The following discusses the modifications made to the existing Caesar cipher which make it unbreakable. Both encryption and decryption Caesar algorithms were modified. The following modifications were made to the existing Caesar cipher:  
1. The generation of a key for rearranging ASCII characters from the ssk key;
2. The introduction of confusion property into ciphertext by reshuffling of ASCII characters using Modified Columnar Transposition technique;
3. The introduction of diffusion and confusion property through the modification of bits of the mixture of the plaintext and secrete key, and;
4. The determination of ciphertext characters based on the location of the character in the plaintext and the location in the character set in the reshuffled ASCII characters.