Cipher Block Chaining (CBC)

CBC is a block mode of operation# defined in #Data Encryption Standard (DES) and #Advanced Encryption Standard (AES) where the input to the encryption #algorithm is the XOR (\(\oplus\)) of the next block of plaintext and the preceding block of plaintexts. Decrypting the message can be as easy as just doing it reversely.

The message the was broken into blocks will be chained together (ciphertext block used to XOR the next plaintext block) in encryption algorithm, which is one of its strength, as little change to a block will affect the all the following blocks (Avalanche Effect#). At the end of the message, there is a need to handle the short blocks using either padding with non-data values such as nulls or pads the last block as the count of the pad size. It uses initialisation vector (IV) to start the process, as shown in the following equation:

$$ \begin{align} C_i &= \text{ des}_{k1} (p_i \oplus c_{i-1}) \\ C_{0} &= iv \end{align} $$

Where:

The intialisation vector needs to be known by the sender and receiver. Therefore, it has to be either a fixed value or encrypted before sharing.

However, CBC is a rather slow algorithm compare to Electronic Codebook (ECB) since the block can’t be computed in parallel. In terms of security, the attacker could utilise the CBC nature of using ciphertext as the input for the XOR of the next plaintext, and obtain some information about the next ciphertext.

Generally, it used for general-purpose block-oriented transmission and authentication such as email, File Transfer Protocol (FTP)#, web etc.

Links to this page
#cryptography #algorithm #)