KI_DES8Strong
AI_FeedbackCipher

Block Ciphers

Step 3b: Setting the Key Object

You want to use a KI compatible with DES encryption, so return to the entry for in Chapter 2 of the Reference Manual:

Key info types for keyObject in B_EncryptInit or B_DecryptInit:

Depends on cipher type, as follows:

Cipher

KIs

DES

KI_Item, KI_DES8, KI_DES8Strong, KI_8Byte

See “Summary of KIs” on example, you will use

page 113 of this manual for a discussion of the KIs. For this

. Its entry in the Reference Manual states:

Format of info supplied to B_SetKeyInfo:

pointer to an unsigned char array which holds the 8-byte DES key. The key is DES parity-adjusted when it is copied to the key object.

Use a random number generator to produce eight bytes for the key:

unsigned char keyData[8];

/* Complete steps 1 - 4 of Generating Random Numbers, */ /* then call B_GenerateRandomBytes. */

if ((status = B_GenerateRandomBytes (randomAlgorithm, keyData, 8, (A_SURRENDER_CTX *)NULL_PTR)) != 0)

break;

if ((status = B_SetKeyInfo

(desKey, KI_DES8Strong, (POINTER)keyData)) != 0) break;

C h a p t e r 6 S y m m e t r i c - K e y O p e r a t i o n s

1 8 1

Page 203
Image 203
RSA Security 5.2.2 manual Depends on cipher type, as follows, Format of info supplied to BSetKeyInfo