RM0090
DES and TDES Cipher block chaining (DES/TDES-CBC) mode
•
DES/TDES-CBC mode encryption
Figure 220
CBC) mode encryption. This mode begins by dividing a plaintext message into 64-bit
data blocks. In TCBC encryption, the first input block (I
word swapping (refer to
exclusive-ORing the first plaintext data block (P
= IV ⊕ P
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
ciphertext block is then exclusive-ORed with the second plaintext data block to produce
the second input block, (I
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
directly as the input block (I
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
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
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.
illustrates the DES and Triple-DES Cipher block chaining (DES/TDES-
Section 23.3.3: Data type on page
). The input block is processed through the DEA in the encrypt state using K1.
1
) is used directly as the ciphertext (C
1
) = (C
2
). The keying sequence is reversed compared to that used
1
DocID018909 Rev 11
Cryptographic processor (CRYP)
) with a 64-bit initialization vector IV (I
1
⊕ P
). Note that I
and P
1
2
2
Figure
221), the first ciphertext block (C
⊕ C
= O
2
2
1
), obtained after bit/byte/half-
1
730), is formed by
), that is, C
= O
1
1
now refer to the second
2
⊕ IV). The second
= O
1
1
). (Note that P
and O
2
1
. This first
1
) is used
1
refer to
2
717/1731
757
Need help?
Do you have a question about the STM32F405 and is the answer not in the manual?