Cipher Feedback (CFB)
Cipher feedback (CFB) is considered a stream cipher. In this mode, the ciphertext is fed back into the key-generating device to create the next key- stream. Each encryption depends on previous ciphertext. CFB is best for encrypting a stream of data one character at a time (e.g., between a termi- nal and a host). With 8-bit CFB, encryption is able to start and operate on each 8-bit character. Sometimes, it is desirable to use a block cipher in a mode that approximates a stream cipher — where the receiver or transmit- ter can begin to play with the block before its transmission is complete. This is exactly what CFB does. With CFB, we view a block-sized buffer as a shift register composed of units. After filling this register for the first time with a seed, we encode it using our encryption function. We then take the left-most byte of the output and consider it to be “live.” That is to say, we use it as the key to encrypt the next unit of plaintext. We then take that unit of plaintext and push it into the right side of the register, shifting the regis- ter left. Now we can repeat the process and encode the next unit of plain- text.
CFB requires a unique initialization vector for each message to avoid being vulnerable to replay attacks. An initialization vector is defined as a non-secret binary vector used as the initializing input algorithm for the encryption of a plaintext block sequence to increase security by introduc- ing additional cryptographic variance and to synchronize cryptographic equipment.
Errors in this mode of DES will propagate. For example, 8-bit CFB will produce 9 bytes of garbled plaintext from the point of error if a 1-bit error has occurred in the ciphertext.