A Concise Introduction to Fully Homomorphic Encryption
-
date_range 24/12/2021 22:30 infosortdefaultlabelHomomorphic EncryptionPrivacy Preserving
Recently, I have been working on privacy preserving on machine learning. Fully homomorphic encryption is one of the promising ways to do privacy preserving.
What is fully homomorphic encryption?
Fully homomorphic encryption (FHE) is a scheme to keep the encrypted data and operate on the encrypted data without decrypting it. Data providers might just provide encrypted data to service providers. The service providers run their services on their cloud/platform with the encrypted data all the way along and return the results to data providers. Then data providers decrypt the result on their sides. It is useful for privacy preserving scenarios such as medical record data, personal data and other sensitive data.
It is kind of complementary to the secure multiparty computation.
Mathematically, we define a basic operation \(\boldsymbol{op}\) standing for “+” , “-“ and “*”. Assume there exist two variables \(a\) and \(b\), we have,
\[Encrypt(a) \,op \, Encrypt(b) = Encrypt(a \,op \, b)\]Advantage:
— The data stays encrypted at all times, which is suitable for cloud computation
— There is no need to mask or drop any features in order to preserve the privacy of data.
Disadvantage:
The computation is heavy and infeaible for commercial usage.
Use case:
Although it involves heavy computation currently, this seems suitable for the machine learning inference with a pretrained machine learning model. Also, there are some research on simple image classification with high accuracy, such as the handwiritten recognition, which indicate seems promising.
Libraries:
There are several open source library now. Each library has it’s own APIs.
Examples are HElib, Microsoft SEAL and Google FHE.
Test:
Here I am testing the fully homomorphic encryption scheme based on Microsoft SEAL library with a python interface (TenSEAL)
After installing the tenseal library, we could use it to operate on 1D vectors, 2D tensors.
Here it shows the encryption and decryption on the vector operation.