The CBC mode is an enhanced mode of ECB which chains together blocks of ciphertext. This mode requires an initialization vector (IV) to combine with the first plaintext block. In CBC encryption, the first input block is formed by exclusive-OR-ing the first block of the plaintext with the initialization vector. The forward cipher function is applied to the first input block and the resulting output block is the first block of the ciphertext. This resulting output block is exclusive-OR-ed with the second plaintext data block to produce the second input block, and the forward cipher function is applied to produce the second output block. This output block, which is the second ciphertext block, is exclusive-OR-ed with the next plaintext block to form the next input block and so on… To sum the process up, each successive plaintext block is exclusive-OR-ed with the previous output/ciphertext block to produce the new input block. The CBC decryption follows the same principle.