Homomorphic encryption
Another technique that lets us implement computations on encrypted data is called homomorphic encryption. This capability is helpful in machine learning settings, for example, in using a model for inference on encrypted data without the need for decryption. However, implementing fully homomorphic encryption can be complex, computationally expensive, and memory-inefficient (Armknecht et al., 2015; Gentry et al., 2009; Yousuf et al., 2020).
There are a few Python libraries that can help us practice with homomorphic encryption schemes, such as the following:
TenSEAL
(https://github.com/OpenMined/TenSEAL), which can be integrated with PyTorch and NumPyPySEAL
(https://github.com/Huelse/PySEAL)HElib
(https://github.com/homenc/HElib)
Let’s see a simple example of using homomorphic encryption using TenSEAL.
We first import the TenSEAL
library and generate a context
object using tenseal.context()
. The context
object generates and...