DocID018909 Rev 11
717/1731
RM0090
Cryptographic processor (CRYP)
757
DES and TDES Cipher block chaining (DES/TDES-CBC) mode
•
DES/TDES-CBC mode encryption
illustrates the DES and Triple-DES Cipher block chaining (DES/TDES-
CBC) mode encryption. This mode begins by dividing a plaintext message into 64-bit
data blocks. In TCBC encryption, the first input block (I
1
), obtained after bit/byte/half-
word swapping (refer to
Section 23.3.3: Data type on page 730
), is formed by
exclusive-ORing the first plaintext data block (P
1
) with a 64-bit initialization vector IV (I
1
= IV
⊕
P
1
). The input block is processed through the DEA in the encrypt state using K1.
The output of this process is fed back directly to the input of the DEA, which performs
the DES in the decrypt state using K2. The output of this process is fed directly to the
input of the DEA, which performs the DES in the encrypt state using K3. The resultant
64-bit output block (O
1
) is used directly as the ciphertext (C
1
), that is, C
1
= O
1
. This first
ciphertext block is then exclusive-ORed with the second plaintext data block to produce
the second input block, (I
2
) = (C
1
⊕
P
2
). Note that I
2
and P
2
now refer to the second
block. The second input block is processed through the TDEA to produce the second
ciphertext block. This encryption process continues to “chain” successive cipher and
plaintext blocks together until the last plaintext block in the message is encrypted. If the
message does not consist of an integral number of data blocks, then the final partial
data block should be encrypted in a manner specified for the application.
•
DES/TDES-CBC mode decryption
In DES/TDES-CBC decryption (see
), the first ciphertext block (C
1
) is used
directly as the input block (I
1
). The keying sequence is reversed compared to that used
for the encrypt process. The input block is processed through the DEA in the decrypt
state using K3. The output of this process is fed directly to the input of the DEA where
the DES is processed in the encrypt state using K2. This resulting value is directly fed
to the input of the DEA where the DES is processed in the decrypt state using K1. The
resulting output block is exclusive-ORed with the IV (which must be the same as that
used during encryption) to produce the first plaintext block (P
1
= O
1
⊕
IV). The second
ciphertext block is then used as the next input block and is processed through the
TDEA. The resulting output block is exclusive-ORed with the first ciphertext block to
produce the second plaintext data block (P
2
= O
2
⊕
C
1
). (Note that P
2
and O
2
refer to
the second block of data.) The TCBC decryption process continues in this manner until
the last complete ciphertext block has been decrypted. Ciphertext representing a
partial data block must be decrypted in a manner specified for the application.