All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

What is CFB (Cipher Feedback)?

Post cover: What is CFB (Cipher Feedback)?
Table of contentsClick link to navigate to the desired location
This content has been automatically translated from Ukrainian.
CFB (short for Cipher Feedback) is one of the methods of data encryption that works on the principle of "chaining." Imagine you have a message that you want to encrypt, and you do it in blocks (for example, 16 bytes at a time). Each block is not encrypted separately but depends on the previous one, creating a domino effect.

How does Cipher Feedback work?

  1. Take an initial random piece of data (IV – Initialization Vector) and encrypt it.
  2. The resulting output is mixed (using the XOR operation) with the first block of plaintext. This is the first encrypted block.
  3. Then this encrypted block is used to encrypt the next block of text.
  4. And so on – each encrypted block affects the next one.

Simple examples

Secret chat. Imagine you are messaging in a secure messenger. To ensure that the message cannot be intercepted and altered without consequences, each piece of text is encrypted in a way that it depends on the previous one. If an attacker tries to change one word, it will spoil the entire subsequent text.
File encryption. Suppose you have a text document that needs to be stored in an encrypted form. Using CFB, the file will be encoded in such a way that changing one character in the plaintext will change the entire encrypted stream that follows it. This helps protect against data tampering.

Cipher Feedback in simple terms

  • CFB allows encrypting a stream of data without a fixed block size (for example, in streaming video or audio).
  • Changing one byte in the plaintext results in changes to all subsequent encrypted blocks, making forgery more difficult.
  • Suitable for use in network protocols and messengers where encryption needs to work quickly and efficiently.
To simplify even further, CFB is like when you encrypt your message, and each subsequent part is encoded based on the previous one, creating a chain reaction effect.

This post doesn't have any additions from the author yet.

[Fix] Heroku / SearchBox addon - indexing error "The client is unable to verify that the server is Elasticsearch"
31 Jan 13:09

[Fix] Heroku / SearchBox addon - indexing error "The client is unable to verify that the server is Elasticsearch"

meme code
meme code@memecode
06 Feb 15:31

Fix the error [DEPRECATION] #adapters is deprecated. Use #profiles instead. (Codecov / docile)

meme code
meme code@memecode
What is a Promise in JavaScript and how to quickly understand its essence?
18 Feb 11:01

What is a Promise in JavaScript and how to quickly understand its essence?

meme code
meme code@memecode
The structure of Promise (JavaScript) and how to work with it
18 Feb 14:33

The structure of Promise (JavaScript) and how to work with it

meme code
meme code@memecode
What is Memoization (examples in Ruby and Ruby on Rails)?
20 Feb 18:16

What is Memoization (examples in Ruby and Ruby on Rails)?

meme code
meme code@memecode
What is debounce in JavaScript and why is it important?
21 Mar 16:39

What is debounce in JavaScript and why is it important?

meme code
meme code@memecode
What is XOR and how does it work?
21 Mar 17:05

What is XOR and how does it work?

meme code
meme code@memecode
Embedded programming: what it is and how to get started
24 Mar 16:48

Embedded programming: what it is and how to get started

meme code
meme code@memecode
Pessimistic Lock in Rails: what it is and when to use it. What are the alternatives?
31 Mar 17:45

Pessimistic Lock in Rails: what it is and when to use it. What are the alternatives?

meme code
meme code@memecode
Why does PostgreSQL skip IDs when saving new records? (Heroku)
31 Mar 19:13

Why does PostgreSQL skip IDs when saving new records? (Heroku)

meme code
meme code@memecode
[Codecov] What is the difference between patch and project coverage?
09 Apr 16:03

[Codecov] What is the difference between patch and project coverage?

meme code
meme code@memecode
How do Scratch courses help children develop soft skills?
11 Apr 18:24

How do Scratch courses help children develop soft skills?

meme code
meme code@memecode