Search for a tool
Quagmire Cipher

A tool for understanding Quagmire I, II, III, and IV ciphers that use a keyword. All four versions are variants of the Vigenère cipher.

Results

Quagmire Cipher -

Tag(s) : Poly-Alphabetic Cipher

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Quagmire Cipher' tool for free! Thank you!

Quagmire Cipher

Quagmire can refer to 4 types of polyalphabetic ciphers (which are variants of the Vigenere cipher)

Quagmire I: the plaintext alphabet is mixed with a keyword, the ciphertext alphabet remains straight (A-Z).

Quagmire II: the plaintext alphabet is straight (A-Z), the ciphertext alphabet is mixed with a keyword.

Quagmire III: both alphabets are mixed with the same keyword.

Quagmire IV: both alphabets are mixed with two different keywords.

Answers to Questions (FAQ)

What is a Quagmire cipher? (Definition)

A Quagmire is a periodic polyalphabetic substitution cipher, a direct cousin of the Vigenere cipher, in which one or both substitution alphabets is a mixed alphabet built from a keyword.

What is the difference between the 4 Quagmires?

The only difference lies in the creation of the cipher table.

The table displays the plaintext alphabet (the letters of the plaintext message) in the column headers, and $ n $ rows representing the $ n $ alphabets (the letters of the ciphertext message).

Below are the various tables generated using the keyword CLE (with A as the indicator letter).

For a classic Vigenère cipher, the table is:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
(1)KLMNOPQRSTUVWXYZABCDEFGHIJ
(2)EFGHIJKLMNOPQRSTUVWXYZABCD
(3)YZABCDEFGHIJKLMNOPQRSTUVWX

Example: MESSAGE becomes WIQCEEO

For Quagmire, a mixed alphabet is used—in this case, based on the word WORD.

In Quagmire 1, it modifies the plain alphabet (at the top of the columns)

WORDABCEFGHIJKLMNPQSTUVXYZ
(1)GHIJKLMNOPQRSTUVWXYZABCDEF
(2)ABCDEFGHIJKLMNOPQRSTUVWXYZ
(3)UVWXYZABCDEFGHIJKLMNOPQRST

Example: MESSAGE becomes VHNZEDN

In Quagmire 2, he modifies the cipher alphabet (within the grid)

ABCDEFGHIJKLMNOPQRSTUVWXYZ
(1)KLMNPQSTUVXYZWORDABCEFGHIJ
(2)EFGHIJKLMNPQSTUVXYZWORDABC
(3)YZWORDABCEFGHIJKLMNPQSTUVX

Example: MESSAGE becomes ZINBEAP

In Quagmire 3, he modifies both alphabets simultaneously.

WORDABCEFGHIJKLMNPQSTUVXYZ
(1)GHIJKLMNPQSTUVXYZWORDABCEF
(2)DABCEFGHIJKLMNPQSTUVXYZWOR
(3)TUVXYZWORDABCEFGHIJKLMNPQS

Example: MESSAGE becomes YHKREDN

For Quagmire IV, the two alphabets are mixed using two distinct keywords; in this case, the second word is PASS.

WORDABCEFGHIJKLMNPQSTUVXYZ
(1)GHIJKLMNOQRTUVWXYZPASBCDEF
(2)SBCDEFGHIJKLMNOQRTUVWXYZPA
(3)UVWXYZPASBCDEFGHIJKLMNOQRT

Example: MESSAGE becomes XHLAEBN

How to encrypt with Quagmire?

The encryption mechanism is common to all four variants:

— create an encipherment tableau (from a plaintext alphabet and a ciphertext alphabet, straight or mixed depending on the variant);

— choose an indicator keyword whose length $ n $ sets the period;

— split the message into groups of $ n $ letters

— encipher the i-th letter of each group with the i-th substitution alphabet

Why the name Quagmire?

The English word quagmire means swamp, bog, mire

What are the differences between Quagmire I, II, III and IV?

The four variants differ only by the nature of the two alphabets; everything else (period, indicator, splitting) is identical.

— Quagmire I combines a mixed plaintext alphabet and a straight ciphertext alphabet (key type K1)

— Quagmire II reverses the layout: straight plaintext alphabet and mixed ciphertext alphabet (key type K2).

— Quagmire III uses the same mixed alphabet on both sides, for plaintext and ciphertext (key type K3)

— Quagmire IV, the most complex, uses two different mixed alphabets (key type K4) and requires two alphabet keywords.

This is the K1 to K4 classification of keyed alphabets by the ACA (American Cryptogram Association).

Source code

dCode retains ownership of the "Quagmire Cipher" source code. Any algorithm for the "Quagmire Cipher" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Quagmire Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Quagmire Cipher" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.

Cite dCode

The content of the page "Quagmire Cipher" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).

Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).

To cite dCode.fr on another website, use the link: https://www.dcode.fr/quagmire-cipher

In a scientific article or book, the recommended bibliographic citation is: Quagmire Cipher on dCode.fr [online website], retrieved on 2026-11-05, https://www.dcode.fr/quagmire-cipher

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Quagmire Cipher' tool for free! Thank you!


https://www.dcode.fr/quagmire-cipher
© 2026 dCode — The ultimate collection of tools for games, math, and puzzles.
▲  
Feedback