Comments (6)
@c3m0zturk Saving the ciphertext object to a file shouldn't be a problem. SEAL already provides a 'save' and 'load' function that take streams as parameters. I couldn't get python streams to work, but the easiest workaround would probably be to add an extra function which creates an ostream to a file and embed it into SEAL/ciphertext.cpp:
#include <fstream>
[..]
void Ciphertext::save_to_file() const
{
ofstream outfile("ciphertext.bin", std::ofstream::binary);
save(outfile);
outfile.close();
}
Then in SEAL/ciphertext.h add a function header
void save_to_file() const;
and in SEALPython/wrapper.cpp add the following line
py::class_<Ciphertext>(m, "Ciphertext")
.def(py::init<>())
[...] /* all other definitions */
.def("save_to_file", (void (Ciphertext::*)()) &Ciphertext::save_to_file, "Saves ciphertext to file")
from pyseal.
Hi @NilsHendrikLukas , did you find any alternative solution to pickle or anyway to save the ciphertext objects to a file?
from pyseal.
from pyseal.
@NilsHendrikLukas Thanks for the update! @c3m0zturk and I used a similar workaround by writing a new function that takes string input for file path. We included save/load for PublicKey and SecretKey as well.
@toddstavish I have made these changes on my fork. Does it make sense to submit a PR?
from pyseal.
from pyseal.
@toddstavish I also made a PR to add Pickle serialization. It does not conflict with any native dependencies, thus it should be platform independent. I think this feature is quite important, because now with Pythons multiprocessing library one can get linear speedups depending on the number of cores (limited by the number of used plaintext moduli ofc).
from pyseal.
Related Issues (20)
- No Release File (Change to Ubuntu 17.10)
- Compilation errors HOT 1
- Get storage of plaintext and ciphertext? HOT 1
- How can we build PySEAL on Ubuntu 18.04? HOT 1
- matplotlib
- SEAL 3.0 HOT 3
- cannot find seal/memorypoolhandle.h HOT 2
- No Release File HOT 1
- How to import a CSV file in SEALPythonExamples/examples.py using pandas HOT 1
- subtraction issue
- Guidelines to circumvent "ValueError: not enough evaluation keys"
- Saving secret_key and public key HOT 1
- Encode/Encrypt text message HOT 4
- Converting enrypted numpy array to seal object. HOT 1
- How to use SEAL keys on some other system? HOT 1
- Encrypted decision tree classifier HOT 1
- How to install the pyseal on the windiws?
- Python APIs
- Error Installing Pybin11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyseal.