Quagmire I
Quagmire I
A keyed plain alphabet over a straight one, slid by an indicator word.
- Keyspace
- 26! × 26^indicatorLength
- Decode
- same options back
- Works on
- A-Z, the rest passes
- Family
- 14 in polyalphabetic
Options
Access
- Create
create("quagmire-1") - CLI
ciphers encode quagmire-1 'THE QUAG ONE' --key SPRINGFEVER --indicator FLOWER - Tryplayground with the sample above
- Kinvigenere, gronsfeld, beaufort, porta +9
Vigenère in a disguise. The ACA numbers its Quagmires the way it numbers keyed alphabets, so Quagmire I keys the plain side and leaves the cipher side straight. SPRINGFEVER turns the plain alphabet into SPRINGFEVABCD…. Then a second word, the indicator, runs down the column under plain A. Each of its letters sets one row of the tableau, and the text takes the rows in turn.
const quagmire = create("quagmire-1");
const keys = { key: "SPRINGFEVER", indicator: "FLOWER" };
quagmire.encode("The quag one", keys).text; // "Qpm gqrb uju"
quagmire.decode("QPMGQRBUJU", keys).text; // "THEQUAGONE"
That's the start of the ACA's example. FLOWER has six letters, so the rows come round every six.
What does the indicator do?
Look down the column under plain A. The first row has F there, then L, O, W, E and R. That's the whole trick. The cipher alphabet slides until the indicator letter sits under A, and every other letter follows.
Under A every time? Not quite. Some puzzles hang the indicator under another letter. indicatorUnder names that letter, A by default. Get it wrong and the text comes out as confident garbage, so check the puzzle's wording.
The rest of the text
Only ASCII letters move the indicator along. Spaces and punctuation pass through. Lowercase stays lowercase unless preserveCase is false, and stripNonAlpha drops everything outside A to Z first. The keywords ignore case and anything that isn't a letter. A missing one is a MissingOptionError, one without letters an InvalidOptionError.
Breaking one
It's periodic, so period finds the indicator's length. On the 319 letters that open A Tale of Two Cities, under a seven letter indicator, it put 7 first for each of the four Quagmires. Ignore the key it prints next to it though. That's a Vigenère guess, and here it means nothing.
recover doesn't know the Quagmires, so the rest is yours. Every column is one substitution, and all of them come from one keyed alphabet. Rebuild that alphabet once and the columns fall together. Fun, in a long evening kind of way.