Proxy Re-encryption Using CKKS

Hi,

I started experimenting with the PALISADE library for the project I’m working on, I would like to perform Proxy Re-encryption using CKKS ciphertexts of real values. I checked the example codes (in src/pke/examples) there is regarding Proxy Re-encryption (especially the pre.cpp one).

In this example we have access to two sets of parameters BFV-PRE and Null-PRE. I tested the code with the BFV-PRE parameters and it worked fine.

But I would like to perform the same tasks with CKKS and there are no parameter sets for this scheme. But it is written in the documentation that Proxy Re-encryption is supported for CKKS. So I guess I have to build my own CryptoContext with CKKS.

So here are my questions :

  • First of all, do I have to build my own CryptoContext to use pre with CKKS ? and if yes is there any specific detail I have to pay attention to while doing it ?
  • After building my own CryptoContext with CKKS will functions such as cryptoContext->ReKeyGen or , cryptoContext->ReEncrypt still can be used ?

Thank you in advance for your help !

At a high level, the logic for CKKS should be the same as shown in openfhe-development/pre-buffer.cpp at main · openfheorg/openfhe-development · GitHub for BFV. The only difference is in the cryptocontext generation and encoding of vectors of real numbers rather than vectors of integers.

I also suggest looking at the unit tests for PRE using CKKS: openfhe-development/UnitTestCKKSrns.cpp at main · openfheorg/openfhe-development · GitHub (Search for “UnitTest_ReEncryption” there.)

For CKKS CryptoContext generation, you can use the code in openfhe-development/simple-real-numbers.cpp at main · openfheorg/openfhe-development · GitHub You will only need to add one line to this code.

cc->Enable(PRE);

Note that in CKKS, PRE introduces approximation errors, just like it does in any CKKS computations. So I recommend using this approach only when you need to use CKKS for some FHE computations, i.e., the approximation error is not an issue. Otherwise, BGV or BFV should be a better option as no approximation error is introduced.

1 Like