neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
불가능 차분과 부메랑 공격을 동일한 장난감 SPN 암호에 적용, 페이지의 S-box로 계산한 부메랑 연결표 사용
Impossible differentials and the boomerang attack run against the same toy SPN cipher as Biham Lens and Matsui Line, with the Boomerang Connectivity Table computed from the S-box in the page.
개발 도구TypeScript · CSSGitHub @systemslibrarian온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Browser-based demo of impossible differentials and the boomerang attack on the same toy SPN as Biham Lens — DDT and BCT tables computed live, an adaptive chosen-ciphertext oracle, and a one-way-impossible crossing that every round trip closes.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Impossible differentials · Boomerang (Wagner 1999) · BCT (Cid et al. 2018)
When no single differential survives enough rounds, split the cipher in half and
chain two short ones — or use a difference that can never happen.README 전문 보기 ↗Impossible differentials · Boomerang (Wagner 1999) · BCT (Cid et al. 2018)
When no single differential survives enough rounds, split the cipher in half and chain two short ones — or use a difference that can never happen.
A browser lab for the two second-generation differential techniques, run against
the same toy SPN cipher as Biham Lens
and Matsui Line — 8-bit
block, 16-bit key, four rounds of key-mix / 4-bit substitution / bit permutation.
The cipher is reimplemented here and checked exhaustively against the sibling
lab's own function — the S-box, permutation and key-schedule constants are
copied, and the tests transcribe biham-lens's encrypt longhand and compare
every plaintext against it. "Byte for byte" is the result, not the method, and
the difference matters: the agreement is a test, not a claim (see
Build & Verify).
Three primitives, all hand-rolled so the internals are inspectable:
src/crypto/spn.ts. The S-box and bit permutation of
crypto-lab-biham-lens, its rotate-left-4 key schedule, and its round
structure. The round count runs to six, past the published four, because on
this cipher the interesting decay happens after round four.DDT[a][b] counts the inputs that turn input difference a into output
difference b through one S-box. A zero entry is the statement the impossible
differential is built on.BCT[a][b] counts the inputs for which the boomerang's
round trip through one S-box — in with difference a, shifted by b, back
out — returns a. Both tables are computed from the S-box in the page.Security model. Act 3 is a chosen-plaintext attack. Acts 4 and 5 need chosen plaintexts and an adaptive chosen-ciphertext oracle: the second pair of ciphertexts is chosen only after the first pair comes back. That is a strong assumption, stated on screen before the boomerang runs, and it is why rectangle attacks — which drop the decryption half — exist.
Not production cryptography. An 8-bit block holds 256 plaintexts and a 16-bit key 65 536 keys. This cipher is a teaching target built to be broken in front of you. Nothing here is a statement about a cipher anyone deploys.
An impossible differential proves a difference can never cross three rounds. The boomerang's switch has a crossing whose one-way table entry is zero — it can never happen in one direction, for any key — and the round trip through that same crossing closes for all 256 middle states. Impossibility in one direction does not bound a quartet, and the page measures both halves of that sentence rather than asserting either.
The page opens on the result: a live teaser showing the two table entries side by
side — 0/16 one way, 16/16 on the round trip — with one action that lands you
in Act 5 with the quartet already stepping. A chapter navigator follows, then the
acts in order.
p²q², against the BCT-corrected estimate,
and against the same procedure run on real random permutations — the null a
distinguisher has to beat. Intervals are a cluster bootstrap over keys, with
the narrower pooled interval shown beside them so the cost of assuming
independence is visible. Degenerate quartets are excluded and counted, the
per-key spread is drawn as a distribution, and a decomposition reports what
share of the returns followed the stated trail.p, and the estimate move with it.Plus a permanent honesty panel, outside every disclosure.
The build brief proposed #F472B6. This lab ships #9f88ff instead, because the
catalog's CLAUDE.md fixes a four-colour accent rotation and requires
neighbouring cards to differ: Biham Lens and Matsui Line both use #ff6b7f, and
#F472B6 reads as the same colour beside them. Violet is on-palette and distinct
from all three of this lab's nearest neighbours in the cryptanalysis section.
Use it to teach why security against one attack is not security; to show the gap between a trail and a differential; to introduce impossible differentials without hand-waving the impossibility; and to make the BCT concrete for someone who has read the definition and not felt it.
Do NOT use this cipher, or this code, for anything. An 8-bit block is not
encryption. Do not lift src/crypto/spn.ts into a project, do not treat the
sieve as a template for a real attack, and do not read any timing here as
constant-time — nothing in this lab attempts it.
https://systemslibrarian.github.io/crypto-lab-return-path/
You can: change the substitution table and watch every measurement rerun; type your own differences and try to make an impossible one happen; set the round count in Acts 2 and 3; raise any run to the whole 65 536-key space; move the boomerang's split point and watch p, q and the estimate move with it; step a real quartet through the switch one stage at a time; pick a switch that can never close and see the page refuse to show a quartet; weaken the sieve until it runs out of data; and copy a link that reproduces any run exactly.
Every run prints its elapsed time and whether a Worker or the main-thread fallback produced it.
The failure modes this page is built around, each reachable in the UI and each wired to a test:
p²q² is an estimate, and it misses twice here. Once at the switch, where a
trail reading charges for a crossing the round trip need not pay. Once across
the two backward pairs, which the estimate multiplies as if independent and
which on this cipher are not. The second is a property of this toy, measured
and reported, not a general law.BCT ≥ DDT pointwise,
proven entry by entry in the tests. So Murphy's incompatibility, in the form
where the real rate falls far below the estimate, needs a middle section
wider than one substitution layer — which this page does not model and does not
claim to.1/255 to 1/253, which the
page uses and the tests derive by enumerating every permutation of a smaller
block.Round counts are from the primary papers. Data and time complexities are deliberately not quoted anywhere in this lab — they were not verified against the primary sources while it was written, and a confidently wrong exponent is worse than no exponent.
p²q² can be badly wrong. Cid, Huang, Peyrin,
Sasaki and Song answered it with the BCT (EUROCRYPT 2018) — exact accounting for
a one-layer switch, which is what Act 5 measures. The problem is Murphy's; the
tool is Cid et al.'s.Knudsen's DEAL report (1998) is an early, independent use of impossible-differential reasoning. It is not the first: Biham had already used related impossible-event reasoning on Ladder-DES, and zero DDT entries were long known. Follow the history in Biham–Biryukov–Shamir 1999.
git clone https://github.com/systemslibrarian/crypto-lab-return-path.git
cd crypto-lab-return-path
npm install
npm run dev # http://localhost:5173/crypto-lab-return-path/
npm test # 155 unit tests (Vitest)
npm run build # tsc --noEmit && vite build
npx playwright install chromium
npm run test:a11y # the axe WCAG 2.1 A/AA gate
npm run test:claims # 50 claims tests + 7 entry-experience gates
npx playwright install chromium — never --with-deps. That apt step wedged 547
runs across this fleet, and the GitHub runner image already carries the libraries
Chromium needs.
This is the third lab on one cipher, and the three are meant to be read in order.
155 unit tests (Vitest), all passing. The checks that matter most:
| What | Where |
|---|---|
The cipher agrees with crypto-lab-biham-lens on every plaintext — 1 024 keys with the textbook S-box, 256 with PRESENT — against a longhand transcription of that lab's own function | src/crypto/spn.test.ts |
| 16 pinned known-answer vectors, and the reference agreeing with all 16 | src/crypto/spn.test.ts |
| The round-key extension leaves rounds 0–4 untouched, for all 65 536 master keys | src/crypto/spn.test.ts |
Only K_R is needed to sieve — checked against all 256 values of K_{R-1} | src/crypto/spn.test.ts |
DDT and BCT recomputed by independent brute force, and the three BCT identities (first row and column = 2ⁿ, BCT ≥ DDT pointwise, entries even) | src/crypto/tables.test.ts |
| Reachability matches exhaustive enumeration over all 65 536 keys, in both directions — nothing achieved that was called impossible, and nothing called reachable that never occurs | src/crypto/trails.test.ts |
| The 3-round impossible differential rules out exactly the 30 single-active-nibble differences, with zero occurrences in 8 388 608 pairs | src/crypto/trails.test.ts, experiments.test.ts |
| There is no 4-round impossible differential, for any input difference, either S-box | src/crypto/trails.test.ts |
| Invariant I5: the sieve never eliminates the true subkey — 400 keys, fixed and random seeds | src/crypto/experiments.test.ts |
| The switch measured over all 256 middle states equals the BCT for all 65 025 (β, γ) pairs | src/crypto/experiments.test.ts |
The boomerang beats a real random-permutation null with non-overlapping intervals, and p²q² overstates the measurement | src/crypto/experiments.test.ts |
The random-permutation null is 1/(N−3), not 1/(N−1) — derived by enumerating all 24 and all 40 320 permutations of a 4- and an 8-element block under the same exclusion rule | src/crypto/experiments.test.ts |
The WCAG 2.1 A/AA gate (e2e/a11y.spec.ts) drives the lab through every
state it teaches — all eight quartet steps, all four switch cases, every refusal
path, both S-boxes, every disclosure — and scans each at 1280px and 380px. It
asserts axe's violations and its incomplete bucket, computes contrast
arithmetically over composited surfaces, measures non-text contrast and generated
content against a ratcheted baseline (which is empty), and checks reflow,
scroller keyboard reach and focus visibility. Zero violations; the deploy is
blocked if that changes.
The claims suite (e2e/claims.spec.ts, 43 tests) checks the page tells the
truth: the DDT, the BCT, the switch rate and the miss-in-the-middle diagram's
forward set are all re-derived in the test from the S-box the page itself prints;
every failure path names its actual cause; a changed input retires its verdict
while re-entering the same value does not; and the negative claim's fixture is
reached through the UI, shown to be green in every check, and asserted to carry
its limitation on screen, outside every disclosure.
The entry gate (e2e/entry.spec.ts, 7 tests) enforces the things that make
the page enterable rather than merely correct: a real interaction inside the
first desktop viewport, the headline paradox complete within two phone screens,
both of its numbers on screen and matching the page's own S-box, the teaser's one
action landing on a stepped quartet, and a ratcheted ceiling on arrival-state
copy — 2 200 words, down from 3 181 before the reduction pass. The ceiling may
be lowered, never raised.
Everything runs in a Web Worker, with a main-thread fallback so a Worker that fails to load leaves a slow page rather than an empty one. Every panel shows its elapsed time and which path produced it. On this machine: the arrival state settles in well under a second; the full 65 536-key exhaustive run in Act 2 takes about 3.5 seconds; Act 5's switch measurement is 256 operations and is instant.
Every run prints its sample size, and every measured rate carries a confidence interval computed by resampling keys — the independent unit — rather than quartets. Rapid changes cannot show one input's label beside another's evidence: each panel issues a monotonic request ticket and drops any response that is no longer the newest, including for the purpose of clearing its busy state.
One of the browser demos in the Crypto Lab suite.
"So whether you eat or drink or whatever you do, do it all for the glory of God." — 1 Corinthians 10:31
q| Intervals resample keys, not quartets: the cluster bootstrap is wider than the pooled Wilson interval, and the distinguisher survives the correction at the shipped default |
src/crypto/experiments.test.ts |
bestTrail and bestDifferential each maximise what their name says, against an exhaustive sweep of all 65 025 endpoint pairs — and disagree from four rounds on | src/crypto/trails.test.ts |
| Latest-request-wins: out-of-order and twenty-deep responses authorise exactly one render, the newest, and a stale answer cannot clear the busy state | src/ui/latest.test.ts |