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

quantum_ark

v0.3.0

Published

Post-quantum cryptographic hashing library with neural network chaos and lattice-based security

Readme

Quantum ARK - Post-Quantum Cryptographic Hashing

A high-performance, post-quantum resistant cryptographic hashing library built in Rust with WebAssembly support. Designed for maximum security against both classical and quantum computing attacks.

Features

  • Post-Quantum Security: Resistant to quantum computing attacks using lattice-based cryptography
  • Neural Network Chaos: 768-neuron chaotic neural network for enhanced entropy
  • Sponge Construction: 512-bit state with 168-bit rate for cryptographic strength
  • Dilithium NTT: NIST-approved post-quantum algorithm integration
  • Lattice Mixing: Q=3329 lattice operations for quantum resistance
  • Constant-Time Verification: Timing-attack resistant password verification
  • WASM Compatible: Full WebAssembly support for browser environments
  • Backward Compatible: Supports legacy V1 hashes for existing systems
  • Pure Rust: No external C dependencies, fully auditable code

Installation

For Node.js/Browser (npm)

npm install quantum_ark

For Rust Projects

Add to your Cargo.toml:

[dependencies]
quantum_ark = "0.3"

Quick Start

JavaScript/TypeScript

import * as quantumArk from 'quantum_ark';

// Generate hash
const password = 'my_secure_password';
const appSecret = 'application_secret_key';
const hash = quantumArk.quantum_ark_hash(password, appSecret);

// Verify password
const isValid = quantumArk.quantum_ark_verify(password, appSecret, hash);
console.log(isValid); // true

// Maximum security with HMAC
const hmacHash = quantumArk.quantum_ark_hash_with_hmac(password, appSecret);

// Generate random salt
const salt = quantumArk.quantum_ark_generate_salt();

Rust

use quantum_ark::{quantum_ark_hash, quantum_ark_verify};

fn main() {
    let password = "my_secure_password";
    let key = "application_secret";
    
    // Generate hash
    let hash = quantum_ark_hash(password, key);
    
    // Verify password
    if quantum_ark_verify(password, key, &hash) {
        println!("Password is valid!");
    }
}

API Reference

quantum_ark_hash(password: string, key: string): string

Generates a quantum-resistant hash using the V3 algorithm.

  • Returns: Hash string starting with v3$ or error message
  • Format: v3$<salt><hash>
  • Speed: ⚡⚡⚡ (fastest)
  • Security: ★★★★☆

quantum_ark_hash_with_hmac(password: string, key: string): string

Generates a hash with HMAC authentication for maximum security.

  • Returns: Hash string starting with v3h$ or error message
  • Format: v3h$<salt><hash><hmac>
  • Speed: ⚡⚡ (moderate)
  • Security: ★★★★★ (recommended)

quantum_ark_hash_extreme(password: string, key: string): string

Generates an extreme hash with triple quantum layers.

  • Returns: Hash string starting with v3x$ or error message
  • Format: v3x$<triple_hash>
  • Speed: ⚡ (slowest)
  • Security: ★★★★★★ (maximum)

quantum_ark_verify(password: string, key: string, hash: string): boolean

Verifies a password against a stored hash using constant-time comparison.

  • Returns: true if valid, false otherwise
  • Protection: Timing-attack resistant
  • Auto-detection: Works with all hash formats (v3$, v3h$, v3x$, legacy)

quantum_ark_generate_salt(): string

Generates a cryptographically secure random salt.

  • Returns: Hex-encoded 32-byte salt string
  • Uniqueness: Each call produces a different salt
  • Source: System entropy + quantum seed

Algorithm Details

Sponge Construction

  • State Size: 512 bits
  • Rate: 168 bits
  • Rounds: 24 permutation rounds
  • Padding: SHA-3 style (0x06 prefix, 0x80 suffix)

Neural Network Chaos

  • Hidden Neurons: 768
  • Activation: Quantum chaos function (Henon + Lorenz)
  • Layers: 3 (input → hidden1 → hidden2 → output)
  • Purpose: Enhanced entropy and non-linearity

Post-Quantum Security

  • Dilithium NTT: Number Theoretic Transform (Q=8380417)
  • Lattice Mixing: Lattice operations (Q=3329)
  • Noise-Based: Gaussian noise for quantum resistance
  • NIST Approved: Based on NIST PQC standards

Key Derivation

  • PBKDF2: 80,000 iterations (150,000 in secure mode)
  • Hash Function: SHA3-512
  • Salt: 32 bytes from quantum seed + system entropy

Security Considerations

Timing Attack Resistance

All verification operations use constant-time comparison to prevent timing-based attacks.

Quantum Resistance

The algorithm combines multiple post-quantum techniques:

  • Lattice-based cryptography (Dilithium)
  • Sponge construction (SHA-3 style)
  • Neural network chaos
  • Deterministic chaos maps (Henon, Lorenz)

Key Management

  • Use a strong, unique application secret key
  • Never hardcode keys in source code
  • Rotate keys periodically for critical systems
  • Store keys in secure key management systems

Performance

Benchmarks on modern hardware:

| Operation | Time | Memory | |-----------|------|--------| | quantum_ark_hash | ~50ms | ~2MB | | quantum_ark_hash_with_hmac | ~100ms | ~2MB | | quantum_ark_hash_extreme | ~150ms | ~2MB | | quantum_ark_verify | ~50ms | ~1MB |

WASM performance is typically 70-80% of native Rust performance.

Building for WASM

# Install wasm-pack
cargo install wasm-pack

# Build for web
wasm-pack build --target web --release --features secure

# Build for Node.js
wasm-pack build --target nodejs --release --features secure

# Build for bundlers
wasm-pack build --target bundler --release --features secure

Output files:

  • pkg/quantum_ark.js - JavaScript bindings
  • pkg/quantum_ark_bg.wasm - WebAssembly binary
  • pkg/quantum_ark.d.ts - TypeScript definitions

Publishing to npm

cd pkg
npm publish

Backward Compatibility

The library maintains compatibility with legacy V1 hashes:

// Legacy V1 hashes still work
const legacyHash = quantumArk.quantum_ark_hash(password, 'ARK_V1_LEGACY');
const isValid = quantumArk.quantum_ark_verify(password, 'ARK_V1_LEGACY', legacyHash);

Testing

Run the test suite:

# Rust tests
cargo test

# WASM tests (requires wasm-pack)
wasm-pack test --headless --firefox

Open Source

This project is open source and available under the MIT License. Contributions are welcome!

Future Roadmap

  • [ ] Quantum computing simulation for security validation
  • [ ] Additional post-quantum algorithms (Kyber, Falcon)
  • [ ] Hardware acceleration support
  • [ ] Formal security audit
  • [ ] Additional language bindings (Python, Go, C#)

References

License

MIT License - See LICENSE file for details

Support

For issues, questions, or contributions, please visit the GitHub repository.