RSA Security 5.2.2 manual 5Cipher Feedback CFB Mode

Models: 5.2.2

1 376
Download 376 pages 13.91 Kb
Page 66
Image 66

Cryptography Overview

Initialization

 

 

Block Cipher B

Vector (IV)

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

Key (K)

Block Cipher B2

Key (K)

1st message block P1

1st cipher

XOR

block C1

2nd message block P2

XOR

2nd cipher

block C2

 

Figure 3-5Cipher Feedback (CFB) Mode

To encrypt plaintext using CFB mode:

1.Generate your key and your IV.

2.Encrypt the IV with the key to get a block of output, B1.

3.XOR B1 with the first block of your plaintext, P1, to get the first block of ciphertext, C1.

4.Encrypt C1 with the key to get the second block of output, B2.

5.XOR B2 with the second block of your plaintext message, P2, to get the second block of ciphertext, C2.

6.Repeat Steps 4 and 5 until the entire text is encrypted.

To decrypt the ciphertext, the decryptor uses the same (secret) key and initialization vector and follows the same sequence of steps.

CFB mode does not require padding. If your data length is not a multiple of the block size, simply truncate the final block of output to be the same size as the final segment of the data, and then XOR it. You can use CFB mode to encrypt a stream of data.

4 4

R S A B S A F E C r y p t o - C D e v e l o p e r ’s G u i d e

Page 66
Image 66
RSA Security 5.2.2 manual 5Cipher Feedback CFB Mode