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
Asked
Active
Viewed 239 times
0
-
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 Jan 07 '20 at 08: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 Jan 07 '20 at 09:07
1 Answers
1
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 website, morfix.io, 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.

s0l0ist
- 26
- 1
- 3
-
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 – Shabeeh Fatima Chaudry Jan 08 '20 at 12:13
-
1A tutorial maybe a little lengthy for this forum. I've written a small section [here](https://github.com/morfix-io/node-seal/blob/HEAD/USAGE.md) 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](https://github.com/microsoft/SEAL/tree/master/native/examples). Figuring out where to start can be challenging. There's a [YouTube video](https://www.youtube.com/watch?v=XaYEHnaAg8M) that can explain in more detail. If I've answered your initial question I would be grateful for a positive vote. – s0l0ist Jan 08 '20 at 18:20
-
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. – Shabeeh Fatima Chaudry Jan 09 '20 at 07:00
-