Block mode family

AES-CFB

Cipher Feedback mode: turns AES into a self-synchronising stream cipher

standard 6 variants NIST SP 800-38A

Overview

CFB (Cipher Feedback) is a block cipher mode defined in NIST SP 800-38A that turns a block cipher into a self-synchronising stream cipher. It encrypts data in segments smaller than or equal to the block size without padding.

In CFB the previous ciphertext segment, held in a shift register initialised with the IV, is encrypted with AES and the leftmost s bits of the output are XORed with the next s bits of plaintext to produce ciphertext. That ciphertext is shifted into the register. In CFB-128 the full block is used; in CFB-8 only one byte is processed per AES call, which is slower but resynchronises after a lost byte.

NextSSL includes AES-128, AES-192 and AES-256 in both CFB-128 and CFB-8 variants. CFB is used in OpenPGP's message encryption and some legacy protocols. CFB decryption can be parallelised, but encryption cannot, because each segment depends on the previous ciphertext. The mode needs only the AES encryption direction. Segment size must match on both ends.

History

1980–2001
  1. ECB, CBC, CFB and OFB defined for DES in FIPS 81

  2. Carried over to AES in NIST SP 800-38A

Security notes

CFB provides no integrity, so ciphertext can be modified to cause predictable changes in plaintext. It requires a unique, unpredictable IV. CFB-8 with an all-zero IV was the root of the Zerologon vulnerability in Netlogon. Prefer an AEAD mode for new designs.

Typical uses

OpenPGP encryptionLegacy serial or byte-stream protocols

Variants in NextSSL

6
AlgorithmTierSizes (bytes)StandardsAPI
AES-128-CFB
aes-128-cfb
standard FIPS key 16 · nonce 16 · block 16 NIST SP 800-38A safe
AES-128-CFB8
aes-128-cfb8
standard FIPS key 16 · nonce 16 · block 16 NIST SP 800-38A safe
AES-192-CFB
aes-192-cfb
standard FIPS key 24 · nonce 16 · block 16 NIST SP 800-38A safe
AES-192-CFB8
aes-192-cfb8
standard FIPS key 24 · nonce 16 · block 16 NIST SP 800-38A safe
AES-256-CFB
aes-256-cfb
standard FIPS key 32 · nonce 16 · block 16 NIST SP 800-38A safe
AES-256-CFB8
aes-256-cfb8
standard FIPS key 32 · nonce 16 · block 16 NIST SP 800-38A safe

Frequently asked questions

Which AES-CFB variants does NextSSL include?

NextSSL registers 6 AES-CFB variants: aes-128-cfb, aes-128-cfb8, aes-192-cfb, aes-192-cfb8, aes-256-cfb, aes-256-cfb8.