AES-CFB
Cipher Feedback mode: turns AES into a self-synchronising stream cipher
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–2001ECB, CBC, CFB and OFB defined for DES in FIPS 81
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
Variants in NextSSL
6| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| 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.
Families with similar names
Other block cipher modes
All 20Related
Counter-mode AES with a GHASH polynomial MAC; the default AEAD of TLS and IPsec
AESThe Advanced Encryption Standard: the world's default 128-bit block cipher
AES-CTRCounter mode: turns AES into a fast, parallel stream cipher
AES-OFBOutput Feedback mode: a synchronous stream cipher from repeatedly encrypting the IV