EasyManuals Logo

ST STM32F40 Series User Manual

ST STM32F40 Series
1422 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #554 background imageLoading...
Page #554 background image
RM0090 Cryptographic processor (CRYP)
Doc ID 018909 Rev 4 554/1422
DES and TDES Cipher block chaining (DES/TDES-CBC) mode
DES/TDES-CBC mode encryption
Figure 205 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 20.3.3: Data type on page 567), is formed by exclusive-
ORing the first plaintext data block (P
1) with a 64-bit initialization vector IV (I1 = IV P1).
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 (C1), that is, C1 = O1. This first ciphertext
block is then exclusive-ORed with the second plaintext data block to produce the
second input block, (I
2) = (C1 P2). Note that I2 and P2 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 Figure 206), 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 = O1 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 = O2 C1). (Note that P2 and O2 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.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F40 Series and is the answer not in the manual?

ST STM32F40 Series Specifications

General IconGeneral
BrandST
ModelSTM32F40 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals