RSA Security 5.2.2 Projection Television User Manual


 
Chapter 6 Symmetric-Key Operations 181
Block Ciphers
Step 3b: Setting the Key Object
You want to use a KI compatible with DES encryption, so return to the entry for
AI_FeedbackCipher in Chapter 2 of the Reference Manual:
See Summary of KIs on page 113 of this manual for a discussion of the KIs. For this
example, you will use
KI_DES8Strong. Its entry in the Reference Manual states:
Use a random number generator to produce eight bytes for the key:
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
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.
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;