-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcipher-detective.html
More file actions
472 lines (443 loc) · 31.7 KB
/
Copy pathcipher-detective.html
File metadata and controls
472 lines (443 loc) · 31.7 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cipher Detective — The Cipher Museum</title>
<meta name="description" content="Paste unknown ciphertext and let the Cipher Detective walk you through the evidence — frequency analysis, Index of Coincidence, Kasiski examination — to identify the most likely cipher family.">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<link rel="manifest" href="manifest.webmanifest">
<link rel="canonical" href="https://ciphermuseum.com/cipher-detective.html">
<meta name="theme-color" content="#0a0a0f">
<link rel="stylesheet" href="css/museum.css">
<style>
.det-workspace { max-width: 1100px; margin: 0 auto; }
.det-grid { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }
@media(max-width: 820px) { .det-grid { grid-template-columns: 1fr; } }
.det-input-label { display: block; margin-bottom: .5rem; font-family: var(--fm); font-size: .7rem;
letter-spacing: .15em; text-transform: uppercase; color: var(--tx3); }
.det-textarea { width: 100%; height: 200px; padding: 1rem; background: var(--s3); border: 1px solid var(--s5);
border-radius: var(--r); color: var(--tx); font-family: var(--fm); font-size: .9rem;
resize: vertical; box-sizing: border-box; }
.det-textarea:focus { outline: none; border-color: var(--gold); }
.det-labels-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1rem; }
.det-label { display: inline-flex; align-items: center; font-family: var(--fm); font-size: .68rem;
letter-spacing: .07em; padding: .28rem .75rem .28rem .65rem;
border-left: 3px solid var(--gold); background: var(--gold-glow);
border-radius: 0 3px 3px 0; color: var(--tx2); cursor: default; }
.det-callout-warn { background: rgba(200,90,90,.07); border-left: 3px solid var(--red);
border-radius: 0 var(--r) var(--r) 0; padding: .9rem 1.1rem;
font-family: var(--fb); font-size: .88rem; color: var(--tx2);
line-height: 1.5; margin-bottom: 1.5rem; }
.det-callout-warn strong { color: var(--red); }
.det-section { margin-bottom: 2.5rem; }
.det-section-title { font-family: var(--fd); font-size: 1.1rem; color: var(--gold);
letter-spacing: .05em; margin: 0 0 1rem; padding-bottom: .4rem;
border-bottom: 1px solid var(--s4); }
.det-chart-wrap { margin-bottom: .75rem; }
.det-interp { font-family: var(--fb); font-size: .88rem; color: var(--tx2);
line-height: 1.6; margin: 0 0 .25rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.suspect-card { background: var(--s3); border: 1px solid var(--s4); border-radius: var(--r);
padding: 1rem 1.1rem; margin-bottom: .9rem; }
.suspect-header { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.suspect-rank { font-family: var(--fm); font-size: .62rem; letter-spacing: .12em;
text-transform: uppercase; color: var(--tx3); flex-shrink: 0; }
.suspect-name { font-family: var(--fd); font-size: 1.1rem; color: var(--tx); flex-grow: 1; }
.conf-badge { font-family: var(--fm); font-size: .72rem; padding: .18rem .55rem;
border-radius: 3px; white-space: nowrap; flex-shrink: 0; }
.conf-very-likely { background: rgba(90,200,160,.12); color: var(--green); border: 1px solid rgba(90,200,160,.3); }
.conf-likely { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--gold-b); }
.conf-possible { background: rgba(160,127,204,.10); color: var(--purple); border: 1px solid rgba(160,127,204,.25); }
.conf-unlikely { background: var(--s4); color: var(--tx3); border: 1px solid var(--s5); }
.conf-inconclusive{ background: var(--s3); color: var(--tx3); border: 1px solid var(--s4); }
.evidence-list { list-style: none; padding: 0; margin: 0 0 .5rem; font-size: .83rem;
color: var(--tx2); line-height: 1.55; }
.evidence-item { padding-left: 1.4rem; position: relative; margin-bottom: .3rem; }
.evidence-item span { position: absolute; left: 0; font-family: var(--fm); font-weight: 700; font-size: .9rem; }
.evidence-item--pro span { color: var(--green); }
.evidence-item--con span { color: var(--red); }
.suspect-link { margin-top: .75rem; font-family: var(--fm); font-size: .68rem;
text-transform: uppercase; letter-spacing: .08em; }
.det-section--notes { background: var(--s2); border-radius: var(--r); padding: 1.25rem 1.4rem; margin-bottom: 2.5rem; }
.det-section--notes .det-section-title { border-color: var(--gold-b); }
#det-case-notes p { font-family: var(--fb); font-size: .95rem; color: var(--tx2); line-height: 1.75; margin: 0; }
.next-attack-box { background: var(--s2); border: 1px solid var(--gold-b); border-radius: var(--r);
padding: 1.1rem 1.3rem; }
.next-attack-text { font-family: var(--fb); font-size: .95rem; color: var(--tx2); line-height: 1.7; margin: 0 0 .75rem; }
.next-attack-link { font-family: var(--fm); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.analysis-panel { background: var(--s2); border: 1px solid var(--gold-b); border-radius: var(--rl);
padding: 1.4rem; position: sticky; top: 80px; }
.det-panel-title { font-family: var(--fd); font-size: 1rem; color: var(--gold); margin: 0 0 1rem; }
.stats-table { width: 100%; border-collapse: collapse; font-family: var(--fm); font-size: .78rem; }
.stats-table th, .stats-table td { padding: .45rem .3rem; text-align: left; border-bottom: 1px solid var(--s4); }
.stats-table th { color: var(--tx3); font-weight: normal; letter-spacing: .05em;
text-transform: uppercase; font-size: .62rem; }
.stats-table td { color: var(--gold-lt); }
.det-panel-footer { margin-top: 1.5rem; font-family: var(--fm); font-size: .68rem;
letter-spacing: .1em; text-transform: uppercase; }
.det-learn-link { color: var(--gold-dim); text-decoration: none; }
.det-learn-link:hover { color: var(--gold); }
.det-limitations { margin-top: 3rem; background: var(--s2); padding: 1.5rem 1.75rem;
border-radius: var(--r); font-size: .85rem; color: var(--tx2); line-height: 1.65; }
.det-limitations h3 { font-family: var(--fb); color: var(--tx); margin: 0 0 .75rem; font-size: .95rem; }
.det-limitations ul { margin: 0 0 0 1.2rem; padding: 0; }
.det-limitations li { margin-bottom: .4rem; }
.det-empty { padding: 3rem 1rem; text-align: center; border: 1px dashed var(--s5);
border-radius: var(--r); color: var(--tx3); font-family: var(--fm);
font-size: .82rem; letter-spacing: .05em; margin-bottom: 1.5rem; }
.det-muted { color: var(--tx3); font-family: var(--fb); font-size: .9rem; }
/* ── v2: Attack Tools ─────────────────────────────────────── */
.attack-tools-header { font-family: var(--fm); font-size: .65rem; letter-spacing: .12em;
text-transform: uppercase; color: var(--tx3); margin-bottom: .6rem; }
.attack-tools-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; }
.attack-btn { font-family: var(--fm); font-size: .7rem; letter-spacing: .06em;
padding: .35rem .75rem; background: var(--s3); border: 1px solid var(--s5);
border-radius: 3px; color: var(--tx2); cursor: pointer; transition: border-color .15s, color .15s; }
.attack-btn:not([disabled]):hover { border-color: var(--gold); color: var(--gold); }
.attack-btn--disabled,
.attack-btn[disabled] { opacity: .38; cursor: not-allowed; }
.attack-result { background: var(--s2); border: 1px solid var(--s4); border-radius: var(--r);
padding: .85rem 1rem; min-height: 2.5rem; }
.attack-result:empty { display: none; }
.attack-result-line { margin: 0 0 .3rem; font-family: var(--fb); font-size: .88rem; color: var(--tx2); }
.attack-result-table { width: 100%; border-collapse: collapse; font-family: var(--fm); font-size: .78rem; margin: 0; }
.attack-result-table th,
.attack-result-table td { padding: .4rem .3rem; text-align: left; border-bottom: 1px solid var(--s4); }
.attack-result-table th { color: var(--tx3); font-weight: normal; font-size: .62rem;
letter-spacing: .05em; text-transform: uppercase; }
.attack-result-table td { color: var(--tx2); }
.attack-best-row td { color: var(--gold); }
.attack-plaintext { font-family: var(--fm); color: var(--gold-lt); word-break: break-all; }
.attack-warn { color: var(--red); }
.attack-nil { color: var(--tx3); font-family: var(--fb); font-size: .85rem; margin: 0; }
.attack-note { font-family: var(--fb); font-size: .8rem; color: var(--tx3); margin: .4rem 0 0; line-height: 1.5; }
.sf-pair { display: inline-block; background: var(--s3); border: 1px solid var(--s4);
border-radius: 3px; padding: .1rem .35rem; font-family: var(--fm);
font-size: .78rem; color: var(--gold-lt); margin: .1rem 0; }
.subst-freq-result { }
/* ── v3: Auto-Solve panel ─────────────────────────────────── */
.det-autosolve-intro { font-family: var(--fb); font-size: .88rem; line-height: 1.55;
color: var(--tx2); margin: 0 0 .9rem; }
.autosolve-btn { font-family: var(--fm); font-size: .78rem; letter-spacing: .08em;
padding: .55rem 1.2rem; background: linear-gradient(180deg, var(--s3), var(--s2));
border: 1px solid var(--gold-b); border-radius: 3px; color: var(--gold-lt);
cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.autosolve-btn:not([disabled]):hover { background: var(--gold-glow); border-color: var(--gold); color: var(--gold); }
.autosolve-btn[disabled] { opacity: .4; cursor: not-allowed; }
.autosolve-btn--running { color: var(--gold); border-color: var(--gold); }
.autosolve-result:empty { display: none; }
.autosolve-result { margin-top: 1rem; }
.autosolve-best { background: var(--s2); border: 1px solid var(--gold-b); border-radius: var(--r);
padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.autosolve-best-header { display: flex; justify-content: space-between; align-items: baseline;
flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.autosolve-best-method { font-family: var(--fd); font-size: 1rem; color: var(--gold); margin: 0; }
.autosolve-best-key { font-family: var(--fm); font-size: .78rem; color: var(--tx3); margin: .1rem 0 .7rem;
word-break: break-all; }
.autosolve-best-plain { font-family: var(--fm); font-size: .92rem; color: var(--gold-lt);
background: var(--s1); border: 1px solid var(--s4); border-radius: 3px;
padding: .7rem .9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
max-height: 14rem; overflow-y: auto; }
.conf-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px;
font-family: var(--fm); font-size: .7rem; letter-spacing: .04em;
text-transform: uppercase; border: 1px solid currentColor; }
.conf-badge--very-likely { color: #7CFC8F; }
.conf-badge--likely { color: var(--gold); }
.conf-badge--possible { color: #E0B97E; }
.conf-badge--unlikely { color: #C9806B; }
.conf-badge--inconclusive { color: var(--tx3); }
.autosolve-others { font-family: var(--fb); font-size: .82rem; color: var(--tx3); }
.autosolve-others-title { font-family: var(--fm); font-size: .7rem; letter-spacing: .06em;
text-transform: uppercase; color: var(--tx3); margin: 0 0 .5rem; }
.autosolve-others-table { width: 100%; border-collapse: collapse; font-family: var(--fm);
font-size: .76rem; }
.autosolve-others-table th,
.autosolve-others-table td { padding: .35rem .4rem; text-align: left; border-bottom: 1px solid var(--s4);
color: var(--tx2); vertical-align: top; }
.autosolve-others-table th { color: var(--tx3); font-weight: normal; font-size: .62rem;
letter-spacing: .05em; text-transform: uppercase; }
.autosolve-others-table .ao-plain { font-family: var(--fm); color: var(--tx2); }
.autosolve-runtime { font-family: var(--fm); font-size: .7rem; color: var(--tx3); margin: .8rem 0 0; }
.autosolve-skip { font-family: var(--fb); font-size: .85rem; color: var(--tx3); margin: 0;
padding: .8rem 1rem; background: var(--s2); border: 1px dashed var(--s4); border-radius: var(--r); }
.autosolve-cta { display: inline-block; margin-top: .8rem; font-family: var(--fm); font-size: .72rem;
letter-spacing: .06em; padding: .4rem .9rem; background: var(--s3); border: 1px solid var(--s5);
border-radius: 3px; color: var(--gold-lt); text-decoration: none; transition: border-color .15s, color .15s; }
.autosolve-cta:hover { border-color: var(--gold); color: var(--gold); }
/* ── v2: Watch / Playback ─────────────────────────────────── */
.watch-btn { margin-top: .9rem; font-family: var(--fm); font-size: .72rem;
letter-spacing: .08em; padding: .45rem 1rem; background: var(--s2);
border: 1px solid var(--gold-b); border-radius: 3px; color: var(--gold-lt);
cursor: pointer; transition: background .15s, border-color .15s; }
.watch-btn:hover { background: var(--gold-glow); border-color: var(--gold); }
.pb-overlay { background: var(--s2); border: 1px solid var(--gold-b);
border-radius: var(--rl); padding: 1.4rem; margin-bottom: 1.5rem; }
.pb-header { display: flex; justify-content: space-between; align-items: baseline;
margin-bottom: 1rem; }
.pb-step-title { font-family: var(--fd); font-size: 1rem; color: var(--gold); }
.pb-close { background: none; border: none; color: var(--tx3); cursor: pointer;
font-size: 1rem; padding: .1rem .3rem; line-height: 1; }
.pb-close:hover { color: var(--tx); }
.pb-body { margin-bottom: 1.25rem; }
.pb-controls { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
padding-top: .9rem; border-top: 1px solid var(--s4); }
.pb-progress { font-family: var(--fm); font-size: .68rem; color: var(--tx3);
letter-spacing: .06em; margin-left: auto; }
.pb-btn { font-family: var(--fm); font-size: .72rem; letter-spacing: .07em;
padding: .4rem .9rem; background: var(--gold); border: none;
border-radius: 3px; color: #0a0a0f; cursor: pointer; }
.pb-btn:hover { background: var(--gold-lt); }
.pb-btn[disabled] { opacity: .4; cursor: not-allowed; }
.pb-btn--secondary { background: var(--s3); border: 1px solid var(--s5); color: var(--tx2); }
.pb-btn--secondary:hover { border-color: var(--gold); color: var(--gold); background: var(--s3); }
.pb-btn--ghost { background: none; border: 1px solid var(--s5); color: var(--tx3); }
.pb-btn--ghost:hover { border-color: var(--s5); color: var(--tx2); background: var(--s3); }
.pb-narration { font-family: var(--fb); font-size: .92rem; color: var(--tx2);
line-height: 1.75; margin: 0 0 .9rem; }
.pb-narration--final { color: var(--tx3); font-size: .85rem; }
.pb-card { background: var(--s3); border: 1px solid var(--s4); border-radius: var(--r);
padding: 1rem 1.1rem; margin-bottom: .9rem; }
.pb-metrics-row { display: flex; flex-wrap: wrap; gap: 1rem .5rem; margin-bottom: .7rem; }
.pb-metric { display: flex; flex-direction: column; gap: .2rem; }
.pb-metric-label { font-family: var(--fm); font-size: .6rem; letter-spacing: .1em;
text-transform: uppercase; color: var(--tx3); }
.pb-metric-value { font-family: var(--fm); font-size: .9rem; color: var(--tx); }
.pb-high { color: var(--green) !important; }
.pb-mid { color: var(--gold) !important; }
.pb-low { color: var(--red) !important; }
.pb-muted { color: var(--tx3); }
.pb-finding { font-family: var(--fb); font-size: .88rem; color: var(--tx2);
line-height: 1.6; margin: .5rem 0 0; }
.pb-note { font-family: var(--fb); font-size: .85rem; color: var(--tx3);
line-height: 1.55; margin: .4rem 0 0; }
.pb-note--warn { color: #d4956a; }
.pb-table { width: 100%; border-collapse: collapse; font-family: var(--fm);
font-size: .78rem; margin-top: .5rem; }
.pb-table caption { font-size: .65rem; color: var(--tx3); letter-spacing: .07em;
text-align: left; padding-bottom: .3rem; }
.pb-table th,
.pb-table td { padding: .38rem .25rem; text-align: left; border-bottom: 1px solid var(--s4); }
.pb-table th { color: var(--tx3); font-weight: normal; font-size: .62rem;
letter-spacing: .06em; text-transform: uppercase; }
.pb-table td { color: var(--tx2); }
.pb-suspect { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
padding: .45rem 0; border-bottom: 1px solid var(--s4); }
.pb-suspect:last-child { border-bottom: none; }
.pb-suspect-header { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.pb-link { color: var(--gold-dim); text-decoration: none; font-family: var(--fm);
font-size: .72rem; }
.pb-link:hover { color: var(--gold); }
.pb-bar { display: inline-block; height: .6em; background: var(--gold-b);
border-radius: 1px; vertical-align: middle; }
/* ── v2: Challenge Mode ────────────────────────────────────── */
.challenge-entry-wrap { margin: 1.25rem 0 0; }
.challenge-entry-btn { font-family: var(--fm); font-size: .72rem; letter-spacing: .1em;
text-transform: uppercase; padding: .5rem 1.1rem;
background: var(--gold-glow); border: 1px solid var(--gold-b);
border-radius: 3px; color: var(--gold-lt); cursor: pointer;
transition: background .15s, border-color .15s; }
.challenge-entry-btn:hover { background: rgba(212,183,101,.18); border-color: var(--gold); }
.challenge-mode-inner { padding: 1.5rem 1.75rem; background: var(--s2);
border: 1px solid var(--gold-b); border-radius: var(--rl);
margin-bottom: 2rem; }
.challenge-mode-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
margin-bottom: 1.5rem; }
.challenge-mode-heading { font-family: var(--fd); font-size: 1.2rem; color: var(--gold);
margin: 0; flex-grow: 1; }
.challenge-mode-progress { font-family: var(--fm); font-size: .75rem; color: var(--tx3);
letter-spacing: .06em; }
.challenge-mode-actions { display: flex; gap: .5rem; }
.challenge-tier { margin-bottom: 1.75rem; }
.challenge-tier-title { font-family: var(--fd); font-size: .95rem; margin: 0 0 .9rem; }
.challenge-tier-label--beginner { color: var(--green); }
.challenge-tier-label--intermediate { color: var(--gold); }
.challenge-tier-label--advanced { color: var(--red); }
.challenge-cards-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.challenge-card { font-family: var(--fb); font-size: .88rem; color: var(--tx2);
background: var(--s3); border: 1px solid var(--s5);
border-radius: var(--r); padding: .65rem 1rem;
cursor: pointer; text-align: left; transition: border-color .15s; }
.challenge-card:hover { border-color: var(--gold); color: var(--tx); }
.challenge-card--done { border-color: rgba(90,200,160,.4); }
.challenge-card-title { display: block; }
.challenge-card-done { font-size: .8rem; color: var(--green); margin-left: .35rem; }
.challenge-detail-header { display: flex; align-items: center; gap: .75rem;
flex-wrap: wrap; margin-bottom: 1rem; }
.challenge-detail-title { font-family: var(--fd); font-size: 1.3rem; color: var(--tx);
margin: 0 0 1rem; }
.challenge-setup { background: var(--s3); border-left: 3px solid var(--gold-b);
border-radius: 0 var(--r) var(--r) 0; padding: .9rem 1.1rem;
margin-bottom: 1.25rem; }
.challenge-setup p { font-family: var(--fb); font-size: .9rem; color: var(--tx2);
line-height: 1.7; margin: 0; }
.challenge-codebook { margin-bottom: 1.25rem; }
.challenge-codebook-title { font-family: var(--fb); font-size: .9rem; color: var(--tx);
margin: 0 0 .5rem; }
.challenge-ciphertext-wrap { margin-bottom: 1.25rem; }
.challenge-ciphertext { font-family: var(--fm); font-size: .9rem; color: var(--gold-lt);
background: var(--s3); border: 1px solid var(--s4);
border-radius: var(--r); padding: .9rem 1rem;
word-break: break-all; line-height: 1.8; margin-bottom: .65rem; }
.hint-strip { margin-bottom: 1rem; }
.hint-item { margin-bottom: .4rem; }
.hint-btn { font-family: var(--fm); font-size: .68rem; letter-spacing: .07em;
padding: .3rem .7rem; background: var(--s3); border: 1px solid var(--s5);
border-radius: 3px; color: var(--tx3); cursor: pointer; }
.hint-btn:hover { border-color: var(--gold); color: var(--gold-lt); }
.hint-text { font-family: var(--fb); font-size: .85rem; color: var(--tx2);
background: rgba(212,183,101,.06); border-left: 2px solid var(--gold-b);
padding: .5rem .75rem; margin: .3rem 0 0; line-height: 1.6; }
.challenge-level-badge { font-family: var(--fm); font-size: .65rem; letter-spacing: .1em;
text-transform: uppercase; padding: .2rem .5rem; border-radius: 3px; }
.challenge-level-badge--beginner { background: rgba(90,200,160,.1); color: var(--green); border: 1px solid rgba(90,200,160,.3); }
.challenge-level-badge--intermediate { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--gold-b); }
.challenge-level-badge--advanced { background: rgba(200,90,90,.08); color: var(--red); border: 1px solid rgba(200,90,90,.25); }
.challenge-solved-badge { font-family: var(--fm); font-size: .7rem; color: var(--green);
letter-spacing: .06em; }
.challenge-solve-btn { margin: .75rem 0; }
.challenge-solution { background: var(--s3); border: 1px solid rgba(90,200,160,.3);
border-radius: var(--r); padding: 1rem 1.1rem; margin: .75rem 0; }
.challenge-solution h4 { font-family: var(--fb); font-size: .9rem; color: var(--green);
margin: 0 0 .7rem; }
.challenge-solution p { font-family: var(--fb); font-size: .85rem; color: var(--tx2);
line-height: 1.65; margin: 0 0 .5rem; }
.challenge-learned { margin-top: 1.25rem; font-family: var(--fb); font-size: .82rem;
color: var(--tx3); line-height: 1.6;
border-top: 1px solid var(--s4); padding-top: .9rem; }
</style>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to main content</a>
<nav class="museum-nav" aria-label="Primary">
<div class="nav-inner">
<a href="index.html" class="nav-logo">
<svg class="nav-logo-icon" viewBox="0 0 32 32" fill="none">
<circle cx="16" cy="16" r="14" stroke="currentColor" stroke-width="1.5"/>
<circle cx="16" cy="16" r="8" stroke="currentColor" stroke-width="1"/>
<circle cx="16" cy="16" r="2" fill="currentColor"/>
</svg>
<span class="nav-logo-text">The Cipher Museum</span>
</a>
<ul class="nav-links">
<li><a href="index.html">Entrance</a></li>
<li><a href="museum-map.html">Explore</a></li>
<li><a href="learn.html">Learn</a></li>
<li><a href="challenges.html">Challenges</a></li>
<li><a href="lab/workbench.html">Lab</a></li>
</ul>
</div>
</nav>
<main id="main-content" tabindex="-1">
<div class="page-hero">
<div class="breadcrumb"><a href="index.html">Entrance</a><span>›</span><a href="lab/workbench.html">Lab</a><span>›</span>Cipher Detective</div>
<span class="page-eyebrow">Statistical Cryptanalysis</span>
<h1 class="page-title">Cipher Detective</h1>
<p class="page-desc">Paste unknown ciphertext and the Detective will walk you through the evidence — letter frequencies, Index of Coincidence, chi-square analysis, Kasiski examination — and show which cipher families best fit the data.</p>
</div>
<div class="section">
<div class="det-workspace content-wide">
<div style="margin-bottom:0;">
<label for="detective-input" class="det-input-label">Unknown Ciphertext</label>
<textarea id="detective-input" class="det-textarea" spellcheck="false"
placeholder="Paste ciphertext here to begin the investigation… e.g. WKHTXLFNEURZQIRAMXSVRYHU WKHODCBGRJ…"></textarea>
</div>
<div class="challenge-entry-wrap">
<button id="det-challenge-btn" class="challenge-entry-btn">🆕 Practice Mode — Solve a Curated Challenge</button>
</div>
<div id="det-challenge-mode" hidden></div>
<div id="det-empty" class="det-empty" aria-live="polite">
Awaiting input. The Detective analyses text as you type or paste.
</div>
<div id="det-results" hidden>
<div id="det-playback-area" hidden aria-live="polite"></div>
<div id="det-reality" class="det-labels-strip" aria-label="Analysis context" hidden></div>
<div id="det-short-warning" class="det-callout-warn" hidden role="alert">
<strong>Insufficient evidence.</strong> This text is too short for reliable
statistical analysis. The suspects below are best guesses, not confident
identifications. Paste a longer sample if available.
</div>
<div class="det-grid" style="margin-top:1.5rem;">
<div class="det-main">
<section class="det-section" aria-labelledby="det-evidence-heading">
<h2 id="det-evidence-heading" class="det-section-title">Evidence</h2>
<div id="det-freq-chart-wrap" class="det-chart-wrap"></div>
<p id="det-freq-interpretation" class="det-interp"></p>
</section>
<section class="det-section" aria-labelledby="det-suspects-heading">
<h2 id="det-suspects-heading" class="det-section-title">Suspects</h2>
<div id="det-suspects-list"></div>
</section>
<section class="det-section det-section--notes" aria-labelledby="det-notes-heading">
<h2 id="det-notes-heading" class="det-section-title">Case Notes</h2>
<div id="det-case-notes"></div>
</section>
<section class="det-section" aria-labelledby="det-attack-heading">
<h2 id="det-attack-heading" class="det-section-title">Recommended Next Attack</h2>
<div id="det-next-attack"></div>
<div id="det-watch-wrap" hidden></div>
<div id="det-attack-tools" hidden></div>
</section>
<section class="det-section" aria-labelledby="det-autosolve-heading">
<h2 id="det-autosolve-heading" class="det-section-title">
🔒 Auto-Solve (Advanced)
</h2>
<p class="det-autosolve-intro">
Run every applicable solver against this ciphertext and rank the results
by how English-like each candidate plaintext is. Works on Caesar, ROT13,
Atbash, Vigenère, monoalphabetic substitution and columnar
transposition. May take a few seconds for substitution.
</p>
<button id="det-autosolve-btn" class="autosolve-btn" type="button" disabled>
⚙️ Run Auto-Solve
</button>
<div id="det-autosolve-result" class="autosolve-result" aria-live="polite"></div>
</section>
</div>
<aside class="det-sidebar" aria-label="Cryptanalytic profile">
<div class="analysis-panel">
<h3 class="det-panel-title">Cryptanalytic Profile</h3>
<table class="stats-table" aria-label="Raw statistics">
<tbody>
<tr><th scope="row">Length</th> <td id="stat-length">—</td></tr>
<tr><th scope="row">Character set</th> <td id="stat-charset">—</td></tr>
<tr><th scope="row">IoC</th> <td id="stat-ioc">—</td></tr>
<tr><th scope="row">Base chi-square</th><td id="stat-chi">—</td></tr>
<tr><th scope="row">Best shift</th> <td id="stat-shift">—</td></tr>
<tr><th scope="row">Period hint</th> <td id="stat-period">—</td></tr>
</tbody>
</table>
<div class="det-panel-footer">
<a href="cryptanalysis.html" class="det-learn-link">Learn these metrics →</a>
</div>
</div>
</aside>
</div>
</div>
<div class="det-limitations" id="det-limitations">
<h3>What the Detective can’t tell you</h3>
<ul>
<li>Short ciphertext (under ~60 characters) makes statistical analysis unreliable.</li>
<li>Non-English plaintext breaks all English-based frequency analysis.</li>
<li>Modern ciphers (AES, ChaCha20) produce statistically random output; the Detective will report “random” but cannot identify <em>which</em> modern cipher.</li>
<li>Layered ciphers (VIC, Purple, multi-stage) defeat single-pass identification.</li>
<li>The Detective’s <em>Auto-Solve</em> can recover plaintext for Caesar, ROT13, Atbash, Vigenère, monoalphabetic substitution, and columnar transposition. For richer hand-tools and other ciphers, open the <a href="lab/workbench.html">Codebreaker’s Workbench</a>.</li>
</ul>
</div>
</div>
</div>
</main>
<footer></footer>
<script src="js/nav.js" defer></script>
<script src="js/detective/analyses.js"></script>
<script src="js/detective/scoring.js"></script>
<script src="js/detective/render.js"></script>
<script src="js/detective/attacks.js"></script>
<script src="js/detective/lang-model.js"></script>
<script src="js/detective/solvers.js"></script>
<script src="js/detective/playback.js"></script>
<script src="js/detective/challenges.js"></script>
<script src="js/detective/detective.js"></script>
</body>
</html>