ibarrond / Pyfhel

PYthon For Homomorphic Encryption Libraries, perform encrypted computations such as sum, mult, scalar product or matrix multiplication in Python, with NumPy compatibility. Uses SEAL/PALISADE as backends, implemented using Cython.
https://pyfhel.readthedocs.io/
Apache License 2.0
475 stars 78 forks source link

Loading Saved ciphertext and decrypting it #222

Closed priyanka92feb closed 9 months ago

priyanka92feb commented 11 months ago

Hello,

I am using Pyfhel to encrypt an integer and then saving it to a file. When I load the file in the same execution context, I am able to decrypt and get the expected result. But when I use a previously stored file to load the PyCtxt, the decryption result is random. Could you help me understand what could be going wrong?

Below are samples post decryption.

Thanks Priyanka

Result with a temp file saved in the same execution context

. Decrypting result:

int1: decrypt(ctxt1) = [98 0 0 … 0 0 0]

Result with previously saved ciphertext file

. Decrypting result:

int1: decrypt(ctxt1) = [ 28041 17905 21111 … -2426 6702 -23364]

ibarrond commented 9 months ago

@priyanka92feb Closing as there is no code to reproduce the error. Please, feel free to reopen using the "bug" template with all the details requested.