Cipher Feedback Mode

Explore the elegant world of CFB encryption with interactive demonstrations

What is CFB Mode?

Cipher Feedback (CFB) mode is a sophisticated block cipher mode of operation that transforms a block cipher into a stream cipher. It generates keystream blocks by encrypting the previous ciphertext block, making it particularly useful for encrypting data streams of arbitrary length.

How CFB Works

IV
Initialization Vector
→
Block Cipher
→
Keystream
⊕
P₁
Plaintext
→
C₁
Ciphertext
C₁
Previous Ciphertext
→
Block Cipher
→
Keystream
⊕
P₂
Plaintext
→
C₂
Ciphertext

Interactive CFB Demo

Click "Encrypt with CFB" to see the encryption process...
🔄

Stream Cipher Behavior

Converts block ciphers into stream ciphers, allowing encryption of data streams of any length without padding.

🔗

Chaining Mechanism

Each ciphertext block depends on all previous plaintext blocks, creating a chain of dependencies.

⚡

Self-Synchronizing

Automatically recovers from transmission errors after processing a few blocks, making it robust for communication.

🛡️

Error Propagation

Limited error propagation - a single bit error affects only the current and next block, then self-corrects.

Advantages & Disadvantages

✅ Advantages

  • No padding required for arbitrary-length data
  • Self-synchronizing after errors
  • Suitable for real-time applications
  • Limited error propagation
  • Can process incomplete blocks

❌ Disadvantages

  • Sequential processing (not parallelizable)
  • Slower than ECB and CBC modes
  • Vulnerable to bit-flipping attacks
  • IV must be unique for each encryption
  • More complex implementation

Real-World Applications

📡

Network Communications

Ideal for encrypting data streams in network protocols where data arrives continuously.

🎥

Media Streaming

Perfect for encrypting audio and video streams where real-time processing is crucial.

💾

File Encryption

Suitable for encrypting files of unknown or variable length without padding overhead.