Java Reference
In-Depth Information
Cleartext Data
Block
Cleartext Data
Block
Encryption
Key
Encryption
Key
Block Cipher
Block Cipher
Ciphertext
Data Block
Ciphertext Data
Block
Figure 8.5
electronic code book mode of block cipher encryption.
8.1.5.2 Cipher Block Chaining
Cipher block chaining is a block cipher encryption mode that provides a greater degree of random-
ness (and security) to the encryption process, as compared to the electronic code book mode. he
CBC utilizes a system where the ciphertext of the previously encrypted block of data is used along
with the subsequent block of plaintext block of data that is to be encrypted. he combination of
the ciphertext of the previous block and the plaintext of the subsequent block acts as an initializa-
tion vector, to add randomness to the encryption process. he ciphertext from a previous block is
XORed * with the plaintext of the subsequent block to add more complexity and randomness to the
encryption process. his process is repeated for all the blocks of data encrypted by the algorithm.
To ensure that the irst block of data is encrypted with adequate randomness, an actual initializa-
tion vector is introduced to the process and the void, which would have been created for the irst
block of data being encrypted, would not hold true. Figure 8.6 depicts the working of the cipher
block chaining mode.
Cleartext Data
Block
Cleartext Data
Block
Initialization
Ve ctor
Encryption
Key
Encryption
Key
Block Cipher
Block Cipher
Ciphertext
Data Block
Ciphertext Data
Block
Figure 8.6
Cipher block chaining—Block cipher mode of encryption.
* XOR is the mathematical exclusive OR operator. XOR returns 1 when the irst bit has a diferent value when
compared to the second bit. For instance, 0, 1 returns 1 in XOR. However, if the bit values are the same, then
XOR returns a 0. For instance, 1,1 returns a 1. XOR is used extensively in encryption and decryption for sub-
stitution and the cleartext is XORd with the key to produce the ciphertext.
Search WWH ::




Custom Search