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

edu-sphincs

v0.0.1

Published

TypeScript implementation of SLH-DSA (SPHINCS+) as specified in NIST FIPS 205

Readme

edu-sphincs

An educational TypeScript implementation of SLH-DSA (Stateless Hash-based Digital Signature Algorithm) as specified in NIST FIPS 205 (formerly known as SPHINCS+). It has not been audited and must not be used in production.

This implementation was initially developed for visualization as part of my master's thesis and later factored out with the help of a generative AI coding assistant.

Features

  • Post-Quantum Cryptography: Implements the NIST standardized SLH-DSA signature scheme
  • SHAKE Parameter Sets: Supports SHAKE-based NIST FIPS 205 parameter sets
  • Type Safe: Written in TypeScript with full type definitions
  • Event System: Built-in event emitter for algorithm monitoring and visualization

Installation

npm install edu-sphincs

Quick Start

import { SLHDSA } from 'edu-sphincs';

// Initialize with a parameter set
const slhDSA = new SLHDSA('SLH-DSA-SHAKE-128s');

// Generate a key pair
const keyPair = await slhDSA.keygen();
if (!keyPair) {
  throw new Error('Key generation failed');
}

const { SK, PK } = keyPair;

// Sign a message
const message = new Uint8Array([1, 2, 3, 4, 5]);
const signature = await slhDSA.sign(message, SK);

// Verify the signature
const isValid = await slhDSA.verify(message, signature, PK);
console.log('Signature valid:', isValid);

Parameter Sets

The following NIST FIPS 205 parameter sets are currently supported (SHAKE-based):

  • SLH-DSA-SHAKE-128s - Small signatures
  • SLH-DSA-SHAKE-128f - Fast verification
  • SLH-DSA-SHAKE-192s - Small signatures, higher security
  • SLH-DSA-SHAKE-192f - Fast verification, higher security
  • SLH-DSA-SHAKE-256s - Small signatures, highest security
  • SLH-DSA-SHAKE-256f - Fast verification, highest security

Note: SHA2-based parameter sets (SLH-DSA-SHA2-*) are defined but not yet fully supported in this implementation (bugs).

Event Monitoring

The library supports event emission for monitoring and visualization purposes. You can pass a custom event emitter when creating an SLHDSA instance:

import { SLHDSA } from 'edu-sphincs';

const slhDSA = new SLHDSA('SLH-DSA-SHAKE-128s', undefined, {
  emit: (event) => {
    console.log(`${event.type}:`, event.data);
  }
});

The event emitter is designed to integrate with visualization frameworks for real-time algorithm monitoring.

API Reference

Core Class

  • SLHDSA - Main signature algorithm implementation with methods for key generation, signing, and verification

Utilities

  • ADRS - Address structure for hash function calls
  • Parameter management - Access to all NIST parameter sets
  • Hash functions - SHAKE, SHA wrappers

Security Notice

This is an educational implementation for learning post-quantum cryptography concepts. While it follows the NIST FIPS 205 specification, it is not suitable for production use.

License

MIT License - see LICENSE file for details.

References