Questions Technology

What is cipher block chaining?


Joseph T Ortega

Be a Warrior and not a Worrier

Cipher Block Chaining (CBC) is the commonly used mode of operation for encryption and decryption of block ciphers which is a set of bits encrypted or decrypted as a single block. An Initialization Vector (IV) and a key are used in the process. An Initialising Vector is a unique sequence of bits that are used to prevent a repetition of ciphertexts even for the same plaintexts being encrypted multiple times independently with the same key. It has different security requirements than a key, so it need not be a secret. However, it should be noted that the same IV must not be used with the same key because of security issues as doing the same may help hackers in cracking the code and thus may lead to information leakage. Ideally, the IV should be different for messages with the same key.

In CBC, the common practice of using the ciphertext of the previous block as the IV of the present message is followed which is considered to be a little unsafe. This is because if a hacker knows the ciphertext of a previous block, then the next plaintext can be guessed if the key used for it is the same as that of the previous block.

 In CBC mode encryption, a chaining mechanism is followed in which each plaintext is XORed with the ciphertext of the last block before being encrypted such that each ciphertext depends on all the plaintexts blocks processed up to that point.

    With the first block marked with index 1, CBC encryption can be formulated by: 

    {\displaystyle C_{i}=E_{K}(P_{i}\oplus C_{i-1}),}
    {\displaystyle C_{0}=IV}   

 The decryption can be formulated by:

  {\displaystyle P_{i}=D_{K}(C_{i})\oplus C_{i-1},}
  {\displaystyle C_{0}=IV.}

The main disadvantage of CBC encryption is that it is sequential; each encryption depends on the preceding ciphertext. One-bit change in a ciphertext block may affect all the following ciphertexts block.

However, decrypting with a changed IV or ciphertext may affect the first block of plaintext but not the ones following it. Hence, decryption with CBC has the advantage of being parallelized rather than being entirely sequential which makes a plaintext block recoverable from two adjacent ciphertexts block.

Technology Courses


Complete Outlier Detection Algorithms A-Z: In Data...

Saurav Singla

0 (0) New Course

Welcome to the course "Complete Outlier Detection Algorithms A-Z: In Data Science". This is the most comprehensive, yet straight-forward, course for the outlier detection! Are you Data Scientist...

1 hrs 40.12 mins 0 Students Enrolled 18 Lectures


71.64 % off $67


Buy Now

Spark AR Studio for Beginners: Create Your Own Fil...

Artem Dovgenko

0 (0) New Course

Start creating your filters professionally with Spark AR Studio! If you are looking for a filter creating an application that will allow you to create filters however you want them, Spark AR Studi...

1 hrs 10.58 mins 1 Students Enrolled 28 Lectures


61.22 % off $49


Buy Now
View All
Item added successfully. Go to cart for checkout.
Accept Reject