PMHE is a cloud computing framework for smart medical systems based on blockchain and homomorphic encryption technology. The wearable medical device transmits the collected physiological data of the user to the client, and then the client encodes and encrypts the data. The encrypted plaintexts is transmitted to the blockchain and triggers a smart contract on the blockchain. The AI prediction model written using smart contract calculates the ciphertext and predicts the results. The client receives the resulting message after homomorphic operations from the cloud server, and finally gets the predictive plaintext by homomorphic decryption. According to the plaintext information, the client can predict the user's disease or evaluate the user's health status. The Program framework of PMHE with CKKS Supporting in Fig. 3.
The basic idea of PMHE is to use CKKS encryption algorithm to encrypt plaintext into ciphertext during medical data transmission, calculation, and storage. And the entire process of computing is encrypted to ensure data integrity, privacy and security. Therefore, it is necessary to improve each stage in order to use ciphertext to achieve its function. Table 1 lists the symbols involved in PMHE.
4.1 The Design of Data Tuple
CKKS encryption algorithm only supports addition and multiplication, but AI model involves some functional operations which do not meet homomorphism characteristic, such as exponential function, logarithmic function , square root function etc. Although some functions can be converted to addition and multiplication by polyfit (for example, sigmod can be fitted using polynomial approximation), a lot of ciphertext operations need to be performed in blockchain network. These extra operations will not only result in a loss of efficiency, but will more likely exceed the CKKS multiplication limit.
In PMHE, the AI model algorithm is converted into the formation of the data and their polynomial, so that the number of multiplications meets the CKKS limit. The cloud and the client interact by protocol. The server notifies the client to provide basic functions or basic functions’ combination of the original data. The client encrypts the original data and the corresponding function values, and then sends them together to the server in the form of data tuple, so as to the server can perform homomorphic addition and multiplication operations. The AI model can calculate these encrypted data efficiently and conveniently. The protocol using in PMHE is described as follows:
1). the server sends the tuple template to the client.
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaIAAAAmCAYAAACGXZ8VAAAIGElEQVR4nO2csW/TThTHX347oIitQlUUe2djQCFDh17+gEpNO7HaYkFCQY0YK5CtzE3ExBRn6FpgYogDQ6f+AbGFEOqULvwDx1Cdf/blbF8SN07o9yNliB37np/fve/57jkVzjknAAAAoCT+K9sAAAAA9xsIEQAAgFKBEAEAACgVCBEAAIBSgRABAAAoFQgRAACAUoEQAQAAK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14uWqvhCkLaDqHisWWlWVhcucNwiCtRVkqPwqrilerIAqNqBLXvm2TNYgaVE2SohEeaxMt9vl1Wo11UlpDhEJT1XZsYiSr1p1VMQNy0qMFxcXWolTjPzXVcEm7IonyyKDd5XRmCiL5lydrHV9Ko5f54uwKr8yxni1Wk2UWBcl+OD+kPbagYzneZv9QuuqFDmNIB4tt70z6kzd6SCmmf71v0vSIf6SqzzlsCh5U4BlYBgGSqnBUuQNFu/iL34qnHO++koTAAAAsBxb8e/bAAAA/l0gRAAAAEoFQgQAAKBUIEQAAABKBUIEAACgVCBEAAAASgVCBAAAoFQgRAAAAEoFQgQAAKBUIEQAAABKBUIEAACgVCBEAAAASuUvFNuwNYxtARAAAAAASUVORK5CYII=)
Where x, y, z, w are the original data of the client. is the meta function of the original data. The original data of the independent variable is not all empty.
2). The client responds to the server, encodes the original data and value of meta functions required by the server as operation factors, encrypts them into ciphertext M in the form of tuples, and sends them to the server.
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZkAAABdCAYAAAB3qxvYAAASgElEQVR4nO3dv2vb+P8H8Ke/fNajDb0phBAsbXdHl5IhqB4yWJ5uCtRpl0wFiVvuCC5t080cJ1E6xqVTlkY+yFpIMmSwhAdfDwLHcYsljC90agr3F7y/Q+8tJP/+Idlq7vkA00aW3nrr5+v9S1ZOCCFARESUgv9bdgaIiOjmYpAhIqLUMMgQEVFqGGQyyvM85HK52IeI6EvDIJNRmqbBMAw4jgMhBCzLWnaWiIimluPosuxSVRXtdhumaeLw8HDq5a+vr/Hq1SvUajV8+vQphRwSEY3GmkxGBUEA3/eRy+VQKBRmSuPFixc4Pz/H+/fvE84dEdFkWJPJqHq9jkajgUKhgM3NTeTz+amWv76+xtdffw3f96delogoKazJZJQMMOVyGS9fvoTneVMt/9dff0FRFAYYIloqBpkMKpVKqNVq2N3dRS6Xw/n5OTRNmzodVVVTyB0R0eQYZDLo9PQUQojw0263Z0rn+vp64HTbtqGqKkql0jzZJCIa64sIMl/yzX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h8c1DMPcGEju6ekYW0pKQvZXdyBStOqosy5VhTwYMi+KuGdap8uwuqMkT4jHOD+rY9EPwRZRXas+ASVR17ZhGObUnK5ilzVWTzHm86AOT4jMC/Ky+SNR90O9x0bdcZac0/tm2zur2x6bs5vng8ciobkK/HEOgEOkpyDxxcVFKUH5GTl5F1EYy1JsVcGbiVUhlaU+2ZalrMrSUL8bqvCEoffNxB+l1NI+gvzd7Vh3wZbpZz0d9ZjC6XfFH+UAOKWg7y38yeB0yWM6vDqLhOu69PLly5VNNs77sx3+JDCHfd9/lMWKU0mr/m9VFkUd/gGgV69e/faO7angEK3/M7g11lhjjb8RM8dA11hjjTXW+DuwdgBrrLHGGn8p/gXiLhIRquLsRAAAAABJRU5ErkJggg==)
3). While the server receives the ciphertext data, it uploads them to the blockchain, where the AI prediction model can directly perform approximate calculations on ciphertext and eventually send the prediction results to the client.
Q = F (x, y, z, w) (5)
Z =F(M) (6)
Q ≈ D(Dec(Z)) (7)
4.2 PMHE Scheme
In PMHE, a data tuple is generated on the client side firstly and then submits the tuple data using CKKS homomorphic encryption to hide valuable information. An ideal property of the CKKS scheme is that the ciphertext can be computed directly without prior decryption of the ciphertext. Therefore, privacy security, data authorization distribution and secure transmission of personal data are ensured.
TABLE 1. PMHE symbol definition
Symbol
|
Definition Description
|
Enc
|
Cryptographic operations
|
Dec
|
Decryption operation
|
E
|
Encoding operation
|
D
|
Decoding operation
|
P
|
Original data
|
B
|
Plaintext
|
M
|
Encrypted plaintext
|
Q
|
Unencrypted computation on original data
|
Z
|
Resulting message after homomorphic operations
|
S
|
Server
|
C
|
Client
|
x
|
Heart rate
|
y
|
Diastolic blood pressure
|
z
|
Systolic pressure
|
w
|
Respiratory rate
|
F
|
Disease prediction AI algorithm
|
1) INITIALIZATION. In the initialization phase, the user registers with the client APP, connects the client to the wearable device, and generates the public/private key pair. The public key represents the unique identity and is used to protect data in homomorphic encryption algorithms. The private key is used to sign the submitted data, verify the user's identity, and decrypt the calculation results returned by the cloud.
2) SUBMIT.AI model is deployed on the blockchain and implemented as a smart contract.The client obtains the physiological data collected by the wearable device, encrypts them with the public key after coding, and submits them to the cloud application. The cloud calls the corresponding smart contract, performs the data calculation, and saves the data to the blockchain.
3) PREDICTION. Based on the physiological data collected by wearable devices, ciphertext is calculated in the AI model. After the calculation, the result Z is obtained. In the calculation process of AI model based on homomorphic encryption technology, the valuable information contained in the data cannot be observed, which ensures the privacy of user data.
4) REPORT. Transforming physiological indicator data collected by wearable devices into disease prediction results with medical value provides users with low-cost, high-quality and high-precision medical information. For example, intelligent heart health assessment algorithm can efficiently and accurately predict whether a person has coronary heart disease, and is not affected by the individual ability of the doctor. However, the results in encrypted formation cannot be used for diagnostics, so the server cannot understand it and sends the results to the client.
5) DIAGNOSIS. After the client receives the operation result of the ciphertext, it decodes and decrypts it with the private key to get the unencrypted AI model result Q, and then compares the model reference criteria to give the diagnostic result.
4.3 Smart Contract
Smart contracts can be used to accomplish more complex business logic when more business and application requirements need to be fulfilled in the blockchain. Essentially, smart contracts are pieces of executable code that run in a blockchain, so they have the same decentralized and autonomous characteristics as blockchain. In the PMHE framework, the principle of full homomorphic encryption based on smart contracts is as follows[22]:
1) setup(m):It refers to the function that selects AI model according to parameter m.
2) receive(List(tuple)):It refers to receiving a list of encrypted data tuples from the client
3) issue(result):It refers to issue the results of the AI model operation on encrypted data to the client
4) add(pk, ciphertext1, ciphertext2):It refers to the homomorphic function of addition, which can be used by users to perform addition calculations on ciphertext data
5) mult(pk, ciphertext1, ciphertext2):It refers to a homomorphic function of multiplication that users can use to multiply on ciphertext data.
The formal description of the FHE-Contract algorithm is as follows:
- Input: The encrypted dataset uploaded by the client
- Output: The results of the homomorphic calculation on the encrypted data. The specific algorithm description is shown in Fig. 4.