Graph
Cipher Feedback Mode

🔄Cipher Feedback Mode

NEW

Also known as: CFB Mode

A block cipher mode that generates a self‐synchronizing keystream via feedback, enabling block ciphers to encrypt variable-length data like a stream cipher.

DESCRIPTION

Cipher Feedback (CFB) mode uses the block cipher encryption function and an IV to produce a keystream segment, which is XORed with plaintext; the resulting ciphertext feeds back for the next step. It can operate with segment sizes smaller than the block, enabling byte- or bit-sized streaming. CFB provides confidentiality but not integrity and does not require padding. It is self-synchronizing: loss of bits corrupts only a limited span before resynchronization. Correct IV selection and non-reuse are essential.

ALTERNATIVE DEFINITIONS

NIST SP 800-38A

The Cipher Feedback (CFB) mode is a confidentiality mode that uses the block cipher encryption function with feedback to process successive segments of plaintext.

Defines CFB formally as a confidentiality mode using feedback.

Source

Wikipedia

Cipher feedback (CFB) is a mode of operation for block ciphers that makes a block cipher into a self-synchronizing stream cipher.

Emphasizes self-synchronizing stream behavior.

Source

Symmetric Block Cipher Algorithms Rijndael CBC Mode Initialization Vector Stream Cipher Padding Self-synchronizing Stream NIST SP 800-38A

COMPETING TERMS

CTR Mode Output Feedback Mode

RELATIONS

KNOWLEDGE AREAS

Data Security Software Engineering Infrastructure

TARGET AUDIENCE

Security Architect Cybersecurity Engineer Software Developer DevOps Engineer

EXTERNAL SOURCES

  • Wikipedia - Block cipher mode of operation#Cipher feedback (CFB)
  • NIST - Official modes of operation, including CFB
  • OpenSSL - Usage of CFB with OpenSSL enc
  • Crypto++ - Developer documentation for CFB mode

TOP QUESTIONS

What is Cipher Feedback Mode and when should I use it?

CFB turns a block cipher into a self-synchronizing stream cipher for variable-length data without padding. Use when stream-like behavior and resynchronization are desired.

Category: Overview

How does CFB differ from OFB and CTR?

CFB is self-synchronizing and feeds back ciphertext; OFB/CTR precompute keystream independently and are not self-synchronizing.

Category: Comparison

Does CFB provide integrity or authenticity?

No. It only provides confidentiality and is malleable; combine with a MAC or use an AEAD mode for integrity.

Category: Risks

What IV requirements apply to CFB?

IVs must be unpredictable and non-repeating. Reuse under the same key can leak information and enable attacks.

Category: Best practices

Why is CFB self-synchronizing?

Feedback of ciphertext means bit errors affect only a limited window; after a few segments, correct synchronization resumes.

Category: Concepts

Is padding needed with CFB?

No. CFB processes partial segments and does not require padding for arbitrary-length plaintexts.

Category: Technical

What are common mistakes using CFB?

Reusing IVs, omitting integrity protection, and incorrect segment sizes can weaken security or interoperability.

Category: Mistakes

What modern alternatives often replace CFB?

AEAD modes like AES-GCM or stream ciphers like ChaCha20-Poly1305 provide authenticated encryption and better performance.

Category: Alternatives

How does CFB perform compared to CTR?

CFB generally underperforms CTR in parallelization since each step depends on prior ciphertext, limiting throughput.

Category: Performance