Loading Saved ciphertext and decrypting it


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.


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]

You might have better luck reaching out to the Pyfhel team. It could be because of a variety of reasons - if you can recreate the issue directly in OpenFHE then we will be better equipped to help.

Thanks @iquah.

Raised an issue on Pyfhel Github. Hopefully I will hear back soon. I might leave this post open for now, in case anyone else is aware of anything. Also in the meantime, I will see if I can replicate the issue in openFHE.