feat(ciphers): add Josse - #5
Merged
Merged
Conversation
0xdiid
force-pushed
the
feat/josse-cipher-clean
branch
from
July 30, 2026 14:04
f346fad to
fb6b407
Compare
…abet
Josse (Maj. H. D. Josse, French Army, ~1889) is absent from the ACA registry and
from every hobbyist tool surveyed, so it was a genuine gap. Spec recovered by
Géraud-Stewart & Naccache (Cryptologia 45(4), 2021); broken ciphertext-only from
~75 letters by Lasry (Cryptologia 47(1), 2023).
C_1 = let(-num(P_1)); C_i = let(num(P_i) + num(C_{i-1}))
with num()/let() the position map of a keyword-derived mixed alphabet (written
row-wise into a table, read back column-wise). Decryption is a first difference.
Adds:
* encode/decode for the 26-letter generalisation (default) and the historical
25-letter form (drop="W")
* keyless two-stage crack: at the correct numbering the difference sequence
D_i = num(C_i) - num(C_{i-1}) IS a monoalphabetic image of the plaintext, so
stage 2 reduces to a simple-substitution solve
* Josse.digraph_ioc — a mono-invariant statistic that identifies a candidate
numbering (~150-letter sample: true 4.12 vs random 1.08 +- 0.23, z +13.3)
* full spec and computationally verified test vectors in docs/cipher-specs.json
* 6 tests, including the mono-invariance the attack depends on
Measured caveat, recorded in the module and the spec: free 26!-alphabet search is
overfit-undecidable at short lengths. Maximising unigram IoC overfits (a wrong
numbering reaches 2.32 vs a true 1.89); sorted-profile matching is too coarse; and
even digraph IoC — an excellent TEST — is beaten by free search (9.42 vs 4.12).
The practical attack sweeps the KEYWORD space, which is dictionary-sized rather
than 26!, and recovers planted keys exactly.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrpA9d1jGn7fzbB1aV61JK
0xdiid
force-pushed
the
feat/josse-cipher-clean
branch
from
July 30, 2026 14:05
fb6b407 to
fdbadd1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.