Cryptography Overview

Cipher Block Chaining (CBC) Mode

With CBC mode, each plaintext block is XORed with the previous ciphertext block, then encrypted. CBC mode is as secure as the underlying block cipher against standard attacks. In addition, any patterns in the plaintext are concealed by the XORing of the previous ciphertext block with the plaintext block.

The decryptor follows the same sequence of steps to decrypt, using the same (secret) key and initialization vector (IV).

Initialization

Vector (IV)

1st message

XOR

Block Cipher

block

 

 

 

 

Key (K)

2nd message

XOR

Block Cipher

block

 

 

 

 

Key (K)

1st cipher

block

2nd cipher

block

Figure 3-4Cipher-Block Chaining (CBC) Mode

An initialization vector is added to the beginning of the plaintext before encryption. This gives you something to XOR the first block with and ensures that identical plaintexts encrypt to different ciphertexts.

Cipher Feedback (CFB) Mode

In cipher feedback (CFB) mode, the cipher object acts as a byte generator. CFB mode encrypts the previous block of ciphertext and XORs the plaintext with this block to produce ciphertext. For the first block, the initialization vector is encrypted. CFB mode is as secure as the underlying cipher against standard attacks. In addition, any patterns in the plaintext are concealed by XORing the previous ciphertext block with the plaintext block.

C h a p t e r 3 C r y p t o g r a p h y

4 3

Page 65
Image 65
RSA Security 5.2.2 manual Cipher Block Chaining CBC Mode, Cipher Feedback CFB Mode