I want to a web application that concerns Homomorphic Encryption. I am using Microsoft SEAL. I wanted to know if there is any way I could use this library in javascript function so that whenever a button is clicked the javascript function is executed on the user's browser and the encryption is carried out using Microsoft SEAL. I tried emscripten but the C++ code importing the library SEAL is not generating a wasm file. I have spent alot of time trying to find a solution but no luck. All the solutions available result in the code executed on the server. If anyone knows a way I can achieve this please guide me. The help would be really highly appreciated. Thanks
-
I'd silently close all my browsers forever, if executing an arbitarary C++ code loaded from an arbitrary web page would be possible in browsers.Teemu– Teemu2020-01-07 08:38:57 +00:00Commented Jan 7, 2020 at 8:38
-
If you want to compile C++ code to run in the browser then Emscripten is the right tool. I suggest you ask a question about compiling this SEAL library to WASM and using it.Botje– Botje2020-01-07 09:07:11 +00:00Commented Jan 7, 2020 at 9:07
Add a comment
|
1 Answer
Yes!
There is an open source library, node-seal, which is a nearly complete port of Microsoft SEAL to WebAssembly (WASM) and should be able to accommodate the majority of use-cases. It works with NodeJS and in modern browsers.
There is also a github sandbox where you may test and experiment with it inside your browser. You may even generate working code using node-seal.
Full disclosure, I’m the author of node-seal and the web demo.
4 Comments
Shabeeh Fatima Chaudry
Thanks alot for sharing this. Would you have a tutorial for using this implementation? If yes, could you please share it? It would be a huge help. Thanks
s0l0ist
A tutorial maybe a little lengthy for this forum. I've written a small section here about the basics, but ultimately you will need to learn from trial and error. The best documentation can be found from Microsoft SEAL's C++ examples. Figuring out where to start can be challenging. There's a YouTube video that can explain in more detail. If I've answered your initial question I would be grateful for a positive vote.
Shabeeh Fatima Chaudry
I am sorry I am unable to up vote your answer but yeah this was exactly what I had asked for. Thanks for the response.
s0l0ist
Marking as the accepted answer is what I meant. Thank you!