---
title: "Quagmire IV"
description: "Three keywords. One for the plain alphabet, one for the cipher alphabet and an indicator to slide one along the other."
canonical_url: "https://ciphers.agntn.dev/ciphers/quagmire-4"
---
# Quagmire IV

> Three keywords. One for the plain alphabet, one for the cipher alphabet and an indicator to slide one along the other.

<cipher-facts name="quagmire-4">



</cipher-facts>

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](https://www.cryptogram.org/downloads/aca.info/ciphers/QuagmireIV.pdf), `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`](https://ciphers.agntn.dev/guide/analysis) 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](https://ciphers.agntn.dev/ciphers/quagmire-1#the-rest-of-the-text). Only Quagmire IV takes `secondKey`, and it can't go without one.


## Sitemap

See the full [sitemap](https://ciphers.agntn.dev/sitemap.md) for all pages.
