Search for a tool
Quagmire 2 Cipher

Tool to encrypt and decrypt messages using the Quagmire II cipher, a polyalphabetic substitution cipher based on a standard plaintext alphabet and a keyed cipher alphabet.

Results

Quagmire 2 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 2 Cipher' tool for free! Thank you!

Quagmire 2 Cipher

Quagmire II Decoder

 


Loading...
(if this message do not disappear, try to refresh this page)


 

Quagmire II Encoder

 


Loading...
(if this message do not disappear, try to refresh this page)


 

Answers to Questions (FAQ)

What is the Quagmire II cipher? (Definition)

Quagmire II is a periodic polyalphabetic substitution cipher, related to the Vigenère cipher.

It relies on two keywords:

— The first is used to build a mixed ciphertext alphabet.

— The second determines the successive shifts of the cipher alphabets and sets the repetition period.

Quagmire II belongs to the Quagmire cipher family and corresponds to plan K2.

How to encrypt a message with Quagmire 2?

Two methods can be used to encrypt a message.

Mathematical method: by numbering letters from A to Z from $ 0 $ to $ 25 $, encryption is expressed as $$ C = (L + A - K) \bmod 26 $$

— $ L $ is the rank of the plaintext letter in the standard alphabet (unmixed)

— $ K $ is the rank of the letter of the second keyword in the standard alphabet (unmixed)

— $ A $ is the rank of the anchor letter in the mixed ciphertext alphabet

— $ C $ is the rank of the encrypted letter in the mixed ciphertext alphabet

Visual method with a table:

Build the encryption table from the two keywords and the anchor letter.

Split the plaintext into blocks of $ N $ letters, where $ N $ is the length of the second keyword.

For each plaintext letter, locate its position in the standard alphabet, then read the encrypted letter in the row corresponding to the letter of the second keyword.

Example: Encrypt DCODE with keyword 1 (alphabet) SECRET, keyword 2 (period) CODE (4 letters). The first plaintext letter D corresponds to encrypted letter A on row 1, the 2nd letter C encrypts to Q on row 2, etc. The encrypted message is AQVTB

How to build the encryption table?

— Build the mixed ciphertext alphabet by writing the first keyword without its repeated letters, then adding the remaining letters of the natural alphabet in their usual order.

Example: SECRET becomes SECRT from which the scrambled alphabet SECRTABDFGHIJKLMNOPQUVWXYZ is derived

— Choose an anchor letter, usually A by convention. This letter belongs to the mixed ciphertext alphabet and indicates the reference letter to align.

— Choose a second keyword and build the rows of the table so that each row contains the mixed ciphertext alphabet shifted so that the anchor letter appears in the column corresponding to the letter of the second keyword associated with that row.

Example: The keyword is CODE, the anchor letter is A, the Quagmire II table is:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
(1)CRTABDFGHIJKLMNOPQUVWXYZSE
(2)OPQUVWXYZSECRTABDFGHIJKLMN
(3)DFGHIJKLMNOPQUVWXYZSECRTAB
(4)ECRTABDFGHIJKLMNOPQUVWXYZS

How to decrypt a Quagmire 2 message?

Decryption is the reverse operation of encryption. It requires knowing the first keyword, the second keyword and the anchor letter in order to reconstruct the table.

Split the ciphertext into blocks of $ N $ letters, where $ N $ is the length of the second keyword.

For each encrypted letter, locate that letter in the row corresponding to the current position of the second keyword, then read the plaintext letter at the top of the column (standard alphabet).

Example: The ciphertext PIDDLZYA decrypts to 'QUAGMIRE' (with the same alphabet and keyword used previously)

How does Quagmire II differ from the classic Vigenère?

In the classic Vigenère cipher, the plaintext and the cipher alphabets use the natural alphabet from A to Z. Each cipher alphabet corresponds to a rotation of this alphabet.

In Quagmire II, the alphabet used to locate plaintext letters is the standard alphabet, while the cipher alphabet is mixed using the first keyword and the rows are rotations of this mixed alphabet.

Decryption therefore requires recovering the mixed cipher alphabet, the second keyword and the anchor letter.

How to recognize a Quagmire II cryptogram?

The markers are identical to the Vigenère cipher.

Source code

dCode retains ownership of the "Quagmire 2 Cipher" source code. Any algorithm for the "Quagmire 2 Cipher" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Quagmire 2 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 2 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 2 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-2-cipher

In a scientific article or book, the recommended bibliographic citation is: Quagmire 2 Cipher on dCode.fr [online website], retrieved on 2026-11-05, https://www.dcode.fr/quagmire-2-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 2 Cipher' tool for free! Thank you!


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