npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-seal

v7.0.0

Published

Homomorphic Encryption for TypeScript or JavaScript using Microsoft SEAL

Readme

node-seal · GitHub license npm version FOSSA Status

node-seal is an ESM-first, WebAssembly-powered wrapper around the C++ Microsoft SEAL homomorphic encryption library, for TypeScript and JavaScript.

v7.0.0 is a breaking release. The custom JS wrapper layer was removed — the package now exposes the Emscripten-generated bindings directly. That makes the package ~96% smaller and faster, but it also means some imports and helper methods changed.

  • WebAssembly: Fast, direct bindings to Microsoft SEAL
  • ESM-first: Modern module layout, no bundling
  • Node.js + browser + edge (CF Workers): Load the WASM separately and run wherever WASM is allowed
  • Low-level, close to C++: Method names and types now map much more directly to SEAL

Currently aligned with Microsoft SEAL 4.1.2.

Table of Contents

Installation

Install from npm:

npm install node-seal
# or
yarn add node-seal
# or
pnpm add node-seal

Because v7 is ESM-first and ships the .wasm separately, most modern bundlers will just work.

Quick Start

In v7, the default import gives you a factory; call it to get the SEAL runtime:

import SEAL from 'node-seal'

const seal = await SEAL()

Variants:

// recommended and default: throws on transparent ciphertexts
import SEAL from 'node-seal/throws'
const seal = await SEAL()

// allow transparent ciphertexts (only if you know you need this)
import SEAL from 'node-seal/allows'
const seal = await SEAL()

What Changed in v7?

See here.

Environment Notes

React Native

React Native still can't run WASM like a browser. Use a small HTML/JS app inside a WebView, load node-seal there, and talk over postMessage. Because v7 ships a plain .wasm, bundling that web app is easier.

Demo

Go to the sandbox

This sandbox was built for users to experiment and learn how to use Microsoft SEAL featuring node-seal.

  • Encryption Parameters: experiment with many settings to prototype a SEALContext.
  • Keys: Create, download, upload Secret/Public Keys - even for Relinearization and Galois Keys.
  • Variables: Create, download, upload PlainTexts or CipherTexts
  • Functions: Create a list of HE functions to execute!
  • Code Generation: After your experimentation is complete, generate working code to use!

Usage

Checkout the basics

Documentation

View the latest docs here

Examples

Check out the Sandbox to run HE functions and even generate working code!

If you'd rather read an example, take a look here.

For more exhaustive examples, view the tests.

Changes

For changes in this library, take a look here.

For changes in Microsoft SEAL, take a look at their list of changes.

Benchmarking

npm run seal:build:bench
npm run benchmark

See also: BENCHMARK.md.

Caveats

  • Memory: saving large keys in the browser is expensive; try a different compression mode if you get OOMs.
  • Manual cleanup: call .delete() or .deleteLater() on created objects to free C++ resources.

Contributing

See CONTRIBUTING.md.

License

node-seal is MIT licensed.

FOSSA
Status