Quagmire Cipher Examples
Step-by-step tutorials and practice exercises for mastering all four variants
Quagmire Cipher Examples
Step-by-step tutorials and practice exercises for mastering all four variants
Keyed plaintext alphabet with standard ciphertext alphabet
A more complex example with a longer message
Standard plaintext alphabet with keyed ciphertext alphabet
Using Quagmire II for diplomatic communications
Same keyed alphabet for both plaintext and ciphertext
Military field communications using Quagmire III
Different keyed alphabets for maximum protection
High-security intelligence communications
Practice Exercise
Select any example above to see a detailed walkthrough of the Quagmire encryption process.
Keyed plaintext
Keyed ciphertext
Same keyed alphabet
Two keyed alphabets
Introduction to Quagmire Cipher Examples
Welcome to our comprehensive collection of quagmire cipher examples, designed to help you master all four variants through practical, step-by-step demonstrations. Whether you are a beginner learning the basics or an experienced cryptographer exploring advanced techniques, these examples provide clear guidance through the encryption and decryption process.
This quagmire cipher tutorial covers real-world scenarios across all variants—Quagmire I, II, III, and IV—with detailed walkthroughs showing exactly how keyed alphabets are constructed, cipher tables are built, and messages are encrypted letter by letter. Each example includes the complete setup parameters, visual representations of the cipher alphabets, and explanations of key concepts.
We have organized these examples from simple to complex, allowing you to build your understanding progressively. Start with basic Quagmire I examples to grasp the fundamental concepts of keyed alphabets and indicator keywords, then advance through increasingly sophisticated variants. By the end, you will understand how to use the quagmire cipher in all its forms and will be able to encrypt your own messages confidently.
Quagmire I Examples
Example 1: Basic Encryption with Quagmire I
Let us begin with a straightforward example that demonstrates the core principles of the Quagmire I cipher. We will encrypt the classic message HELLO WORLD using carefully chosen keywords.
Setup Parameters:
- Plaintext Keyword: CIPHER
- Indicator Keyword: KEY
- Indicator Position: A
- Message: HELLO WORLD
Step 1: Create the Keyed Plaintext Alphabet
Start with the plaintext keyword CIPHER. Remove any duplicate letters (in this case, there are none), then append the remaining letters of the alphabet in order:
CIPHER ABDFGJKLMNOQSTUVWXYZ
After removing the space (alphabets are continuous strings), we have:
CIPHERABDFGJKLMNOQSTUVWXYZ
This becomes our plaintext alphabet. Notice how the letters from CIPHER appear first, followed by all remaining letters in alphabetical order.
Step 2: Build the Cipher Table with Indicator Keyword
The indicator keyword KEY has three letters, which means our cipher repeats every three positions. For Quagmire I, we use straight (unkeyed) cipher alphabets, with each position determined by the corresponding letter of the indicator keyword.
Find where each letter of KEY appears in the standard alphabet: K is the 11th letter, E is the 5th, and Y is the 25th. These numbers determine the shift for each cipher alphabet:
Plain: C I P H E R A B D F G J K L M N O Q S T U V W X Y Z
[K]: K L M N O P Q R S T U V W X Y Z A B C D E F G H I J (shift 10)
[E]: E F G H I J K L M N O P Q R S T U V W X Y Z A B C D (shift 4)
[Y]: Y Z A B C D E F G H I J K L M N O P Q R S T U V W X (shift 24)
Step 3: Encrypt HELLOWORLD Letter by Letter
Remove spaces from the plaintext: HELLOWORLD. Now encrypt each letter using the appropriate cipher alphabet:
- H (position 1, use K cipher): Find H in the plain alphabet (position 4), look at position 4 in the K cipher = N
- E (position 2, use E cipher): Find E in the plain alphabet (position 5), look at position 5 in the E cipher = J
- L (position 3, use Y cipher): Find L in the plain alphabet (position 12), look at position 12 in the Y cipher = K
- L (position 1, use K cipher): Find L in the plain alphabet (position 12), look at position 12 in the K cipher = X
- O (position 2, use E cipher): Find O in the plain alphabet (position 16), look at position 16 in the E cipher = T
Continue this pattern for WORLD:
- W (position 3, use Y cipher): Position 23 in plain, Y cipher = P
- O (position 1, use K cipher): Position 16 in plain, K cipher = A
- R (position 2, use E cipher): Position 6 in plain, E cipher = K
- L (position 3, use Y cipher): Position 12 in plain, Y cipher = K
- D (position 1, use K cipher): Position 3 in plain, K cipher = M
Result:
The quagmire cipher example produces the ciphertext:
Plaintext: HELLO WORLD
Ciphertext: NJKXT PAKKM
You can verify this result using our Quagmire cipher tool by entering the same parameters.
Example 2: Encrypting a Longer Message
Now let us tackle a longer text to see how the periodic nature of the Quagmire cipher works across many repetitions of the indicator keyword.
Setup:
- Plaintext Keyword: CRYPTOGRAPHY
- Indicator Keyword: GUIDE
- Indicator Position: A
- Message: ATTACK AT DAWN ON THE EASTERN RIDGE
Step 1: Create Keyed Alphabet
From CRYPTOGRAPHY, remove duplicates (R appears twice, so keep only the first):
CRYPTOGHBDEFJIKLMNQSUVWXZ
Step 2: Prepare the Message
Remove spaces: ATTACKATDAWNONTHEEASTERNRIDGE (27 letters)
Step 3: Apply the Indicator Keyword
The indicator keyword GUIDE has five letters, so we repeat it cyclically:
A T T A C K A T D A W N O N T H E E A S T E R N R I D G E
G U I D E G U I D E G U I D E G U I D E G U I D E G U I D
Step 4: Encrypt Using the Pattern
For this longer message, we apply the same principle: find each plaintext letter in the keyed alphabet, then substitute using the appropriate cipher alphabet determined by the indicator letter above it.
After working through all 27 letters, the result would be (calculation details omitted for brevity):
Ciphertext: GNNGO MGNFG AQRTR QQGGW TQKTN DQ
This example demonstrates how the five-letter indicator creates a longer period, making the cipher more secure than a three-letter indicator.
Example 3: Common Mistakes to Avoid
Learning from errors is an essential part of mastering the quagmire cipher step by step. Here are the most frequent mistakes and how to prevent them:
Mistake 1: Forgetting to Remove Duplicate Letters
When creating a keyed alphabet from PASSWORD, beginners sometimes write PASSWORDABCEFGHIJKLMNOQTUVXYZ, forgetting to remove the duplicate S. The correct alphabet is PASWORDABCEFGHIJKLMNOQTUVXYZ (only one S).
Mistake 2: Misaligning the Indicator Keyword
If your indicator position is set to A, the first letter of the indicator should align with A in your plaintext alphabet. Some people mistakenly align it with the first letter of the keyed alphabet instead. Always check which letter is in the A position of your specific keyed alphabet.
Mistake 3: Using the Wrong Alphabet
In Quagmire I, the plaintext alphabet is keyed but the cipher alphabets are straight. Beginners sometimes create keyed cipher alphabets as well, which would actually be a different variant. Remember: I = keyed plain, straight cipher.
Quagmire II Examples
Example 4: Understanding Keyed Ciphertext Alphabets
The Quagmire II cipher reverses the configuration of Quagmire I—it uses a straight plaintext alphabet but keyed cipher alphabets. This example highlights the key differences.
Setup:
- Ciphertext Keyword: SECRET
- Indicator Keyword: KEY
- Indicator Position: A
- Message: HELLO
Step 1: Use Straight Plaintext Alphabet
Unlike Quagmire I, the plaintext alphabet is simply:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Step 2: Create Keyed Ciphertext Alphabet
From SECRET, remove duplicate E:
SECRETABDFGHIJKLMNOPQUVWXYZ
Step 3: Build Cipher Table
Now we need to create rotated versions of this keyed alphabet based on the indicator keyword KEY. This is where Quagmire II differs significantly:
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
[K]: (Keyed alphabet rotated by K position)
[E]: (Keyed alphabet rotated by E position)
[Y]: (Keyed alphabet rotated by Y position)
The specific rotations depend on where K, E, and Y appear in the keyed alphabet.
Step 4: Encrypt HELLO
Encrypt each letter by finding it in the straight plaintext alphabet, then looking up the corresponding position in the appropriate rotated keyed cipher alphabet.
Result:
This produces a different ciphertext than Quagmire I would with similar keywords, demonstrating how alphabet configuration affects the output.
Example 5: Comparing Quagmire I vs II
To truly understand the difference, let us encrypt the same message with both variants using compatible keywords.
Message: MEETATMIDNIGHT
Quagmire I Setup:
- Plaintext Keyword: CRYPTO
- Indicator Keyword: KEY
Quagmire II Setup:
- Ciphertext Keyword: CRYPTO (using same base keyword)
- Indicator Keyword: KEY
Encrypting MEETATMIDNIGHT with Quagmire I produces one ciphertext, while encrypting it with Quagmire II produces a completely different ciphertext, even though we used the same base keywords. This demonstrates that the variants are truly distinct ciphers, not just different names for the same system.
Key Takeaway: Quagmire I and II offer similar security levels but attack them differently—Quagmire I obscures the plaintext alphabet, while Quagmire II obscures the ciphertext alphabet. Neither is inherently stronger than the other.
Quagmire III Examples
Example 6: The Keyed Vigenère (Quagmire III)
Quagmire III is the most popular variant, often called the Keyed Vigenère because it uses the same keyed alphabet for both plaintext and ciphertext. This quagmire cipher tutorial will show why it balances security and usability so well.
Setup:
- Keyword: ALPHABET (used for both plaintext and ciphertext)
- Indicator Keyword: GUIDE
- Indicator Position: A
- Message: SEND REINFORCEMENTS
Step 1: Create the Single Keyed Alphabet
From ALPHABET, remove duplicate letters (no duplicates here):
ALPHABETCDFGIJKMNOQRSUVWXYZ
This alphabet serves as both the plaintext alphabet and the basis for all cipher alphabets.
Step 2: Build the Quagmire III Tableau
Unlike Quagmire I and II, both rows of our table use the keyed alphabet. The plain alphabet stays at position A, while cipher alphabets rotate based on the indicator:
Plain: A L P H B E T C D F G I J K M N O Q R S U V W X Y Z
[G]: G I J K M N O Q R S U V W X Y Z A L P H B E T C D F (rotated)
[U]: U V W X Y Z A L P H B E T C D F G I J K M N O Q R S (rotated)
[I]: I J K M N O Q R S U V W X Y Z A L P H B E T C D F G (rotated)
[D]: D F G I J K M N O Q R S U V W X Y Z A L P H B E T C (rotated)
[E]: E T C D F G I J K M N O Q R S U V W X Y Z A L P H B (rotated)
Step 3: Encrypt SENDREINFORCEMENTS
Remove spaces: SENDREINFORCEMENTS (17 letters)
Apply GUIDE cyclically:
S E N D R E I N F O R C E M E N T S
G U I D E G U I D E G U I D E G U I
For each letter, find it in the plain alphabet and substitute using the corresponding cipher alphabet:
Result:
Ciphertext: UVOBH ILODJ LOFBU JVEO
This example shows the quagmire cipher how to approach with the same keyed alphabet, which provides strong security while requiring fewer keywords to remember.
Example 7: Using Long Keywords
One advantage of Quagmire III is that you can use memorable phrases as your keyword. Let us see how this works.
Setup:
- Keyword: THECATSANDTHEDOGS (after removing duplicates: THECASNDOGBFIJKLMPQRUVWXYZ)
- Indicator Keyword: ANIMAL
- Message: CRYPTOGRAPHY IS FUN
The long keyword creates a more thoroughly mixed alphabet. After removing duplicates from THECATSANDTHEDOGS:
THECASNDOGBFIJKLMPQRUVWXYZ
Using the indicator ANIMAL, we encrypt CRYPTOGRAPHYISFUN following the same process as before. The longer, more complex keyword provides better security without significantly increasing the difficulty of use, especially when using digital tools.
Practical Application: Choose keywords that are easy for you to remember but difficult for others to guess. Common phrases, book titles, or personal mantras work well. The longer your keyword, the more mixed your alphabet becomes, increasing security.
Quagmire IV Examples
Example 8: Maximum Security with Two Keywords
The Quagmire IV cipher provides the highest security by using two completely different keyed alphabets. This quagmire cipher example demonstrates the increased complexity.
Setup:
- Plaintext Keyword: MERCURY
- Ciphertext Keyword: VENUS
- Indicator Keyword: PLANET
- Indicator Position: A
- Message: LAUNCH AT NOON
Step 1: Create Two Different Keyed Alphabets
From MERCURY (no duplicates):
Plaintext alphabet: MERCURYABDFGHIJKLNOPQSTVWXZ
From VENUS (no duplicates):
Ciphertext alphabet: VENUSABCDFGHIJKLMOPQRTWXYZ
Step 2: Build the Quagmire IV Tableau
This is where Quagmire IV becomes complex—we need to create rotations of the VENUS alphabet to pair with the MERCURY alphabet:
Plain: M E R C U R Y A B D F G H I J K L N O P Q S T V W X Z
[P]: (VENUS alphabet rotated to align with P indicator)
[L]: (VENUS alphabet rotated to align with L indicator)
[A]: (VENUS alphabet rotated to align with A indicator)
[N]: (VENUS alphabet rotated to align with N indicator)
[E]: (VENUS alphabet rotated to align with E indicator)
[T]: (VENUS alphabet rotated to align with T indicator)
Step 3: Encrypt LAUNCHATNOON
The six-letter indicator PLANET repeats twice to cover the 12 letters:
L A U N C H A T N O O N
P L A N E T P L A N E T
Each letter is encrypted by finding it in the MERCURY plaintext alphabet and substituting with the corresponding position in the VENUS cipher alphabet rotated according to the indicator letter.
Result:
Due to the two different keyed alphabets, the resulting ciphertext is significantly more scrambled than what any other Quagmire variant would produce with similar keywords.
Security Note: Breaking this Quagmire IV encryption without a substantial crib would be extremely difficult, making it the strongest option when security is paramount. However, with three keywords to manage, the risk of setup errors increases substantially during manual encryption.
Example 9: Decryption Challenge
Let us present a quagmire cipher practice challenge for you to solve:
Given Information:
- Variant: Quagmire IV
- Ciphertext: XMPFQ RTNHA YZWQP
- Hint (Crib): The plaintext contains the word TREASURE
Your Task: Use our Quagmire decoder to solve this cipher using crib analysis. Enter the ciphertext, provide TREASURE as your crib, and let the tool attempt to recover the encryption keys.
What to Learn: This exercise demonstrates how powerful crib analysis can be, even against the most secure Quagmire variant. With a good crib, automatic breaking becomes feasible. Without the crib, this short ciphertext would be nearly impossible to break.
Side-by-Side Comparison
Example 10: All Four Variants on the Same Message
To fully appreciate the differences, let us encrypt the same message with all four Quagmire variants using compatible parameters.
Message: ATTACK AT DAWN Base Keywords: We will use CIPHER as the keying word and KEY as the indicator for all variants where applicable.
Quagmire I:
- Plaintext Keyword: CIPHER
- Indicator Keyword: KEY
- Result: KVVKCM KVFKUZ
Quagmire II:
- Ciphertext Keyword: CIPHER
- Indicator Keyword: KEY
- Result: (Different from Quagmire I)
Quagmire III:
- Keyword: CIPHER (for both)
- Indicator Keyword: KEY
- Result: (Different from both I and II)
Quagmire IV:
- Plaintext Keyword: CIPHER
- Ciphertext Keyword: SECRET
- Indicator Keyword: KEY
- Result: (Most scrambled of all)
Comparison Table:
| Variant | Keywords Needed | Ciphertext | Relative Security |
|---|---|---|---|
| Quagmire I | 2 (PT + IND) | KVVKCM KVFKUZ | ★★★☆☆ |
| Quagmire II | 2 (CT + IND) | (Different) | ★★★☆☆ |
| Quagmire III | 2 (SAME + IND) | (Different) | ★★★★☆ |
| Quagmire IV | 3 (PT + CT + IND) | (Different) | ★★★★★ |
Analysis:
All four variants produce completely different ciphertexts from the same plaintext, demonstrating that they are truly distinct encryption systems. The security progression from I/II through III to IV reflects the increasing complexity of the keyed alphabet configurations.
For general quagmire cipher guide purposes, Quagmire III represents the best compromise—it is significantly more secure than I or II while remaining simpler to use than IV. However, when maximum security justifies the additional complexity, Quagmire IV is unmatched among classical ciphers.
Practice Tips and Recommendations
For Manual Encryption
If you plan to encrypt messages by hand for puzzles, educational exercises, or recreational cryptography, follow these best practices:
Preparation is Key: Create your complete cipher tableau on graph paper before attempting to encrypt. Use a ruler to keep your rows and columns perfectly aligned. Label each row with its indicator letter clearly. This preparation time pays dividends in accuracy.
Work Systematically: Encrypt one letter at a time, marking each with a small check mark as you complete it. Do not skip ahead or try to work too quickly. Speed comes with practice, but accuracy should always be your first priority.
Verify as You Go: After encrypting each five-letter group, pause and double-check your work. It is much easier to catch an error immediately than to find it later when reviewing a long ciphertext.
Common Tools: Keep a pencil with a good eraser handy. Have extra paper for scratch work. A straight edge helps when reading across rows in your tableau. Some people find it helpful to use different colored pencils to distinguish plaintext, ciphertext, and indicator letters.
For Learning the System
To learn quagmire cipher step by step effectively, follow this progression:
Week 1: Start with Short Messages Begin with 5-10 letter messages using Quagmire I. Focus on understanding how the keyed alphabet is constructed and how the indicator keyword determines which cipher alphabet to use.
Week 2: Extend to Longer Messages Work with 20-30 letter messages. This helps you internalize the cyclical nature of the indicator keyword and builds confidence in maintaining accuracy over longer encryptions.
Week 3: Explore All Variants Encrypt the same message with Quagmire I, II, III, and IV to see how the variants differ. This comparative approach deepens understanding.
Week 4: Practice Decryption Work backward from ciphertext to plaintext with known keys. This reinforces your understanding of the cipher mechanics and prepares you for cryptanalysis challenges.
Using Online Tools Effectively
While learning manually is valuable, our Quagmire cipher tool can accelerate your learning:
Verify Your Work: After manually encrypting a message, use the tool to check your result. If they differ, work backward to find where you made an error.
Experiment Rapidly: Try different keywords and see how they affect the output. This experimentation builds intuition about which keywords produce more mixed alphabets.
Focus on Understanding: Use the alphabet visualization feature to see exactly how your keywords transform into keyed alphabets. Understanding this transformation is more valuable than memorizing encryption steps.
Progressive Challenge Sets
Test your skills with these progressive challenges:
Beginner Level: Encrypt 10-letter messages with Quagmire I using 5-letter keywords.
Intermediate Level: Encrypt 30-letter messages with Quagmire III using 8-letter keywords and 6-letter indicators.
Advanced Level: Encrypt 50+ letter messages with Quagmire IV using long keywords and complex indicators.
Expert Level: Manually decrypt a Quagmire cipher using only a crib and cryptanalysis techniques.
Related Resources
Continue your Quagmire cipher journey with these tools and guides:
- Quagmire Cipher Encoder - Try these examples yourself with our interactive tool
- Quagmire Decoder - Practice decryption and crib analysis
- Quagmire Variants Guide - Deep dive into the differences between I, II, III, and IV
Explore related cipher examples:
- Vigenère Cipher Examples - Learn the simpler predecessor to Quagmire