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

pqc-wasm

v0.1.0

Published

Post-Quantum Cryptography WASM bindings for Dytallix

Readme

@dytallix/pqc-wasm

Post-Quantum Cryptography WASM bindings for the Dytallix blockchain network. This package provides WebAssembly-compiled implementations of ML-DSA (FIPS 204, formerly CRYSTALS-Dilithium) for quantum-resistant digital signatures.

Features

  • 🔐 Quantum-Resistant: ML-DSA-65 (FIPS 204) implementation
  • 🚀 High Performance: WebAssembly for near-native speed
  • 🌐 Universal: Works in Node.js, browsers, and edge runtimes
  • 📦 Zero Dependencies: Self-contained cryptographic implementation
  • 🔒 Secure: Zeroization of sensitive key material

Installation

npm install @dytallix/pqc-wasm

Usage

Node.js / Modern Bundlers

import init, * as pqc from '@dytallix/pqc-wasm';

// Initialize the WASM module (required once)
await init();

// Generate a new keypair
const { publicKey, privateKey } = pqc.generate_keypair();

// Sign a message
const message = new TextEncoder().encode("Hello, Quantum World!");
const signature = pqc.sign(privateKey, message);

// Verify signature
const isValid = pqc.verify(publicKey, message, signature);
console.log('Signature valid:', isValid);

Browser with CDN

<!DOCTYPE html>
<html>
<head>
  <script type="module">
    import init, * as pqc from 'https://unpkg.com/@dytallix/pqc-wasm/pqc_wasm.js';
    
    async function demo() {
      await init();
      const { publicKey, privateKey } = pqc.generate_keypair();
      console.log('Generated PQC keypair:', publicKey);
    }
    
    demo();
  </script>
</head>
<body>
  <h1>Dytallix PQC Demo</h1>
</body>
</html>

With Dytallix SDK

This package is designed to work seamlessly with @dytallix/sdk:

import { Wallet } from '@dytallix/sdk';

// The SDK automatically uses @dytallix/pqc-wasm for cryptography
const wallet = await Wallet.createRandom();
const address = wallet.getAddress();

API Reference

generate_keypair(): { publicKey: Uint8Array, privateKey: Uint8Array }

Generates a new ML-DSA-65 keypair.

Returns:

  • publicKey - 1,952 bytes (ML-DSA-65 public key)
  • privateKey - 4,032 bytes (ML-DSA-65 private key)

sign(privateKey: Uint8Array, message: Uint8Array): Uint8Array

Signs a message using ML-DSA-65.

Parameters:

  • privateKey - The 4,032-byte private key
  • message - The message to sign

Returns:

  • Signature bytes (3,293 bytes for ML-DSA-65)

verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean

Verifies an ML-DSA-65 signature.

Parameters:

  • publicKey - The 1,952-byte public key
  • message - The original message
  • signature - The signature to verify

Returns:

  • true if signature is valid, false otherwise

public_key_to_address(publicKey: Uint8Array): string

Converts a public key to a Dytallix bech32 address.

Parameters:

  • publicKey - The ML-DSA-65 public key

Returns:

  • Bech32-encoded address with dyt prefix

derive_public_key(privateKey: Uint8Array): Uint8Array

Derives the public key from a private key.

Parameters:

  • privateKey - The 4,032-byte private key

Returns:

  • The corresponding 1,952-byte public key

Technical Details

Algorithm

This package implements ML-DSA-65 (Module-Lattice-Based Digital Signature Algorithm, security level 3) as specified in FIPS 204.

  • Public Key Size: 1,952 bytes
  • Private Key Size: 4,032 bytes
  • Signature Size: 3,293 bytes
  • Security Level: NIST Level 3 (equivalent to AES-192)

Performance

Typical performance on modern hardware:

  • Key Generation: ~1ms
  • Signing: ~2ms
  • Verification: ~1ms

Browser Compatibility

  • Chrome/Edge 91+
  • Firefox 89+
  • Safari 15+
  • Node.js 18+

Requires WebAssembly and ES modules support.

Development

This package is built from Rust using wasm-pack:

# Build from source (requires Rust toolchain)
cd dytallix-fast-launch/pqc-wasm
wasm-pack build --target web --out-dir pkg

Security Considerations

  1. Key Storage: Private keys should be encrypted at rest
  2. Key Zeroization: Keys are automatically zeroized when dropped
  3. Side-Channel Resistance: Uses constant-time operations where possible
  4. Random Number Generation: Uses cryptographically secure RNG

License

Apache-2.0 OR MIT

Resources

Support

For issues and questions:


Note: This is quantum-resistant cryptography designed to protect against future quantum computers. Current ECDSA-based systems will become vulnerable when large-scale quantum computers are available.