Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Serialize() Method for Direct Binary Data Handling #145

Closed
Rana-KV opened this issue Jun 8, 2024 · 3 comments · Fixed by #155
Closed

Add Serialize() Method for Direct Binary Data Handling #145

Rana-KV opened this issue Jun 8, 2024 · 3 comments · Fixed by #155
Labels
new feature New feature or request
Milestone

Comments

@Rana-KV
Copy link

Rana-KV commented Jun 8, 2024

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.

@Manhbui1208
Copy link

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.

@erik-3milabs
Copy link

@Manhbui1208 could you create a PR for your code?

@Thadah
Copy link
Collaborator

Thadah commented Jun 26, 2024

I have an implementation that's working in serialization.cpp. I'll send a PR shortly.

@yspolyakov yspolyakov added this to the Release 0.8.9 milestone Jun 26, 2024
@yspolyakov yspolyakov added the new feature New feature or request label Jun 26, 2024
Thadah added a commit that referenced this issue Jul 8, 2024
#145 Add Serialize/Deserialize functions
@yspolyakov yspolyakov linked a pull request Jul 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
5 participants