SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,026
Folders
377
Scanned Size
3.79 GB
PHP Files
791
Editable Text Files
12,310
File viewer
guarded to /htdocs
/arcade/games/ancient_matrix_decoder.php
<?php declare(strict_types=1); /** * Ancient Code + Matrix Decoder * Single-file PHP interactive tool * * Features: * - Caesar shift brute force * - Atbash decode * - Vigenere encode/decode * - Rail fence decode helper * - Frequency analysis * - Matrix-style rain background * - Interactive clue scoring + pattern finder */ header('Content-Type: text/html; charset=utf-8'); function h(string $s): string { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"> <title>SIMON • Ancient Code Matrix Decoder</title> <meta name="theme-color" content="#050816"> <style> :root{ --bg:#050816; --bg2:#071225; --panel:rgba(255,255,255,.07); --panel2:rgba(255,255,255,.045); --edge:rgba(255,255,255,.14); --txt:#eaf2ff; --mut:#96a8d8; --cyan:#79e8ff; --indigo:#7b62ff; --pink:#ff51cb; --green:#53f39b; --warn:#ffd85c; --bad:#ff6b7a; --r:20px; --shadow:0 20px 70px rgba(0,0,0,.55); } *{box-sizing:border-box} html,body{height:100%} body{ margin:0; font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif; color:var(--txt); background: radial-gradient(1100px 600px at 50% -5%, rgba(123,98,255,.18), transparent 55%), radial-gradient(800px 600px at 100% 100%, rgba(121,232,255,.08), transparent 58%), linear-gradient(180deg,var(--bg2),var(--bg)); overflow-x:hidden; } #matrix{position:fixed; inset:0; z-index:0; opacity:.22} .scanlines{ position:fixed; inset:0; pointer-events:none; z-index:1; background:repeating-linear-gradient(to bottom, rgba(255,255,255,.03) 0 1px, transparent 1px 4px); mix-blend-mode:soft-light; opacity:.2; } .wrap{position:relative; z-index:2; width:min(1320px,96vw); margin:0 auto; padding:24px 0 40px} .hero{ display:grid; gap:14px; margin-bottom:18px; padding:20px; border:1px solid var(--edge); border-radius:28px; background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); box-shadow:var(--shadow), inset 0 0 60px rgba(121,232,255,.04); backdrop-filter:blur(10px) saturate(135%); } .hero h1{margin:0; font-size:clamp(28px,4vw,54px); letter-spacing:.04em} .hero p{margin:0; color:var(--mut); max-width:980px; line-height:1.45} .badgeRow{display:flex; flex-wrap:wrap; gap:10px} .badge{padding:10px 12px; border-radius:999px; border:1px solid var(--edge); background:rgba(0,0,0,.22); font-size:12px; color:var(--mut)} .layout{display:grid; grid-template-columns:1.2fr .8fr; gap:18px} @media (max-width:1100px){.layout{grid-template-columns:1fr}} .card{ border:1px solid var(--edge); border-radius:var(--r); background:linear-gradient(180deg, var(--panel), var(--panel2)); box-shadow:var(--shadow); backdrop-filter:blur(10px) saturate(130%); overflow:hidden; } .cardHead{display:flex; justify-content:space-between; gap:12px; align-items:center; padding:16px 18px; border-bottom:1px solid rgba(255,255,255,.08)} .cardHead h2{margin:0; font-size:14px; letter-spacing:.14em; text-transform:uppercase} .body{padding:18px} textarea,input,select,button{font:inherit} textarea,input,select{ width:100%; color:var(--txt); border-radius:16px; border:1px solid var(--edge); background:rgba(0,0,0,.22); padding:14px 14px; outline:none; box-shadow:inset 0 0 18px rgba(123,98,255,.06); } textarea{min-height:180px; resize:vertical} .grid2{display:grid; grid-template-columns:1fr 1fr; gap:14px} .grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:14px} @media (max-width:780px){.grid2,.grid3{grid-template-columns:1fr}} label{display:block; font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--mut); margin:0 0 8px} .row{display:flex; gap:10px; flex-wrap:wrap} button{ cursor:pointer; border:1px solid var(--edge); color:var(--txt); background:rgba(0,0,0,.22); padding:12px 14px; border-radius:14px; box-shadow:0 10px 24px rgba(0,0,0,.25); transition:.18s transform,.18s border-color,.18s box-shadow; } button:hover{transform:translateY(-1px); border-color:rgba(121,232,255,.35); box-shadow:0 14px 28px rgba(0,0,0,.32), 0 0 24px rgba(121,232,255,.06)} .primary{background:linear-gradient(180deg, rgba(123,98,255,.34), rgba(121,232,255,.15)); border-color:rgba(121,232,255,.32)} .good{border-color:rgba(83,243,155,.35)} .warn{border-color:rgba(255,216,92,.35)} .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace} .results{display:grid; gap:12px} .resultBox{ border:1px solid rgba(255,255,255,.09); background:rgba(0,0,0,.22); border-radius:16px; padding:14px; } .resultBox h3{margin:0 0 8px; font-size:13px; letter-spacing:.08em; text-transform:uppercase} .out{white-space:pre-wrap; word-break:break-word; line-height:1.45} .pill{display:inline-flex; gap:8px; align-items:center; padding:8px 10px; border:1px solid var(--edge); border-radius:999px; background:rgba(255,255,255,.04); font-size:12px; color:var(--mut)} .stats{display:grid; grid-template-columns:repeat(2,1fr); gap:12px} .stat{padding:14px; border:1px solid rgba(255,255,255,.09); border-radius:16px; background:rgba(0,0,0,.2)} .stat b{display:block; font-size:24px; margin-top:8px} table{width:100%; border-collapse:collapse; font-size:13px} th,td{padding:8px 10px; border-bottom:1px solid rgba(255,255,255,.08); text-align:left} th{color:var(--mut); font-size:12px; letter-spacing:.08em; text-transform:uppercase} .candidateList{max-height:440px; overflow:auto} .candidate{padding:12px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(0,0,0,.18); margin-bottom:10px} .candidate .score{color:var(--green); font-weight:700} .small{font-size:12px; color:var(--mut)} .footer{margin-top:16px; color:var(--mut); text-align:center; font-size:12px} .matrixGlyphs{color:var(--green); opacity:.75; letter-spacing:.08em} </style> </head> <body> <canvas id="matrix"></canvas> <div class="scanlines"></div> <div class="wrap"> <section class="hero"> <div class="badgeRow"> <span class="badge">SIMON Decoder Core</span> <span class="badge">Ancient Cipher Analysis</span> <span class="badge">Matrix Pattern Engine</span> <span class="badge">Interactive PHP Console</span> </div> <h1>Ancient Code + Matrix Decoder</h1> <p> Drop in a mysterious phrase, symbol string, coded sentence, or suspected Matrix-style pattern. This console brute-forces common ciphers, scores likely results, maps character frequencies, highlights repeating structures, and lets you test keys interactively. Built as a single-file PHP app with a live neon decoder interface. ✨ </p> </section> <div class="layout"> <section class="card"> <div class="cardHead"> <h2>Decoder Input</h2> <div class="pill"><span>Mode</span><b id="modeLabel">Full Sweep</b></div> </div> <div class="body"> <label for="cipherInput">Cipher / message / glyph stream</label> <textarea id="cipherInput" class="mono" placeholder="Enter the ancient code here... Example: GSRH RH Z HVXIVG Example: Wklv lv d whvw Example: Ymnx nx f xjhwjy hnumjw">GSRH RH Z HVXIVG</textarea> <div class="grid3" style="margin-top:14px"> <div> <label for="sweepMode">Analysis mode</label> <select id="sweepMode"> <option value="full">Full sweep</option> <option value="caesar">Caesar only</option> <option value="vigenere">Vigenère</option> <option value="rail">Rail fence helper</option> <option value="pattern">Pattern / matrix only</option> </select> </div> <div> <label for="vigenereKey">Vigenère key</label> <input id="vigenereKey" class="mono" type="text" placeholder="KEY"> </div> <div> <label for="railKey">Rail fence rails</label> <input id="railKey" class="mono" type="number" min="2" max="8" value="3"> </div> </div> <div class="row" style="margin-top:16px"> <button class="primary" id="runBtn">Run Decoder Sweep</button> <button id="caesarBtn">Brute Force Caesar</button> <button id="atbashBtn">Try Atbash</button> <button id="vigBtn">Try Vigenère</button> <button id="railBtn">Try Rail Fence</button> <button class="warn" id="clearBtn">Clear</button> </div> <div class="results" style="margin-top:18px"> <div class="resultBox"> <h3>Best Candidate</h3> <div id="bestCandidate" class="out mono">Waiting for analysis…</div> </div> <div class="grid2"> <div class="resultBox"> <h3>Quick Decode</h3> <div id="quickDecode" class="out mono">—</div> </div> <div class="resultBox"> <h3>Pattern Notes</h3> <div id="patternNotes" class="out">—</div> </div> </div> </div> </div> </section> <aside class="card"> <div class="cardHead"> <h2>Signal Metrics</h2> <div class="pill"><span>Status</span><b class="matrixGlyphs">LIVE</b></div> </div> <div class="body"> <div class="stats"> <div class="stat"><span class="small">Characters</span><b id="charCount">0</b></div> <div class="stat"><span class="small">Unique glyphs</span><b id="uniqueCount">0</b></div> <div class="stat"><span class="small">Cipher score</span><b id="cipherScore">0</b></div> <div class="stat"><span class="small">English fit</span><b id="englishFit">0%</b></div> </div> <div class="resultBox" style="margin-top:14px"> <h3>Frequency Analysis</h3> <div id="freqTable"></div> </div> <div class="resultBox" style="margin-top:14px"> <h3>Repeating Patterns</h3> <div id="patternTable"></div> </div> </div> </aside> </div> <section class="card" style="margin-top:18px"> <div class="cardHead"> <h2>Candidate Sweep</h2> <div class="pill"><span>Ranked by</span><b>word-fit + frequency + clue patterns</b></div> </div> <div class="body"> <div id="candidateList" class="candidateList"></div> </div> </section> <div class="footer">Built for SIMON / Wicked Game style decoding • Single-file PHP • interactive client-side cipher engine</div> </div> <script> (() => { const $ = id => document.getElementById(id); const E = { cipherInput: $('cipherInput'), sweepMode: $('sweepMode'), vigenereKey: $('vigenereKey'), railKey: $('railKey'), runBtn: $('runBtn'), caesarBtn: $('caesarBtn'), atbashBtn: $('atbashBtn'), vigBtn: $('vigBtn'), railBtn: $('railBtn'), clearBtn: $('clearBtn'), bestCandidate: $('bestCandidate'), quickDecode: $('quickDecode'), patternNotes: $('patternNotes'), modeLabel: $('modeLabel'), charCount: $('charCount'), uniqueCount: $('uniqueCount'), cipherScore: $('cipherScore'), englishFit: $('englishFit'), freqTable: $('freqTable'), patternTable: $('patternTable'), candidateList: $('candidateList') }; const commonWords = ['THE','AND','ING','ION','ENT','ED','TO','OF','IN','THAT','IS','IT','YOU','FOR','ON','WITH','AS','THIS','SECRET','CODE','MATRIX','KEY','GATE','LIGHT','SIGNAL','SYSTEM','TRUTH']; const etaoin = 'ETAOINSHRDLCUMWFGYPBVKJXQZ'; const alphaOnly = s => (s.toUpperCase().match(/[A-Z]/g) || []).join(''); function shiftChar(ch, shift) { const code = ch.charCodeAt(0); if (code >= 65 && code <= 90) return String.fromCharCode(((code - 65 + shift + 26 * 100) % 26) + 65); if (code >= 97 && code <= 122) return String.fromCharCode(((code - 97 + shift + 26 * 100) % 26) + 97); return ch; } function caesar(text, shift) { return [...text].map(ch => shiftChar(ch, shift)).join(''); } function atbash(text) { return [...text].map(ch => { const code = ch.charCodeAt(0); if (code >= 65 && code <= 90) return String.fromCharCode(90 - (code - 65)); if (code >= 97 && code <= 122) return String.fromCharCode(122 - (code - 97)); return ch; }).join(''); } function vigenere(text, key, decode = true) { key = alphaOnly(key); if (!key) return text; let ki = 0; return [...text].map(ch => { const isUpper = ch >= 'A' && ch <= 'Z'; const isLower = ch >= 'a' && ch <= 'z'; if (!isUpper && !isLower) return ch; const base = isUpper ? 65 : 97; const shift = key.charCodeAt(ki % key.length) - 65; ki++; const signed = decode ? -shift : shift; return String.fromCharCode((((ch.charCodeAt(0) - base) + signed + 26 * 100) % 26) + base); }).join(''); } function railFenceDecode(text, rails) { rails = Math.max(2, Number(rails || 3)); const clean = [...text]; const pattern = []; let row = 0, dir = 1; for (let i = 0; i < clean.length; i++) { pattern.push(row); if (row === 0) dir = 1; else if (row === rails - 1) dir = -1; row += dir; } const counts = Array.from({length: rails}, (_, r) => pattern.filter(v => v === r).length); const railArrs = []; let idx = 0; for (let r = 0; r < rails; r++) { railArrs[r] = clean.slice(idx, idx + counts[r]); idx += counts[r]; } const pointers = Array(rails).fill(0); return pattern.map(r => railArrs[r][pointers[r]++]).join(''); } function frequencies(text) { const freq = {}; for (const ch of alphaOnly(text)) freq[ch] = (freq[ch] || 0) + 1; return Object.entries(freq).sort((a,b)=>b[1]-a[1]); } function repeatingPatterns(text) { const s = alphaOnly(text); const found = {}; for (let len = 2; len <= 4; len++) { for (let i = 0; i <= s.length - len; i++) { const sub = s.slice(i, i + len); if (/^(.)\1+$/.test(sub)) continue; found[sub] = (found[sub] || 0) + 1; } } return Object.entries(found).filter(([,count]) => count > 1).sort((a,b)=>b[1]-a[1]).slice(0,18); } function englishScore(text) { const up = text.toUpperCase(); let score = 0; for (const w of commonWords) if (up.includes(w)) score += w.length * 2.5; const letters = alphaOnly(up); if (!letters) return 0; const freq = frequencies(up).map(([ch]) => ch).join(''); for (let i = 0; i < Math.min(6, freq.length); i++) { if (etaoin.slice(0,8).includes(freq[i])) score += 4 - (i * .35); } const vowels = (letters.match(/[AEIOU]/g) || []).length; const vowelRatio = vowels / letters.length; if (vowelRatio > .24 && vowelRatio < .48) score += 12; const badClusters = (up.match(/[QZXJ]{3,}/g) || []).length; score -= badClusters * 8; const readableWords = (up.match(/\b[A-Z]{2,}\b/g) || []).length; score += readableWords * 1.25; return Math.max(0, score); } function fitPercent(score) { return Math.max(0, Math.min(100, Math.round(score * 3.3))); } function summarizePatterns(text) { const pats = repeatingPatterns(text); const freq = frequencies(text).slice(0,5).map(([c,n]) => `${c}:${n}`).join(', '); const notes = []; if (pats.length) notes.push(`Repeating clusters suggest structured cipher behavior: ${pats.slice(0,5).map(([p,c]) => `${p}×${c}`).join(' • ')}`); else notes.push('Low repetition. Could be short plaintext, one-time pad style noise, or a heavily transformed phrase.'); notes.push(`Top glyph frequencies: ${freq || 'none'}`); const spaced = /\s/.test(text); notes.push(spaced ? 'Spaces preserved — likely substitution or shifted plaintext.' : 'No spaces — possible transposition, compressed phrase, or stylized matrix stream.'); return notes.join('\n'); } function candidateCard(c) { return `<div class="candidate"> <div class="row" style="justify-content:space-between; align-items:center; margin-bottom:8px"> <div><b>${c.label}</b></div> <div class="score">Score ${c.score.toFixed(1)} • Fit ${fitPercent(c.score)}%</div> </div> <div class="small mono" style="margin-bottom:8px">${c.meta || ''}</div> <div class="mono out">${escapeHtml(c.text)}</div> </div>`; } function escapeHtml(s) { return String(s).replace(/[&<>"']/g, m => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[m])); } function analyze(modeOverride = null) { const raw = E.cipherInput.value || ''; const text = raw.trim(); const mode = modeOverride || E.sweepMode.value; E.modeLabel.textContent = ({full:'Full Sweep',caesar:'Caesar Only',vigenere:'Vigenère',rail:'Rail Fence',pattern:'Pattern Only'})[mode] || 'Full Sweep'; const chars = text.length; const uniq = new Set(text.replace(/\s+/g,'').split('')).size; E.charCount.textContent = String(chars); E.uniqueCount.textContent = String(uniq); const freq = frequencies(text); E.freqTable.innerHTML = freq.length ? `<table><thead><tr><th>Glyph</th><th>Count</th></tr></thead><tbody>${freq.slice(0,12).map(([ch,n]) => `<tr><td class="mono">${ch}</td><td>${n}</td></tr>`).join('')}</tbody></table>` : '<div class="small">No alphabetic signal found.</div>'; const pats = repeatingPatterns(text); E.patternTable.innerHTML = pats.length ? `<table><thead><tr><th>Pattern</th><th>Hits</th></tr></thead><tbody>${pats.map(([p,n]) => `<tr><td class="mono">${p}</td><td>${n}</td></tr>`).join('')}</tbody></table>` : '<div class="small">No repeating patterns detected.</div>'; const candidates = []; if (text) { if (mode === 'full' || mode === 'caesar') { for (let s = 0; s < 26; s++) { const out = caesar(text, -s); candidates.push({ label:`Caesar Shift ${s}`, text:out, score:englishScore(out), meta:`rotation=${s}` }); } } if (mode === 'full' || mode === 'pattern') { candidates.push({ label:'Atbash', text:atbash(text), score:englishScore(atbash(text)) + 3, meta:'mirrored alphabet substitution' }); candidates.push({ label:'Pattern Insight', text:text, score:englishScore(text) * .5 + 2, meta:'raw signal / matrix structure view' }); } if (mode === 'full' || mode === 'vigenere') { const key = E.vigenereKey.value.trim(); if (key) { const out = vigenere(text, key, true); candidates.push({ label:`Vigenère Decode`, text:out, score:englishScore(out) + 5, meta:`key=${key.toUpperCase()}` }); } } if (mode === 'full' || mode === 'rail') { const rails = Math.max(2, Number(E.railKey.value || 3)); const out = railFenceDecode(text, rails); candidates.push({ label:`Rail Fence Decode`, text:out, score:englishScore(out) + 2, meta:`rails=${rails}` }); } } candidates.sort((a,b) => b.score - a.score); const best = candidates[0]; E.bestCandidate.textContent = best ? `${best.label}\n${best.text}` : 'No candidate yet.'; E.quickDecode.textContent = best ? best.text : '—'; E.patternNotes.textContent = text ? summarizePatterns(text) : '—'; E.cipherScore.textContent = best ? best.score.toFixed(1) : '0'; E.englishFit.textContent = best ? `${fitPercent(best.score)}%` : '0%'; E.candidateList.innerHTML = candidates.length ? candidates.slice(0,28).map(candidateCard).join('') : '<div class="small">Run analysis to populate candidates.</div>'; } E.runBtn.addEventListener('click', () => analyze()); E.caesarBtn.addEventListener('click', () => analyze('caesar')); E.atbashBtn.addEventListener('click', () => { E.modeLabel.textContent = 'Atbash'; const text = E.cipherInput.value || ''; const out = atbash(text); E.bestCandidate.textContent = `Atbash\n${out}`; E.quickDecode.textContent = out; E.patternNotes.textContent = summarizePatterns(text); E.cipherScore.textContent = (englishScore(out) + 3).toFixed(1); E.englishFit.textContent = `${fitPercent(englishScore(out) + 3)}%`; analyze('pattern'); }); E.vigBtn.addEventListener('click', () => analyze('vigenere')); E.railBtn.addEventListener('click', () => analyze('rail')); E.clearBtn.addEventListener('click', () => { E.cipherInput.value = ''; E.vigenereKey.value = ''; analyze(); }); E.cipherInput.addEventListener('input', () => analyze(E.sweepMode.value)); E.sweepMode.addEventListener('change', () => analyze(E.sweepMode.value)); E.vigenereKey.addEventListener('input', () => { if (E.sweepMode.value === 'vigenere' || E.sweepMode.value === 'full') analyze(E.sweepMode.value); }); E.railKey.addEventListener('input', () => { if (E.sweepMode.value === 'rail' || E.sweepMode.value === 'full') analyze(E.sweepMode.value); }); analyze('full'); // Matrix rain background const canvas = document.getElementById('matrix'); const ctx = canvas.getContext('2d'); const glyphs = 'アァカサタナハマヤャラワガザダバパ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ{}[]<>/*+=-~:;'; let columns = [], fontSize = 16, width = 0, height = 0; function resizeMatrix() { const dpr = Math.max(1, Math.min(2, window.devicePixelRatio || 1)); width = canvas.width = Math.floor(window.innerWidth * dpr); height = canvas.height = Math.floor(window.innerHeight * dpr); canvas.style.width = window.innerWidth + 'px'; canvas.style.height = window.innerHeight + 'px'; ctx.setTransform(dpr,0,0,dpr,0,0); const colCount = Math.ceil(window.innerWidth / fontSize); columns = Array.from({length: colCount}, () => Math.random() * -40); } function drawMatrix() { ctx.fillStyle = 'rgba(5,8,22,.13)'; ctx.fillRect(0,0,window.innerWidth,window.innerHeight); ctx.font = fontSize + 'px ui-monospace, monospace'; for (let i = 0; i < columns.length; i++) { const char = glyphs[Math.floor(Math.random() * glyphs.length)]; const x = i * fontSize; const y = columns[i] * fontSize; ctx.fillStyle = i % 6 === 0 ? 'rgba(190,255,220,.95)' : 'rgba(83,243,155,.72)'; ctx.fillText(char, x, y); if (y > window.innerHeight + Math.random() * 1200 && Math.random() > .985) columns[i] = 0; columns[i] += .58 + Math.random() * .8; } requestAnimationFrame(drawMatrix); } window.addEventListener('resize', resizeMatrix); resizeMatrix(); drawMatrix(); })(); </script> </body> </html>
Save file
Quick jump
open a path
Open