Ciphers

Quagmire IV

Three keywords. One for the plain alphabet, one for the cipher alphabet and an indicator to slide one along the other.
IDquagmire-417 / 69classical · polyalphabetic
Cipher / Polyalphabetic

Quagmire IV

Three keywords: plain alphabet, cipher alphabet, indicator.

Keyspace
(26!)² × 26^indicatorLength
Decode
same options back
Works on
A-Z, the rest passes
Family
14 in polyalphabetic
required 3 / 4

Options

keystring
required
Keyword for the plain alphabet, the rest of A-Z after it
secondKeystring
required
Keyword for the cipher alphabet, the rest of A-Z after it
indicatorstring
required
Indicator keyword, written down the column under indicatorUnder: each letter sets the cipher row for one letter of the text, in turn
indicatorUnderstring
default A
The plain letter the indicator keyword stands under

Access

Createcreate("quagmire-4")
CLIciphers encode quagmire-4 'THIS ONE EMPLOYS THREE KEYWORDS' --key SENSORY --second-key PERCEPTION --indicator EXTRA --indicator-under S
Tryplayground with the sample above
Kinvigenere, gronsfeld, beaufort, porta +9

The full set. key keys the plain alphabet, secondKey the cipher one, and the indicator slides the second along the first. The ACA's example also hangs the indicator under plain S, so this is where indicatorUnder earns its keep.

ts
const quagmire = create("quagmire-4");
const keys = { key: "SENSORY", secondKey: "PERCEPTION", indicator: "EXTRA", indicatorUnder: "S" };
quagmire.encode("This one employs three keywords", keys).text;
// "Vbmr fcy ispmpbr rheic xrreigdx"

That's the ACA's Quagmire IV, VBMRF CYISP and on. Leave indicatorUnder out and the same call starts Kcfw ixq. Same keywords, other text. Did anything warn you? Nope.

Why is it the hard one?

Nothing lines up anymore. Quagmire I and II keep one side straight, III uses the same alphabet twice. Here both sides are scrambled, each its own way. The columns still repeat, so period still finds the indicator's length. After that you're rebuilding two alphabets at once. Bring tea.

Text, case and errors work as for Quagmire I. Only Quagmire IV takes secondKey, and it can't go without one.