A Privacy-Preserving Machine Learning (PPML) protocol that is resource friendly to edge devices using Hybrid Homomorphic Encryption (HHE). It is built on top of the SEAL (for HE) and PASTA (for HHE) libraries.
cpp==9.4.0
CMAKE>=3.13
SEAL==4.0.0
The Microsoft SEAL library is already installed in libs/seal
. Also, our code are developed based on the PASTA framework for HHE.
├── configs
│ ├── config.cpp # hold the configurations (HE parameters, number of runs for experiments...)
├── experiments # hold the code for the experiments reported in the paper
├── images # hold the images in `README.md`
├── protocols # hold the demo code for the protocols in the paper
├── src # hold the components needed to build the protocols
├── tests # hold the unit tests
└── util # hold the utility code used in PASTA and for data communication via sockets
The protocol consists of 3 parties: a client who holds the data, the analyst who holds the neural network weights and biases, and the cloud service provider (CSP) who holds the computing power.
- First, the analyst creates the necessary HE parameters and keys.
- Then, the analyst sends the public key to the client and the evaluation key to the CSP to compute on encrypted data.
- Next, the analyst encrypts his weights and biases using HE and send them to the CSP. The encrypted weights and biases are denoted
c_w
andc_b
respectively. - The client generates a symmetric key (
K
) and encrypts his plaintext data (x
) using a symmetric key encryption algorithm. We denote the symmetrically encrypted datac
. He also uses the HE public key to homomorphically encrypt his symmetric key, which isc_K
. - The client sends both
c
andc_K
to the CSP. - After receiving the HE evaluation key
evk
from the analyst,c
andc_K
from the client, the CSP performs the HHE decomposition algorithm to turnc
intoc'
, wherec'
is the HE encrypted version ofx
. The CSP then can perform HE computations onc'
,c_w
andc_b
and get the resultc_res
. - The CSP sends
c_res
to the analyst who can decrypt it using the HE private key to get the answers on data he did not get access to.
In the terminal, cd
into the project's directory, then run