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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wharfkit/sealed-messages

v1.2.0

Published

Use [Shamir's secret sharing](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) with [@wharfkit/antelope](https://github.com/wharfkit/antelope) Public/Private Keys to encrypt and decrypt a message.

Readme

Sealed Messages

Use Shamir's secret sharing with @wharfkit/antelope Public/Private Keys to encrypt and decrypt a message.

In a real world scenario, the sender of the message needs to have a private key and known the public key of the receiver. They then take their message and a nonce to encode the message using the sealMessage function. The receiver needs to take the message and decrypt it with their private key, the public key of the sender, as well as the nonce of the message.

As a full example below, we will use the following information.

Sender

Public: PUB_K1_7DcFftmP6xfsvuycjX9ZXU5fxoF9Dwft1K3Amymze5n5f6zj4W
Private: PVT_K1_2Uew3LyC8KRRXrnqiN4RmMP2nqR1tVY5gAjXMJkdtFVTthdRtJ

Receiver

Public: PUB_K1_5BSU51h332xWvhXYnu9TSvKQV3C9QDxS9XK1coq9m6zBnZwHKn
Private: PVT_K1_LzT8YiEeLKG82uYqYPjytVotkztTVgR9Xs9YFfRU1wQ7dtcED

Encrypt a message with a senders private key, the receivers public key, and a nonce.

const from = PrivateKey.from('PVT_K1_2Uew3LyC8KRRXrnqiN4RmMP2nqR1tVY5gAjXMJkdtFVTthdRtJ')
const to = PublicKey.from('PUB_K1_5BSU51h332xWvhXYnu9TSvKQV3C9QDxS9XK1coq9m6zBnZwHKn')
const nonce = UInt64.from(1234567890)
const message = 'Hello, World!'

const sealedMessage = await sealMessage(message, from, to, nonce)

console.log(String(sealedMessage))

// Output: abb3a412f59211df4d9d984d445127a9

The encrypted message can then be relayed to the receiver. The receiver can decrypt the message now using the their own private key, the senders public key, and the nonce.

const encrypted = 'abb3a412f59211df4d9d984d445127a9'
const sealedMessage = Bytes.from(encrypted, 'hex')
const from = PublicKey.from('PUB_K1_7DcFftmP6xfsvuycjX9ZXU5fxoF9Dwft1K3Amymze5n5f6zj4W')
const to = PrivateKey.from('PVT_K1_LzT8YiEeLKG82uYqYPjytVotkztTVgR9Xs9YFfRU1wQ7dtcED')
const nonce = UInt64.from(1234567890)

const unsealedMessage = await unsealMessage(sealedMessage, to, from, nonce)

console.log(unsealedMessage)
// Output: Hello, World!