javascriptc++seal

Using a C++ library in Javascript function on the user's browser


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


Solution

  • 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.