Summary
The Classical category currently has Playfair as its only digraph substitution cipher. Four-Square (Delastelle) is a related but distinct construction (uses 4 separate 5x5 grids instead of 1) that pairs naturally with the existing Playfair implementation and reuses much of its grid-construction logic pattern.
What's missing
- No
lib/cipher/four-square.ts
- No visualizer entry, worker routing, or tests
Proposed implementation
- Build two keyed 5x5 grids (top-right and bottom-left) plus two standard A-Z (I/J merged) grids (top-left plaintext grid, bottom-right ciphertext grid), following the same bigram-preparation rules as Playfair (pad odd length, uppercase, strip non-alpha)
- Digraph substitution: for plaintext pair (a,b), find a in top-left grid, b in bottom-right grid, take the row/column intersection rule across the 4-grid layout
- Steps: grid construction (4 matrices) + per-bigram substitution, reusing the
matrix/highlight step schema Playfair already uses
- Security status:
legacy
- Test vectors: use the standard published Four-Square worked example
Acceptance criteria
Assignment
I'd like to work on this issue under ECSoC26. Will open a PR only after approval/assignment by @csxark or another maintainer.
Summary
The Classical category currently has Playfair as its only digraph substitution cipher. Four-Square (Delastelle) is a related but distinct construction (uses 4 separate 5x5 grids instead of 1) that pairs naturally with the existing Playfair implementation and reuses much of its grid-construction logic pattern.
What's missing
lib/cipher/four-square.tsProposed implementation
matrix/highlightstep schema Playfair already useslegacyAcceptance criteria
Assignment
I'd like to work on this issue under ECSoC26. Will open a PR only after approval/assignment by @csxark or another maintainer.