Open alexcostars opened 4 months ago
Did you solve your problem? trying to do something similar with angular and python flask (so two seal instances)
Hey sorry I missed this question.
So your goal is to create a cipher in one language and then import it in another runtime (even a different machine)?
If you're using this library, then it is pretty straight forward. There's a test showing how to save and load ciphertexts:
https://github.com/s0l0ist/node-seal/blob/main/src/__tests__/cipher-text.test.ts#L326
If you're using another language (python), then you'd need to lookup how to load it from a binary array on that platform. Thankfully, the SEAL library has its own serialization format (self-contained) so it should "just work".
Your answer is helpful, @s0l0ist. This helps us export (and import) a cipher, but my question is more complex.
I need to understand how to perform an addition operation manually (without using the node-seal library).
For example, consider that I created two ciphers using node-seal
. I used the mentioned code to export them as two arrays. If I send these two exported arrays to another programming language (like Python or Java), how can I perform an addition operation? What algorithm do I need to construct to sum of cipher_1_array
and cipher_2_array
?
There are two ways to perform addition:
I assume you want to do 2 as it is more common.
Unfortunately, you cannot simply add two cipher text arrays without using a derivative work from a Microsoft SEAL library. Mainly because the serialized output you have contains other information about the protocol such as the version of SEAL and some other metadata in addition to the underlying cipher text encrypted data.
In general, you'd need to build the SEAL C++ library and create the appropriate bindings in whatever language you needed to deserialize, and recreate the same encryption parameters. Ideally, you would use an existing 3rd party library that already has bindings in the language you need.
I found this python lib, but I have not followed the build instructions. Assuming you are able to build it, you'd need to save the cipher with no compression (node-seal has this override when calling saveArray
) since this python library doesn't build SEAL with compression support.
Hi guys, I need some help.
I'm using this repository to perform great BVF operations, it's amazing!
When I use the entire lib to perform all operations works fine, but is possible to perform addition operations outside the lib? How can I export 2 ciphertexts in a way that I can perform a external addition (I should execute this into another programming language and restricted hardware)?
My SEAL config:
The result of
ciphertext.saveArray()
:Sorry if this is a primary question, I'm not a cipher expert
Thanks!