CBC

Cipher Block Chaining

When AES is used in CBC mode, each block of plaintext is first XORed with the previous block of ciphertext (or the IV, in the case of the first block). This XOR operation ensures that even if two plaintext blocks are identical, the corresponding ciphertext blocks will be different. The result of the XOR operation is then encrypted using AES with the shared secret key.

Decryption works in the opposite order. Each block of ciphertext is first decrypted using AES with the shared secret key, producing the corresponding block of plaintext. This block is then XORed with the previous block of ciphertext (or the IV, in the case of the first block), producing the original plaintext.

Last updated