# functional encryption over homomorphic encryption

I recently read about "functional encryption" which seems interesting, although I didn't understand yet how it works ... but is it possible to combine it or adapt it with homomorphic encryption in the context of neural networks particularly.

Suppose you have a neural network that you run over some data encrypted homomorphically (say paillier for example) .. linear computations will be performed without any problem .. but the only issue will be with activation functions which are non linear, and thus require to decrypt the intermediate results (weighted sums) in order to apply the activation functions ...

in case we don't want to disclose the private key, can we use something like functional encryption in order to allow the application of activation functions only, something like a special private key that allows only a specific activation function to be performed, and do not allow to decrypt any other information ?!

• what kind of non linear function do you have? is it degree 2? why you can not use homomorphic encryption to compute the result of activation function without decrypting the intermediate results? if your activation function is maximum degree 2 and you don't want to decrypt any intermediate value, you can use FE but for more than that you should use HE. Oct 16 '20 at 8:13
• Thanks ... nonlinear functions include for eg. sigmoid, relu, tanh or any other activation function used in neural networks ... one main method used is to polynomial approximate such functions so that they become linear and thus can be performed under Homomorphic encryption ... but the problem is that this method impacts the accuracy of neural networks ... this is why I'm trying to apply it without any approximation. Oct 16 '20 at 11:32

The main difference between FE and HE is that: In HE, for the decryption you need to interact with the owner of the secret-key, but in FE everybody who has access to the ciphertext and functional key can decrypt the massage. While HE can efficiently support different kinds of computation over encrypted data, FE supports limited class of functionality (in theory it still can support general functionality). This limited class includes: inner-product (which might be what you called weighted sum) and quadratic functionality. Recently there has been a European Project called FENTEC, they are trying to implement the existing FE schemes.

• Thanks .. but can we combine between the two ... ie. allow to perform a function (more precisely nonlinear activation function) on a data encrypted homomorphically using a special key working only with this function like in FE ? Oct 16 '20 at 11:35
• Could you give me a link about FENTEC ?
– Land
Jul 7 at 11:18

In theory, you appear to be right. A combination of HE and FE for that particular use case, where FE computes the non-linear operations, might be useful.
However, you need an appropriate FE scheme that can operate correctly on HE-encrypted data, or a protocol to switch between HE and FE-compatible scheme. Nowadays such scheme doesn't exist - and currently there are only linear and quadratic FE schemes. (e.g. https://github.com/fentec-project/CiFEr).
Rather than that, once you have a practical FE scheme for any desired function - you can use FE only.
You can implement kind-of FE over secure hardware, e.g. IRON: Functional encryption using SGX, Boneh et al. , but of course in this case the security level is limited to the secure HW implementation.

Functional encryption is more general than homomorphic encryption and can emulate one.

In homomorphic encryption you have the operation circuit that takes some encrypted data, decrypts them internally, performs an operation and encrypts again.

In functional encryption you have a similar circuit that takes encrypted data, decrypts them internally, performs an operation and returns the cleartext result.

You want to emulate HE with FE? No problem, just append the encryption circuit at the end of your operation circuit. Now it doesn't mean this scheme would be practical. Using the dedicated HE algorithm would probably be more efficient.

FE gives you ability to selectively decrypt certain data. In HE it's all or nothing, you have the decryption key or not. With FE you can share a public key that decrypts only the data you want.

• Neither HE nor FE "decrypts internally" the data. The whole idea is to operate on encrypted data without decryption. Feb 25 at 11:38