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

@doble2/voynich-crypto

v1.0.1

Published

A deterministic steganographic engine based on binary entropy injection and natural dialect simulation using reverse Huffman trees.

Readme

📜 Voynich Crypto Engine (@doble2/voynich-crypto)

A deterministic steganographic engine based on binary entropy injection and natural dialect simulation using reverse Huffman trees.

TypeScript React Jest Coverage License: MIT

🧠 Architecture and Deterministic Cryptography

Voynich Crypto processes information strictly at the binary level (Uint8Array), applying a Pipeline / Builder pattern to mutate byte sequences before assigning them any textual formatting. This allows data to be hidden inside organic-looking language structures.

Key Components

  1. Deterministic RNG & Entropy (PRNG / EntropyInjectorLayer): Initialize with a seed to power a predictable Mulberry32 generator. It mathematically interpolates pseudo-random byte "noise" within the original payload buffer, heavily diluting the footprint of the real information.
  2. Linguistic Formatter (CurrierADialect): Consumes the binary entropy and runs a reverse fractal compression via Huffman trees. It assigns pseudo-characters using pre-established probabilities (based on the EVA alphabet: e, o, y, s...), naturally breaking them into structurally sound word lengths without adding detectable patterns.
  3. Lossless Reverse Decoding: By utilizing strictly prefix-free tree maps, decoding operates at full $O(N)$ efficiency. It parses valid dialect strings while safely ignoring cosmetic spacing or formatting. The parser then navigates backwards through the deterministically injected noise layer to perfectly isolate the exact bytes of the original payload.

🚀 Installation

npm install @doble2/voynich-crypto

🛠️ Basic Usage (Node.js / Vanilla TS)

The engine exposes a fluent builder API, akin to setting up routing middlewares. You can easily switch combinations of layers to achieve your desired level of obfuscation.

import { 
  VoynichEngine, 
  EntropyInjectorLayer, 
  DummyLayer, 
  CurrierADialect 
} from '@doble2/voynich-crypto';

// 1. Initialize the Engine with a master seed
const engine = new VoynichEngine({ seed: 12345 });

// 2. Chain the transformation layers
engine
  .use(new DummyLayer())
  .use(new EntropyInjectorLayer({ 
    seed: 'secret-auth-key', 
    noiseRatio: 0.1 // Percentage of "garbage" bytes to organically pad the payload
  }));

// 3. Define the Formatter. 
// Optional: provide custom probabilities where higher values equal more frequent character occurrences.
/* const freqs = { 'e': 100, 'o': 90, 'y': 80, ... }; */
engine.setFormatter(new CurrierADialect(/* freqs */));

// 4. Encode Your Payload
const plainText = "Classified XYZ payload";
const bufferOriginal = new TextEncoder().encode(plainText);

const ciphertext = engine.encode(bufferOriginal);
console.log(ciphertext); 
// Output: "oych chtyq ohsh ooyye hyqo..."

// 5. Decode Back to Original Size
const decodificado = new TextDecoder().decode(engine.decode(ciphertext));
console.log(decodificado === plainText); // Outputs: true

⚛️ React / Next.js Integration

The library includes a typed useVoynich hook providing an out-of-the-box solution for client-side state management, perfect for CTF platforms or encoded challenges.

The useVoynich Hook

import { useVoynich } from '@doble2/voynich-crypto';

export default function App() {
  const { 
    encryptedText,   // Read-only deterministic ciphertext 
    decryptedText,   // Will populate when the correct seed unlocks it
    isDecrypted,     // Boolean flag 
    error,           // Exposes internal matching corruption states
    decrypt          // Callback to trigger decryption attempts
  } = useVoynich({ 
    payload: "FLAG{STEGANOGRAPHY_SOLVED}",
    seed: "12345", // The correct answer hash/seed the end-user must figure out
    noiseRatio: 0.5 
  });

  return (
    <div>
      <p>Ciphertext: {encryptedText}</p>
      
      <button onClick={() => decrypt("12345")}>
         Attempt Unlock
      </button>

      {isDecrypted && <p>Congratulations! Output: {decryptedText}</p>}
      {error && <p className="error">{error}</p>}
    </div>
  );
}

🧩 Extensibility (Build Your Own Custom Layers)

The system is fully decoupled. You can implement the IVoynichLayer interface to pipe custom binary scrambling algorithms directly into the core engine logic before it formats into text.

import { IVoynichLayer } from '@doble2/voynich-crypto';

export class CustomXORLayer implements IVoynichLayer {
  private key: number;

  constructor(key: number) { this.key = key; }

  public encode(buffer: Uint8Array): Uint8Array {
    return buffer.map(byte => byte ^ this.key);
  }

  public decode(buffer: Uint8Array): Uint8Array {
    return buffer.map(byte => byte ^ this.key); // XOR operation is mathematically reversible
  }
}