Open Rana-KV opened 3 weeks ago
Hi @Rana-KV , have you try to modify the binding.cpp in openfhe-python to add the function Serialize() for only binary data. I used to face the issue same as you and I tried that way and it worked for me.
@Manhbui1208 could you create a PR for your code?
I have an implementation that's working in serialization.cpp
. I'll send a PR shortly.
Issue: Currently, the Python wrapper for OpenFHE includes the SerializeToFile() method, which allows saving ciphertext or keys into a file. However, in many projects, it is often necessary to work with binary data directly in variables for uploading to a database or for other management purposes, rather than storing it in a file.
For instance, when storing encrypted data in a database, I encountered an issue where I had to first create a file to store the data, then read the file contents to get the data into a variable, and finally use the variable to upload to the database. This process introduces unnecessary overhead and complexity.
OpenFHE Python has the potential to be a part of many complex projects, and this limitation poses a significant setback for working on large-scale projects. The overhead can be completely avoided, and it would be much easier if we had a Serialize() method, similar to the one in the C++ OpenFHE project.
Potential Solution: Implement a Serialize() method in the OpenFHE Python wrapper that allows direct serialization of ciphertext or keys into a binary data variable.
By adding this feature, we can streamline workflows and enhance the usability of OpenFHE Python for large-scale projects.