UNPKG

unicode-puzzles-mcp

Version:

MCP server for quantum steganography puzzles using Unicode

124 lines (106 loc) โ€ข 4.67 kB
#!/usr/bin/env node import { StegoPuzzleManager } from './src/steganography/manager.js'; import { TemplateEngine } from './src/templates/engine.js'; const puzzleManager = new StegoPuzzleManager(); const templates = new TemplateEngine(); // Test different templates and encoding methods async function testAllTechniques() { const message = "Just a normal LinkedIn post about innovation and synergy!"; const secret = "ACTUALLY I HATE CORPORATE BUZZWORDS"; console.log("=== ๐Ÿงช TESTING ALL STEGANOGRAPHY TECHNIQUES ===\n"); // Test 1: Quantum Template (Binary Encoding) console.log("1๏ธโƒฃ QUANTUM TEMPLATE (Binary Encoding):"); const quantumTemplate = templates.getTemplate('quantum'); const quantumPuzzle = await puzzleManager.createPuzzle({ template: quantumTemplate, message: message, secret: secret, difficulty: 'medium' }); console.log(quantumPuzzle); console.log(`Hidden chars: ${countZeroWidth(quantumPuzzle)}\n`); // Test 2: Orbital Template (Trinary Encoding) console.log("2๏ธโƒฃ ORBITAL TEMPLATE (Trinary Encoding):"); const orbitalTemplate = templates.getTemplate('orbital'); const orbitalPuzzle = await puzzleManager.createPuzzle({ template: orbitalTemplate, message: message, secret: secret, difficulty: 'hard' }); console.log(orbitalPuzzle); console.log(`Hidden chars: ${countZeroWidth(orbitalPuzzle)}\n`); // Test 3: Void Template console.log("3๏ธโƒฃ VOID TEMPLATE (Space Theme):"); const voidTemplate = templates.getTemplate('void'); const voidPuzzle = await puzzleManager.createPuzzle({ template: voidTemplate, message: message, secret: secret, difficulty: 'easy' }); console.log(voidPuzzle); console.log(`Hidden chars: ${countZeroWidth(voidPuzzle)}\n`); // Test 4: Custom Unicode Art console.log("4๏ธโƒฃ CUSTOM UNICODE ART:"); const customMessage = createUnicodeArt(message, secret); console.log(customMessage); console.log(`Hidden chars: ${countZeroWidth(customMessage)}\n`); // Test 5: Homoglyph Attack console.log("5๏ธโƒฃ HOMOGLYPH CONFUSION:"); const homoglyphMessage = createHomoglyphMessage(message); console.log(homoglyphMessage); console.log("(Uses lookalike characters from different Unicode blocks)\n"); } // Count zero-width characters function countZeroWidth(text) { const zeroWidthRegex = /[\u200B-\u200F\u2060-\u206F]/g; const matches = text.match(zeroWidthRegex); return matches ? matches.length : 0; } // Create Unicode art with hidden message function createUnicodeArt(visible, hidden) { const frames = ['โŸฆ', 'โŸง']; const decorations = ['โœฆ', 'โœง', 'โœถ', 'โœท', 'โœธ', 'โœน']; let result = frames[0] + ' '; // Add decorations with hidden zero-width chars for (let i = 0; i < 5; i++) { result += decorations[Math.floor(Math.random() * decorations.length)]; if (i < hidden.length) { result += hidden.charCodeAt(i) % 2 ? '\u200B' : '\u200C'; } } result += ' ' + visible + ' '; // More decorations for (let i = 0; i < 5; i++) { result += decorations[Math.floor(Math.random() * decorations.length)]; if (i + 5 < hidden.length) { result += hidden.charCodeAt(i + 5) % 2 ? '\u200D' : '\u200E'; } } result += ' ' + frames[1]; return result; } // Create message with homoglyphs function createHomoglyphMessage(text) { const homoglyphs = { 'a': ['ะฐ', '๏ฝ', '๐š', '๐‘Ž', '๐’‚', '๐’ถ', '๐“ช', '๐”ž', '๐•’', '๐–†', '๐–บ', '๐—ฎ', '๐˜ข', '๐™–', '๐šŠ'], 'e': ['ะต', '๏ฝ…', 'โ„ฏ', '๐ž', '๐‘’', '๐’†', '๐“ฎ', '๐”ข', '๐•–', '๐–Š', '๐–พ', '๐—ฒ', '๐˜ฆ', '๐™š', '๐šŽ'], 'o': ['ะพ', '๏ฝ', 'โ„ด', '๐จ', '๐‘œ', '๐’', '๐“ธ', '๐”ฌ', '๐• ', '๐–”', '๐—ˆ', '๐—ผ', '๐˜ฐ', '๐™ค', '๐š˜'], 'i': ['ั–', '๏ฝ‰', 'โ„น', '๐ข', '๐‘–', '๐’Š', '๐“ฒ', '๐”ฆ', '๐•š', '๐–Ž', '๐—‚', '๐—ถ', '๐˜ช', '๐™ž', '๐š’'], 'l': ['ำ', '๏ฝŒ', 'โ„“', '๐ฅ', '๐‘™', '๐’', '๐“ต', '๐”ฉ', '๐•', '๐–‘', '๐—…', '๐—น', '๐˜ญ', '๐™ก', '๐š•'], 'n': ['ีธ', '๏ฝŽ', '๐ง', '๐‘›', '๐’', '๐“ท', '๐”ซ', '๐•Ÿ', '๐–“', '๐—‡', '๐—ป', '๐˜ฏ', '๐™ฃ', '๐š—'], 's': ['ั•', '๏ฝ“', '๐ฌ', '๐‘ ', '๐’”', '๐“ผ', '๐”ฐ', '๐•ค', '๐–˜', '๐—Œ', '๐˜€', '๐˜ด', '๐™จ', '๐šœ'], ' ': [' ', ' ', ' ', ' ', ' ', ' '] // Various space characters }; return text.split('').map(char => { const lower = char.toLowerCase(); if (homoglyphs[lower]) { const alternatives = homoglyphs[lower]; return alternatives[Math.floor(Math.random() * alternatives.length)]; } return char; }).join(''); } // Run tests testAllTechniques().catch(console.error);