Module 2 ยท Cipher Types

Stream vs Block Ciphers

Understanding different cipher architectures โ€” Bit-by-bit vs block-by-block encryption

Scenario: You need to choose the right encryption method for different applications. A streaming video service needs real-time encryption, while a file storage system encrypts documents in batches. Understanding stream vs block ciphers will help you make the right architectural decisions.

๐Ÿ”„ Stream vs Block Cipher Architecture

๐ŸŽฏ Why This Matters โ€” The architectural difference between stream and block ciphers determines their performance, latency, and appropriate use cases. This demo shows concretely how each processes data so you can choose the right cipher type for your application.

Click on each cipher type to explore how they process data:

๐Ÿ“ก Stream Cipher
Encrypts data bit-by-bit or byte-by-byte in a continuous stream
Input: H E L L O
Key: K E Y K E
Output: ? ? ? ? ?
โœ“ Fast, low latency
โœ— Key reuse dangerous
VS
๐Ÿงฑ Block Cipher
Encrypts data in fixed-size blocks (typically 128 bits)
Block: [HELL] [O___]
Key: [128-bit key]
Output: [####] [####]
โœ“ Well-analyzed, secure modes
โœ— Padding required
Select a cipher type above to see detailed processing information

๐ŸŽฎ Interactive Cipher Playground

๐ŸŽฏ Why This Matters โ€” Seeing plaintext transform to ciphertext โ€” character by character vs block by block โ€” makes the abstract concept of encryption concrete. This hands-on comparison reveals why cipher choice matters for your application's latency and throughput requirements.

๐Ÿ“‹ Instructions

  1. Enter your message below. Use the prompt: "What is your favorite dish and restaurant?"
  2. Your message must be between 32 and 75 characters.
  3. Select Stream Cipher, enter a key, and click Encrypt โ€” observe how it processes character by character.
  4. Switch to Block Cipher and encrypt the same message โ€” observe how data is split into blocks.
  5. You must try both cipher types before your data is captured for submission.
๐Ÿ“ก Stream Cipher: not tried
๐Ÿงฑ Block Cipher: not tried

Prompt: What is your favorite dish and restaurant?

32โ€“75 characters required 0 / 75
Enter a message (32โ€“75 characters) and click "Encrypt" to see the encryption process...

โš™๏ธ Parameter Exploration

๐ŸŽฏ Why This Matters โ€” Cipher parameters (key size, mode of operation) dramatically change security properties. This demo shows how small configuration choices create massive security differences โ€” the wrong parameter selection can turn strong encryption into something easily broken.
๐Ÿ”ง Adjust cipher parameters and observe the effects:
Block Size (for block ciphers): 128 bits
Key Length: 128 bits
Password Length: 0 characters
Adjust the parameters above to see how they affect encryption performance and security...

๐Ÿ›ก๏ธ Security Considerations

๐ŸŽฏ Why This Matters โ€” Knowing what can fail is as important as knowing what works. These security considerations will reappear throughout the course as context for why authenticated encryption modes replaced simple encryption in modern protocols.
Stream vs Block Cipher Security Comparison
Aspect
Stream Ciphers
Block Ciphers
Key Reuse
Critical vulnerability
Safe with proper modes
Padding
Not required
Padding oracle attacks
Performance
Excellent for streaming
Good for bulk data
Error Propagation
Minimal
Can affect entire block
โš ๏ธ Common Vulnerabilities
Stream Ciphers:
โ€ข Key stream reuse (same key + IV = broken security)
โ€ข Weak random number generators
โ€ข Bit-flipping attacks if no authentication

Block Ciphers:
โ€ข ECB mode pattern leakage (identical blocks)
โ€ข Padding oracle attacks (CBC mode)
โ€ข Key schedule weaknesses

โ“ Which cipher type would be BEST for encrypting a live video stream where low latency is critical?

๐Ÿ’ญ Learning Reflection Submission

After experimenting with different cipher types and parameters, reflect on your discoveries:

Guided Questions:
  • How did changing the block size affect encryption behavior?
  • What did you notice about stream vs block cipher performance?
  • When would you choose one cipher type over the other?
  • What security trade-offs did you observe?
  • Key question: Block sizes are restricted to specific values โ€” 64, 128, 192, or 256 bits โ€” and key lengths are restricted to 128, 192, or 256 bits. Why are these constrained to powers of two, and how does increasing or decreasing these values affect both security and performance?

๐Ÿ”’ Complete all objectives (tracker bottom-right โ†˜) to unlock submission

Was there anything within the lab you expected to change, but didn't?

๐Ÿ’ก Why it matters

Understanding cipher architectures helps you choose the right tool for each job:

The choice between stream and block ciphers depends on your specific requirements: latency constraints, data patterns, security needs, and implementation complexity.

๐Ÿ“‹ 0/5 objectivesโ–ฒ
Lab Objectives

๐Ÿ” Welcome to Cryptography Labs!

Let's take a quick tour of how these labs work. By the end, you'll understand:

  • The objective system that unlocks submission
  • How to use interactive playgrounds
  • How to complete and submit your work

Ready? Let's go!

๐Ÿ“‹ Track Your Progress with Objectives

Every lab has multiple objectives you need to complete. Different labs have different objectives based on what you'll learn:

  • Answer the mini quiz correctly
  • Complete interactive activities
  • Try different scenarios
  • Gather insights and explore concepts
Look for the ๐Ÿ“‹ badge in the bottom-right corner โ†’

Your submission area is locked until all objectives are done. This ensures you learn before submitting!

๐ŸŽฎ Learn by Doing โ€” Interactive Playgrounds

Each lab has interactive sections where you can:

  • Choose options โ€” Select from encryption types, parameters, etc.
  • Adjust sliders โ€” Change key length, block size, sensitivity
  • See results instantly โ€” Outputs update as you experiment
  • Learn patterns โ€” Understand trade-offs between choices

Don't worry about "wrong" answers โ€” this is exploration! Try different combinations.

โ“ Test Your Understanding with the Quiz

Each lab has a multiple-choice question to test what you've learned.

๐Ÿ’ก Answers are randomized every time you reload โ€” no guessing!
  • Read each option carefully
  • Think about what you observed in the playground
  • Click wrong answers after solving to see why they're incorrect

Getting it wrong is fine! You can try again, and explore all options.

๐Ÿ“ Share Your Learning in the Reflection

Once all objectives are complete, the submission area unlocks.

๐Ÿ“Œ Required: Learning Reflection

Share what you learned in your own words. How would you explain this to a friend? Why does it matter?

๐Ÿ” Optional: Lab Observations

Any interesting findings? Edge cases you discovered? Patterns you noticed?

Tip: Write thoughtfully โ€” this reflection proves you understand the concept, not just completed activities.

๐Ÿ“„ Export Your Work & Exit

When you're ready to finish:

  • Click "Export PDF" โ€” Saves a summary of your work (quiz result, interactions, reflection)
  • See the success banner โ€” Green notification appears at the bottom
  • Click "โœ• Exit Lab" in the top bar to close when done
You can always return to previous labs โ€” all your work is saved in the browser

One more thing: you can only navigate backward through labs. This ensures you don't skip ahead! ๐Ÿ”’

Step 1 of 6