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-safe-storage

v1.0.2

Published

The world's first Quantum-Resistant encrypted localStorage & sessionStorage for the web. Uses Lattice-based cryptography (CRYSTALS-Kyber inspired) to future-proof your data against quantum computers.

Readme

⚛️ Quantum-Safe Storage

The world's first Quantum-Resistant encrypted localStorage & sessionStorage for the web.

While traditional encryption (like AES alone) can theoretically be broken by future quantum computers using Shor's and Grover's algorithms, quantum-safe-storage adds a Lattice-Based Key Derivation layer inspired by CRYSTALS-Kyber (the NIST-selected post-quantum standard) to make your stored data resistant to both classical AND quantum attacks.

🛡️ Three Layers of Protection

| Layer | Technology | Protects Against | |-------|-----------|-----------------| | 1. Lattice-Based KDF | CRYSTALS-Kyber inspired key derivation | Quantum computers (Shor's algorithm) | | 2. AES-256 Encryption | Military-grade symmetric encryption | Classical brute-force attacks | | 3. HMAC Integrity | Hash-based message authentication | Data tampering & corruption |

🚀 Installation

npm install quantum-safe-storage

💻 Usage

Basic (Vanilla JS / TypeScript)

import { QuantumSafeStorage } from 'quantum-safe-storage';

const vault = new QuantumSafeStorage({
  secretKey: 'your-ultra-secret-key',
  storageType: 'local', // or 'session'
  latticeRounds: 4,     // Higher = more secure (default: 4)
});

// Store data with quantum-resistant encryption
vault.setItem('auth_token', { token: 'xyz123', expiry: '2026-12-31' });

// Retrieve with automatic integrity verification
const data = vault.getItem('auth_token');
console.log(data); // { token: 'xyz123', expiry: '2026-12-31' }

// Check if data is valid (not tampered with)
vault.hasValidItem('auth_token'); // true

React Hook (SSR-Safe for Next.js)

import { useQuantumStorage } from 'quantum-safe-storage';

function App() {
  const [token, setToken] = useQuantumStorage('auth', 'default-token', {
    secretKey: 'my-quantum-key',
  });

  return (
    <div>
      <p>Token: {token}</p>
      <button onClick={() => setToken('new-quantum-token')}>
        Update Token
      </button>
    </div>
  );
}

Direct Encrypt/Decrypt (Advanced)

import { quantumEncrypt, quantumDecrypt } from 'quantum-safe-storage';

const secret = 'my-secret';
const encrypted = quantumEncrypt('sensitive data', secret);
const decrypted = quantumDecrypt(encrypted, secret);
// decrypted === 'sensitive data'

Pre-configured Instances

import { quantumLocal, quantumSession } from 'quantum-safe-storage';

// Ready-to-use instances (no config needed)
quantumLocal.setItem('key', 'value');
quantumSession.setItem('temp', 'data');

🧠 How It Works

1. Lattice-Based Key Derivation (Kyber-Inspired)

Instead of using your secret key directly, we derive a quantum-resistant key through multiple rounds of:

  • SHA-256/SHA-512 hashing to create a deterministic "public matrix"
  • XOR noise injection simulating the "Learning With Errors" (LWE) problem
  • Multi-round compression acting as the "rounding" step in Kyber

This makes the derived key computationally infeasible to reverse, even with quantum algorithms.

2. AES-256 Encryption

The derived key is used for standard AES-256 encryption, providing military-grade symmetric protection.

3. HMAC Integrity Verification

Every piece of stored data includes an HMAC tag. Before decryption, the integrity is verified. If anyone tampers with the stored data, the library will detect it and refuse to decrypt.

🔒 Security Comparison

| Feature | Standard localStorage | AES-Only Libraries | quantum-safe-storage | |---------|----------------------|--------------------|-----------------------| | Plaintext visible | ✅ Yes | ❌ No | ❌ No | | Brute-force resistant | ❌ No | ✅ Yes | ✅ Yes | | Tamper detection | ❌ No | ❌ No | ✅ Yes | | Quantum-resistant | ❌ No | ❌ No | ✅ Yes | | SSR-Safe (Next.js) | ❌ No | ❌ Varies | ✅ Yes |

📄 License

MIT