# Homomorphic Encryption Based Privacy-Preservation for IoMT
## 3 Proposed Scheme
### Workflow of the Proposed Scheme
#### 3.2.3 Homomorphic Encryption  
The proposed scheme's data privacy features are ensured using homomorphic encryption of the plaintext data received from individual IoMT devices. The entire encryption process is performed at the local base station. The objective in this phase is to ensure that individual data \((x_{i})\) received from \((d_{1},\ d_{2}\ \dots\dots,\ d_{i})\) is not available as plaintext \((p_{1},\ p_{2},\dots\dots p_{n})\) for cyberattackers and untrusted cloud servers. To solve this, we encrypt the data using \(c_{i}=Enc(x_{i})\), where \((c)\) represents the ciphertext data and is used to perform further computation operations.  
Homomorphic encryption includes four algorithms, which are as follows:  
1. KeyGen (): The Key Generation algorithm uses a KeyGen () function to construct three keys, the public key (_pk_), secret key (_sk_), and a verification key (_vk_).
2. Enc (): The encryption algorithm _generates_ the ciphertext (\(c\)) using parameters including the _sk_, the dataset (\(x\)), and the label (\(l\)) of the dataset. The Enc () function is represented as \(Enc\ (sk,\ l,\ x)\).  
Figure 3: Time synchronization protocol.  
Eval (): The evaluation algorithm at the physical base station receives a query from the intelligent healthcare application (DU) to perform computational operations. The Eval () function includes parameters, _pk_, the homomorphic function (_f_), the ciphertext (_c_) and is represented as _Eval (pk_, \(f\), _c_).
4. Dec (): The DU using the decryption algorithm verifies the computed data received from the base station and chooses to accept or reject it. The Dec () function is represented as _Dec (sk_, _DUQ, c_), where _DUQ_ is the query sent by the DU.  
The base station creates the _pk_, _sk_, and encryption keys (_k_e_) using KeyGen (). Data encryption initiates with inputs _sk_, \(l\) \(\mathcal{L}\), and \(x\) \(\in\) for Enc (). The resultant output of the function is \(c\).  
Computation of encrypted data using the Eval () function is performed to derive powerful analytics for the DU and the DO. Such heavy tasks are performed by computationally powerful machines which do not include the IoMT devices. Mathematical operations, such as addition and multiplication, completed on the cloud environment directly result in a lack of computation privacy. A third-party cloud service is an untrusted entity, and a cyberattack on the cloud layer exposes the operations performed on the network. This paper assumes the healthcare network implements a cloud service to provide computational resources to the local physical base station. The homomorphic Enc () function performs encryption directly on the base station, and the computation operations are performed on the VENs. The VENs preserve computational privacy, as each node is provided with an equivalent amount of resources to perform computation operations. In cloud-based systems, third-party service providers attempt to guess the data output by observing the addition and multiplicative functions executed, resulting in exposure of private user data on the network.  
The DU requiring the output of the selected mathematical computation operation on the data selects the _k_e and the ciphertext \(c_{1},\ c_{2},\ \ldots\ldots,\ c_{j}\) and provides them as input for _Eval (k_e, _op_, \(c\)1, \(c\)2, \ldots\ldots,\ c_{j}\)). Data evaluation requires it to be shared with different VENs using the homomorphic secret sharing mechanism. The final computation result is a ciphertext transmitted to the DU, decrypting the ciphertext using the Dec () function.