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

@parmana/sign

v0.1.0

Published

Standalone signing, verification, and canonical-hashing primitives, including an ML-DSA-65 (Dilithium3) post-quantum signature provider, extracted from Parmana.

Readme

@parmana/sign

OpenSSF Best Practices OpenSSF Scorecard

Applications that need to sign, verify, or deterministically hash data usually end up solving the same three problems from scratch: a consistent byte representation for arbitrary objects (so the same logical value always hashes/signs the same way), a swappable signature algorithm behind one interface, and support for post-quantum signatures as classical algorithms start getting deprecated in security-sensitive contexts. @parmana/sign is those three pieces as a small, standalone library: canonical object serialization, a SignatureProvider interface with a working ML-DSA-65 (Dilithium3) post-quantum implementation built on Node's native node:crypto support (Node >=24, OpenSSL >=3.5), and hash/verify helpers built on top.

It is fully usable on its own, independent of Parmana — it has no dependency on Parmana's runtime, policy engine, or any other Parmana package. It is also not an authorization or policy-evaluation system: it signs, verifies, and canonically hashes artifacts you give it, and makes no decisions about whether an action should be allowed. It was extracted from Parmana, an AI execution-authorization platform, as the subset of that project's crypto layer that is generic enough to stand on its own.

What this is

  • SignatureProvider — a minimal interface for sign/verify over a node:crypto KeyObject.
  • Dilithium3SignatureProvider — an implementation of that interface for ML-DSA-65 (Dilithium3), a post-quantum signature scheme.
  • SignatureVerifier / ArtifactHasher — small helpers that canonically serialize an arbitrary object (deterministic key ordering) before signing, verifying, or hashing it, so the same logical object always produces the same bytes regardless of how it was constructed.
  • CanonicalSerializer — the deterministic serialization used by the above.

What this is not

  • Not a key-management system. You supply KeyObjects; this library never reads keys from disk, environment variables, or a network service.
  • Not a policy engine, authorization system, or credential broker. Nothing here decides whether an action is permitted — it only signs and verifies data you already decided to sign.

Installation

npm install @parmana/sign

Quick start

import { generateKeyPairSync } from "node:crypto";
import { Dilithium3SignatureProvider } from "@parmana/sign";

const provider = new Dilithium3SignatureProvider();
const { privateKey, publicKey } = generateKeyPairSync("ml-dsa-65");

const data = new TextEncoder().encode("hello world");

const signature = await provider.sign(data, privateKey);
const valid = await provider.verify(data, signature, publicKey);

console.log(valid); // true

Using the canonical hasher/verifier with an arbitrary object instead of raw bytes:

import {
  Dilithium3SignatureProvider,
  SignatureVerifier,
  ArtifactHasher,
  type CryptoProvider,
} from "@parmana/sign";

const crypto: CryptoProvider = {
  signature: new Dilithium3SignatureProvider(),
  hash: myHashProvider, // implement HashProvider, or bring your own
};

const hasher = new ArtifactHasher(crypto);
const digest = await hasher.hash({ amount: 100, currency: "USD" });

API

SignatureProvider (interface)

Minimal sign/verify contract every signature implementation follows. Key management is intentionally external — implementations take a node:crypto KeyObject, never a file path, env var, or credential store.

interface SignatureProvider {
  readonly algorithm: SignatureAlgorithm;
  sign(data: Uint8Array, privateKey: KeyObject): Promise<string>;
  verify(data: Uint8Array, signature: string, publicKey: KeyObject): Promise<boolean>;
}

Dilithium3SignatureProvider

SignatureProvider implementation for ML-DSA-65 (Dilithium3), a NIST-standardized post-quantum signature scheme. Stateless; safe to share a single instance. Signatures are base64-encoded strings. ML-DSA-65 is randomized — signing the same data twice with the same key produces two different, both-valid signatures.

const provider = new Dilithium3SignatureProvider();
const signature: string = await provider.sign(data: Uint8Array, privateKey: KeyObject);
const valid: boolean = await provider.verify(data: Uint8Array, signature: string, publicKey: KeyObject);

Throws CryptoError if the supplied key's asymmetricKeyType isn't "ml-dsa-65" — this catches accidentally signing with the wrong algorithm's key material.

CanonicalSerializer

Produces a deterministic byte representation of an arbitrary object: object keys are sorted recursively, arrays keep their order, Date becomes an ISO string. Two calls with structurally-equal-but differently-ordered objects produce identical output.

const bytes: Uint8Array = new CanonicalSerializer().serialize(value: unknown);

ArtifactHasher

Canonically serializes a value, then hashes it with a supplied CryptoProvider's hash implementation.

const hasher = new ArtifactHasher(crypto: CryptoProvider);
const digest: string = await hasher.hash(value: unknown);

SignatureVerifier

Canonically serializes a value, then verifies a signature over it with a supplied CryptoProvider's signature implementation. This is the counterpart consumers typically use instead of calling a SignatureProvider directly, since it guarantees the same serialization was used on both the signing and verifying side.

const verifier = new SignatureVerifier(crypto: CryptoProvider);
const valid: boolean = await verifier.verify(artifact: unknown, signature: string, publicKey: KeyObject);

Requirements

  • Requires Node.js >=24.6.0 (needs OpenSSL 3.5+ for ML-DSA-65 support via node:crypto). Node.js only added node:crypto support for ML-DSA KeyObjects, signing, and verification in v24.6.0 (nodejs/node#59259) — earlier 24.x releases do not have it even though they satisfy a plain >=24 check. Use isMlDsa65Supported() to check at runtime before relying on the Dilithium3 provider regardless; older or non-conforming runtimes throw synchronously on key generation instead of failing gracefully.

Security & Supply Chain

See SECURITY.md for how to report a vulnerability.

  • OpenSSF Best Practices: passing badge (see above) — project #13926.
  • OpenSSF Scorecard: automated supply-chain security score, published weekly and on every push to main (see badge above).
  • SLSA provenance: every tagged release (v*.*.*) is built via a GitHub Actions workflow that generates SLSA Build Level 3 provenance for the published npm tarball, independently verifiable with slsa-verifier.
  • Sigstore signatures: every release tarball is signed keylessly with cosign using GitHub's OIDC identity, with the signature recorded in the public Rekor transparency log.

See RELEASING.md for the exact commands to verify a release's provenance and signature yourself.

Contributing

See CONTRIBUTING.md.

License

Apache License 2.0 — see LICENSE.