File size: 9,679 Bytes
f43aa2c
d7b4876
 
 
 
b5673d2
3e16695
d7b4876
 
 
b5673d2
 
3e16695
b5673d2
 
 
 
 
 
 
d7b4876
b5673d2
 
d7b4876
3e16695
d7b4876
 
b5673d2
d7b4876
 
 
 
b5673d2
 
d7b4876
 
b5673d2
e9ca5da
b5673d2
e9ca5da
3dc595d
 
 
 
e9ca5da
cdc0844
 
 
 
e9ca5da
 
 
 
 
 
 
 
 
3dc595d
e9ca5da
 
d7b4876
 
 
b5673d2
 
 
 
 
 
d7b4876
b5673d2
 
77f41f7
b5673d2
 
 
d7b4876
 
b5673d2
d7b4876
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77f41f7
 
d7b4876
 
 
 
 
 
 
 
 
 
b5673d2
d7b4876
 
 
 
 
3dc595d
b5673d2
cdc0844
b5673d2
 
d7b4876
 
3e16695
 
 
 
3dc595d
 
 
 
 
 
 
3e16695
 
 
 
 
 
 
3dc595d
3e16695
 
 
 
 
 
 
 
d7b4876
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5673d2
d7b4876
3e16695
 
 
 
d7b4876
 
 
 
 
 
 
 
 
 
 
f43aa2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="color-scheme" content="light dark" />
  <title>Steganography Decoder</title>
  <link rel="stylesheet" href="style.css" />
</head>
<body>
  <header class="topbar">
    <div class="topbar-inner">
      <span class="wordmark">Steganography Decoder</span>
      <span class="status" id="status" data-kind="idle" role="status" aria-live="polite">
        <span class="status-dot" aria-hidden="true"></span>
        <span id="status-text">Checking browser…</span>
      </span>
    </div>
  </header>

  <main>
    <section class="hero">
      <h1>Decode what an image is hiding.</h1>
      <p class="sub">
        Finds and decodes hidden messages, embedded files, faint text and watermarks in an image.
        Everything runs in your browser: your image never leaves this page.
      </p>
    </section>

    <section class="card" id="input-card">
      <label class="drop" id="drop">
        <input type="file" id="file" accept="image/png,image/jpeg,image/webp,image/gif,image/bmp" />
        <svg class="drop-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15V4m0 0L7.5 8.5M12 4l4.5 4.5M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
        <span class="drop-main">Drop an image, or click to choose one</span>
        <span class="drop-sub">PNG keeps hidden data intact. JPEG and WebP compression destroy most of it.</span>
      </label>

      <div class="demos">
        <p class="eyebrow" id="demo-label">Or try a demo</p>
        <div class="demo-grid" role="group" aria-labelledby="demo-label">
          <button type="button" class="demo-card demo" data-src="demo/quiet-signal.png">
            <img src="demo/thumbs/quiet-signal.jpg" alt="" width="480" height="320" />
            <span class="demo-title">Quiet signal</span>
            <span class="demo-sub">A sentence hidden in the pixels' lowest bits</span>
          </button>
          <button type="button" class="demo-card demo" data-src="demo/colour-stripes.png">
            <img src="demo/thumbs/colour-stripes.jpg" alt="" width="480" height="270" />
            <span class="demo-title">Colour stripes</span>
            <span class="demo-sub">Letters hidden a few shades off the stripes</span>
          </button>
          <button type="button" class="demo-card demo" data-src="demo/ribbons-c2pa.jpg">
            <img src="demo/thumbs/ribbons-c2pa.jpg" alt="" width="480" height="320" />
            <span class="demo-title">Ribbons</span>
            <span class="demo-sub">Real photo with an edit history</span>
          </button>
          <button type="button" class="demo-card" id="sample">
            <canvas id="sample-preview" width="480" height="270" aria-hidden="true"></canvas>
            <span class="demo-title">Harbour</span>
            <span class="demo-sub">Messages in its bits, an attached file, a faint watermark</span>
          </button>
        </div>
      </div>

      <div class="options">
        <label class="option">
          <span class="option-text">
            <span class="option-title">Read text</span>
            <span class="option-sub">Florence-2 · <span id="ocr-size">about 360 MB</span> · downloaded once</span>
          </span>
          <input type="checkbox" class="switch" role="switch" id="use-ocr" checked />
        </label>
        <label class="option">
          <span class="option-text">
            <span class="option-title">AI steganalysis</span>
            <span class="option-sub">Qwen3-VL-2B · about 1.4 GB · downloaded once · needs WebGPU</span>
          </span>
          <input type="checkbox" class="switch" role="switch" id="use-vlm" />
        </label>
      </div>
      <p class="caps" id="caps">Checking your browser…</p>

      <div class="storage" id="storage" hidden>
        <span id="storage-text"></span>
        <button type="button" class="link" id="clear">Remove downloaded models</button>
      </div>
    </section>

    <section class="card" id="progress-card" hidden>
      <ol class="steps" id="steps"></ol>
      <div class="bar" id="bar-wrap" hidden><div class="bar-fill" id="bar"></div></div>
      <p class="bar-text" id="bar-text"></p>
      <button type="button" class="secondary" id="stop" hidden>Stop</button>
    </section>

    <section id="results" hidden>
      <section class="card">
        <h2>Findings</h2>
        <p class="notes" id="notes"></p>
        <ul class="findings" id="findings"></ul>
      </section>

      <section class="card" id="ai-card" hidden>
        <h2>AI steganalysis</h2>
        <p class="hint">Qwen3-VL-2B judges whether something is hidden, how, what it means and what to try next, from the bit plane, the picture and the decoder results. It can be wrong; the findings are the evidence.</p>
        <div class="ai" id="ai"></div>
        <details class="sent">
          <summary>What the AI was shown</summary>
          <div class="thumbs" id="ai-images"></div>
          <pre id="ai-prompt"></pre>
        </details>
      </section>

      <section class="card">
        <h2>Views</h2>
        <div class="segmented" id="tabs" role="tablist"></div>
        <p class="hint" id="view-info"></p>
        <div class="stage" id="stage">
          <canvas id="view"></canvas>
          <svg id="overlay" preserveAspectRatio="none"></svg>
        </div>
        <p class="inspect" id="view-inspect">Point at the picture to read a pixel's values.</p>
        <label class="option option-small">
          <span class="option-text"><span class="option-title">Show boxes</span></span>
          <input type="checkbox" class="switch" role="switch" id="show-boxes" checked />
        </label>
      </section>

      <section class="card" id="decoder-card">
        <h2>Decoder</h2>
        <p class="hint">Read bytes straight out of the pixels, the way steganography tools hide them. Open a hit from the scan, or pick channels and bits yourself.</p>
        <ul class="hits" id="hits"></ul>
        <div class="dec-actions dec-deep">
          <button type="button" class="secondary" id="deep-scan">Search the whole image</button>
          <span class="hint" id="deep-info">The automatic scan reads the first 4 KB of each ordering. This reads every bit (about a second).</span>
        </div>
        <p class="eyebrow dec-eyebrow" id="grid-label">Every bit plane</p>
        <div class="plane-grid" id="plane-grid" role="group" aria-labelledby="grid-label"></div>
        <p class="hint grid-hint">Low bits of an untouched image look like noise or echo its shapes. A word, QR code or picture showing up in one tile is hidden there. Click a tile to open it below.</p>
        <div class="dec-controls">
          <div class="dec-row"><span class="dec-label" id="dec-channels-label">Channels</span><div class="segmented" id="dec-channels" role="radiogroup" aria-labelledby="dec-channels-label"></div></div>
          <div class="dec-row"><span class="dec-label" id="dec-bits-label">Bits</span><div class="segmented" id="dec-bits" role="group" aria-labelledby="dec-bits-label"></div></div>
          <div class="dec-row"><span class="dec-label" id="dec-order-label">Pixel order</span><div class="segmented" id="dec-order" role="radiogroup" aria-labelledby="dec-order-label"></div></div>
          <div class="dec-row"><span class="dec-label" id="dec-msb-label">Byte order</span><div class="segmented" id="dec-msb" role="radiogroup" aria-labelledby="dec-msb-label"></div></div>
        </div>
        <div class="stage"><canvas id="plane" class="pixelated"></canvas></div>
        <p class="inspect" id="plane-inspect">Point at the picture to read a pixel's values.</p>
        <p class="dec-summary" id="dec-summary" aria-live="polite"></p>
        <pre class="dump" id="dump"></pre>
        <div class="dec-actions">
          <button type="button" class="secondary" id="dec-save">Save these bytes</button>
          <span class="hint" id="dec-save-info"></span>
        </div>
      </section>

      <section class="card" id="text-card">
        <h2>Text found</h2>
        <table class="texts">
          <thead><tr><th>Text</th><th>Seen in</th><th>Position</th></tr></thead>
          <tbody id="texts"></tbody>
        </table>
        <p class="hint" id="texts-empty" hidden>No text found.</p>
      </section>

      <section class="card">
        <h2>Colours</h2>
        <div class="palette" id="palette"></div>
        <dl class="stats" id="color-stats"></dl>
      </section>

      <section class="card">
        <h2>File</h2>
        <dl class="stats" id="file-stats"></dl>
        <details>
          <summary>File structure</summary>
          <p class="structure" id="structure"></p>
        </details>
        <div class="dec-actions" id="trailing-actions" hidden>
          <button type="button" class="secondary" id="save-trailing">Save the appended data</button>
          <span class="hint" id="trailing-info"></span>
        </div>
      </section>
    </section>

    <footer>
      Models: <a href="https://huggingface.co/onnx-community/Florence-2-base-ft" target="_blank" rel="noopener">Florence-2-base</a> (MIT) ·
      <a href="https://huggingface.co/onnx-community/Qwen3-VL-2B-Instruct-ONNX" target="_blank" rel="noopener">Qwen3-VL-2B-Instruct</a> (Apache-2.0) ·
      Runs with <a href="https://huggingface.co/docs/transformers.js" target="_blank" rel="noopener">Transformers.js</a>
    </footer>
  </main>
  <script type="module" src="app.js"></script>
</body>
</html>