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

srp-wasm

v0.1.1

Published

A WebAssembly-powered SRP (Secure Remote Password) implementation for secure, zero-knowledge authentication. This library provides both client-side and server-side SRP logic for use in web apps and Node.js environments.

Readme

srp-wasm

A WebAssembly-powered SRP (Secure Remote Password) implementation for secure, zero-knowledge authentication. This library provides both client-side and server-side SRP logic for use in web apps and Node.js environments.


✨ Features

  • SRP-6a protocol (safe, zero-knowledge password authentication)
  • WebAssembly speed and safety
  • Browser and Node.js support
  • Simple API
  • Compatible with Express, fetch, etc.

📦 Installation

npm install srp-wasm

Client initialization (Browser)

import init, { SrpClient } from "srp-wasm/client";
// required for browser usage
await init();

const srpClient = new SrpClient();

Server initialization (Node.js)

import { SrpServer } from "srp-wasm/server";

const srpServer = new SrpServer();

SRP Authentication Flow

  1. Registration (once):
  • Client:

    • Generates salt and verifier from username + password

      const salt = new Uint8Array(16);
      crypto.getRandomValues(salt);
      const verifier = client.verifier(salt, username, password);
    • Sends { username, salt, verifier } to server

  • Server:

    • Stores { username, salt, verifier }
  1. Login:
  • Client:

    • Generates a, computes A

      const a = client.generate_a();
      const A = client.compute_A(a);
    • Sends { username } to server

  • Server:

    • Looks up user

    • Generates b, computes B

      const b = srpServer.generate_b();
      const B = srpServer.compute_B(user.verifier, b);
    • Sends { salt, B } back

  • Client:

    • Computes client proof (M1)

      const verifier = client.srp_client_verifier(
        a,
        A,
        Uint8Array.from(B),
        Uint8Array.from(salt),
        username,
        password,
      );
      
      const m1 = verifier.client_proof();
    • Sends { A, M1 } to server

  • Server:

    • Verifies client proof (M1)

      const verifier = srpServer.srp_server_verifier(
        Uint8Array.from(A),
        Uint8Array.from(b),
        Uint8Array.from(B),
        user.verifier,
        user.salt,
        username,
      );
      
      const verified = verifier.verify_client(Uint8Array.from(clientM1));
    • If valid, sends back server proof (M2)

      const m2 = verifier.server_proof();
  • Client:

    • Verifies M2

      verifier.verify_server(Uint8Array.from(serverM2));