## 3 The Proposed IoMT Model
### Secure Data Transmission and Storage
This makes the character set a lookup table for the modified Caesar cipher instead of the mere shifting of alphabets in the traditional Caesar cipher. The lookup table is based on modular addition and subtraction in modulus 256. During the encryption process, an ASCII character found at location i on the block of plaintext and at location j on the lookup table (the reshuffled ASCII characters table) will be represented by an ASCII character at location \(t=(i+j)mod\ length(lookupable)\) of the lookup table to form ciphertext character. During the decryption process, an ASCII character found at location j on the ciphertext block and location t on the lookup table will be represented by an ASCII character at location \(i=(t-j)mod\ length(lookupable)\). This concept is based on the quotient remainder theorem. \[\text{Let }t=(i+j)mod\ m=(i\ mod\ m+j\ mod\ m)mod\ m \tag{2}\]  
From the quotient remainder theorem, \(i\) and \(j\) can be written as:  
\[i=mq_{1}+rnd_{1},\quad i\ mod\ c=rnd_{1}\]  
\[j=mq_{2}+rnd_{2},\ \ j\ mod\ m=rnd_{2}\]  
_where \(m\) is the divisor, \(q_{1}\) and \(q_{2}\) are quotients in each case_  
\[\text{and }rnd_{1},\ rnd_{2}\text{ are remainder in each }\text{ case}\]  
\[t\text{ can be defined in terms of }i\text{ and }j\text{ as follows}\]  
\[t=mq_{1}+rnd_{1}+mq_{2}+rnd_{2}\]\[t=m(q_{1}+q_{2})+rmd_{1}+rmd_{2}\]  
\[(t-i)=m(q_{1}+q_{2})+rmd_{1}+rmd_{2}-(mq_{1}+rmd_{1})\]  
Figure 2:0  
Figure 2:1  
Figure 2:2  
Figure 2:3  
Figure 2:4  
Hence, encryption and decryption can be conducted as base on this theorem. A detailed description of the operations of the modified Caesar encryption module is given in Algorithm 5a. ```
Input: set of Blocktext, Binkey Output: a set of encryptedblocktext: Variables: caesarchar: 1D array of ASCII characters as reshuffled
1. START
2. LET alphabet = 0:255
3. COUNT the number of zeros and ones in binkey, X
4. confusionkey = CALL Randgen(X,256)// Algorithm 5d
5. caesarchar = Resthuffleforencryption(confusionkey, alphabet)// Algorithm 5c
6. Blocktext = Blocktex XOR Binkey
7. Blocktext = Bitmodification(Blocktext,x1)// Algorithm 5b
8. INITIALIZE c = '' // a string with no character
9. FOR i = 1 TO number of characters in Blocktext
10. ch = Charcasarcarorororor (i)
11. FOR j = 1 TO LENGTH(alphabet)
12. CONVERT ch to decimal number chno
13. IF chno = caesarchar(j) THEN
14. t = (i+j) MOD (LENGTH(alphabet))
15. BREAK
16. ENDIF
17. END FOR
18. c = CONCATENATE (c, caesarchar(t))
19. END FOR
20. LET encryptedblocktext = c
21. STOP
```  
**Algorithm 5a:** Modified Caesar Encryption Module (HMCC)  
To ensure diffusion and confusion in the modified Caesar cipher, a bit modification function was introduced for encryption, and a reverse bit modification function which reverses encryption bit modification was introduced during the decryption process. In these modules, bit grouping, bit reshuffling, and exclusive OR operations were used to ensure proper mixing of key and plaintext bits, which ensures diffusion and confusion in HMCC. Algorithm 5b gives the procedure for bit modification, which introduces diffusion and confusion into the modified Caesar algorithm. ```
Module encmanipulatedbits = Enbitmanipulation(binarystr, randomseed) Output: encmanipulatedbits
1. START
2. randb = CHANGE randomseed to string of bits
3. rseeds = COUNT the number of bits in randb
4. Randkeys = ARRAY [1.. rseeds] of random seeds // geerated using randomseed
5. nibbleleft = ''
6. nibbleright = ''
7. sizeofbit = LENGTH (binarystr)
8. FOR i = 1 to sizeofbit, STEP 1 byte  i. onebyte = binarystr(ii + 7)  ii. nibbleleft = CONCATENATE (nibbleleft, onebyte(1:4))  iii. nibbleright = CONCATENATE(nibbleright, onebyte(5:8))  END FOR
9. FOR j = 1 to rseeds
1. Seed1 = Randkeys(j)
1. nibblext = nibbleleft XOR nibbleright
2. Rbyte = CONCATENATE(nibblexor, nibbleright)
3. confusionkey = GENERATE sizeofbit random integers from Seed1 v. manipbit = CALL Reshuffleforencryption(Fbyte, confusionkey)
6. nibbleleft = manipbit(1: sizeofbit/2)
7. nibbleright = manipbit(sizeofbit/2 + 1: sizeofbit)
8.