{"_id":"@doble2/voynich-crypto","_rev":"2-72a372d6842b8f4240d4e8fa43187d16","name":"@doble2/voynich-crypto","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@doble2/voynich-crypto","version":"1.0.0","keywords":["steganography","cryptography","huffman","entropy","voynich","react","hook"],"author":{"name":"doble2"},"license":"MIT","_id":"@doble2/voynich-crypto@1.0.0","maintainers":[{"name":"doble2","email":"angelcalderon303@gmail.com"}],"dist":{"shasum":"c74994371a5b6ce0718c404eca8e25c6817d917f","tarball":"https://registry.npmjs.org/@doble2/voynich-crypto/-/voynich-crypto-1.0.0.tgz","fileCount":20,"integrity":"sha512-QWnjKuMOP0I1iQZVhOlsLiizbpHarx2K5UY9l3uYj4EOqvWD/Oh1rTBJFqB4Vvq06msBzNNb311CACn+q6olCQ==","signatures":[{"sig":"MEUCIQC1cMiG/MgayDaXghcSESSwfYjC1D8ClP7rupV2Z17K2AIgNPYYCCP3bRB7T2ICh1Ng398mCjWSZofRmdsPu3q+Vi4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26650},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"9662859caa33eb12d225c2fd5151ae93430b1703","scripts":{"test":"jest","build":"tsc","prepack":"npm run build"},"_npmUser":{"name":"doble2","email":"angelcalderon303@gmail.com"},"_npmVersion":"11.11.0","description":"A deterministic steganographic engine based on binary entropy injection and natural dialect simulation using reverse Huffman trees.","directories":{},"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","react":"^19.2.4","ts-jest":"^29.1.2","typescript":"^5.3.3","@types/jest":"^29.5.12","@types/node":"^20.11.24","@types/react":"^19.2.14","framer-motion":"^12.34.5","@testing-library/react":"^16.3.2","jest-environment-jsdom":"^29.7.0","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/voynich-crypto_1.0.0_1772834560940_0.12850036913064145","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@doble2/voynich-crypto","version":"1.0.1","description":"A deterministic steganographic engine based on binary entropy injection and natural dialect simulation using reverse Huffman trees.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"jest","prepack":"npm run build"},"keywords":["steganography","cryptography","huffman","entropy","voynich","react","hook"],"author":{"name":"doble2"},"license":"MIT","peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.2","@types/jest":"^29.5.12","@types/node":"^20.11.24","@types/react":"^19.2.14","framer-motion":"^12.34.5","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","react":"^19.2.4","ts-jest":"^29.1.2","typescript":"^5.3.3"},"gitHead":"8856f33a82f82362ecabb8a8d8c3f85e8314c598","_id":"@doble2/voynich-crypto@1.0.1","_nodeVersion":"23.11.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-yF2wnPvmVbPBrIhc+m2fpUEF6sgkz+2ErYw7mbHxVT9O1w7M2+GbMRZKiuWkra6ocXA0BJq+2hgmMkHEUn1KsQ==","shasum":"37b55550796d7ceba7db8d9ebf4adf5832ab88b0","tarball":"https://registry.npmjs.org/@doble2/voynich-crypto/-/voynich-crypto-1.0.1.tgz","fileCount":20,"unpackedSize":29482,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpUA+xd2vZOEKiFNZo3anSXPzfgh/wm+KVevwXmVjy/gIgAn9dujUxn60XvngsWPySejomyAoInYMMIJDuZF7uVfk="}]},"_npmUser":{"name":"doble2","email":"angelcalderon303@gmail.com"},"directories":{},"maintainers":[{"name":"doble2","email":"angelcalderon303@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/voynich-crypto_1.0.1_1772839182450_0.8322007937497493"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-06T22:02:40.861Z","modified":"2026-03-06T23:19:42.719Z","1.0.0":"2026-03-06T22:02:41.115Z","1.0.1":"2026-03-06T23:19:42.623Z"},"author":{"name":"doble2"},"license":"MIT","keywords":["steganography","cryptography","huffman","entropy","voynich","react","hook"],"description":"A deterministic steganographic engine based on binary entropy injection and natural dialect simulation using reverse Huffman trees.","maintainers":[{"name":"doble2","email":"angelcalderon303@gmail.com"}],"readme":"<div align=\"center\">\n\n# 📜 Voynich Crypto Engine (`@doble2/voynich-crypto`)\n\n**A deterministic steganographic engine based on binary entropy injection and natural dialect simulation using reverse Huffman trees.**\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)\n[![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://reactjs.org/)\n[![Jest Coverage](https://img.shields.io/badge/Coverage-100%25-brightgreen.svg?style=for-the-badge)](#)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n\n</div>\n\n## 🧠 Architecture and Deterministic Cryptography\n\n**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.\n\n### Key Components\n\n1. **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.\n2. **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.\n3. **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.\n\n---\n\n## 🚀 Installation\n\n```bash\nnpm install @doble2/voynich-crypto\n```\n\n---\n\n## 🛠️ Basic Usage (Node.js / Vanilla TS)\n\nThe 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.\n\n```typescript\nimport { \n  VoynichEngine, \n  EntropyInjectorLayer, \n  DummyLayer, \n  CurrierADialect \n} from '@doble2/voynich-crypto';\n\n// 1. Initialize the Engine with a master seed\nconst engine = new VoynichEngine({ seed: 12345 });\n\n// 2. Chain the transformation layers\nengine\n  .use(new DummyLayer())\n  .use(new EntropyInjectorLayer({ \n    seed: 'secret-auth-key', \n    noiseRatio: 0.1 // Percentage of \"garbage\" bytes to organically pad the payload\n  }));\n\n// 3. Define the Formatter. \n// Optional: provide custom probabilities where higher values equal more frequent character occurrences.\n/* const freqs = { 'e': 100, 'o': 90, 'y': 80, ... }; */\nengine.setFormatter(new CurrierADialect(/* freqs */));\n\n// 4. Encode Your Payload\nconst plainText = \"Classified XYZ payload\";\nconst bufferOriginal = new TextEncoder().encode(plainText);\n\nconst ciphertext = engine.encode(bufferOriginal);\nconsole.log(ciphertext); \n// Output: \"oych chtyq ohsh ooyye hyqo...\"\n\n// 5. Decode Back to Original Size\nconst decodificado = new TextDecoder().decode(engine.decode(ciphertext));\nconsole.log(decodificado === plainText); // Outputs: true\n```\n\n---\n\n## ⚛️ React / Next.js Integration\n\nThe 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.\n\n### The `useVoynich` Hook\n\n```tsx\nimport { useVoynich } from '@doble2/voynich-crypto';\n\nexport default function App() {\n  const { \n    encryptedText,   // Read-only deterministic ciphertext \n    decryptedText,   // Will populate when the correct seed unlocks it\n    isDecrypted,     // Boolean flag \n    error,           // Exposes internal matching corruption states\n    decrypt          // Callback to trigger decryption attempts\n  } = useVoynich({ \n    payload: \"FLAG{STEGANOGRAPHY_SOLVED}\",\n    seed: \"12345\", // The correct answer hash/seed the end-user must figure out\n    noiseRatio: 0.5 \n  });\n\n  return (\n    <div>\n      <p>Ciphertext: {encryptedText}</p>\n      \n      <button onClick={() => decrypt(\"12345\")}>\n         Attempt Unlock\n      </button>\n\n      {isDecrypted && <p>Congratulations! Output: {decryptedText}</p>}\n      {error && <p className=\"error\">{error}</p>}\n    </div>\n  );\n}\n```\n\n---\n\n## 🧩 Extensibility (Build Your Own Custom Layers)\n\nThe 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.\n\n```typescript\nimport { IVoynichLayer } from '@doble2/voynich-crypto';\n\nexport class CustomXORLayer implements IVoynichLayer {\n  private key: number;\n\n  constructor(key: number) { this.key = key; }\n\n  public encode(buffer: Uint8Array): Uint8Array {\n    return buffer.map(byte => byte ^ this.key);\n  }\n\n  public decode(buffer: Uint8Array): Uint8Array {\n    return buffer.map(byte => byte ^ this.key); // XOR operation is mathematically reversible\n  }\n}\n```\n<div align=\"center\">\n  <sub>Built with mathematical discipline and SOLID architecture by <b>@doble2</b></sub>\n</div>\n# voynich-crypto-engine\n","readmeFilename":"README.md"}