RSA Security Projection Television 5.2.2 Manual do Utilizador Página 202

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 376
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 201
Block Ciphers
180 RSA BSAFE Crypto-C Developers Guide
You must also indicate that you want to use the standard CBC padding which is
defined in PKCS#5; do this by setting
fbParams.paddingMethodName
to "pad". You do
not need to pass in any padding parameters for this padding scheme. Again, Block
Ciphers on page 37 explains padding.
Now set up the
B_BLK_CIPHER_W_FEEDBACK_PARAMS structure:
Step 3: Init
You need a key before you can initialize the object for encryption. You will need to
first create the key object, and then set the key object.
Step 3a: Creating the Key Object
/* Complete steps 1 - 4 of Generating Random Numbers, then */
/* call B_GenerateRandomBytes. */
if ((status = B_GenerateRandomBytes
(randomAlgorithm, ivBytes, 8,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
ivItem.data = ivBytes;
ivItem.len = 8;
fbParams.encryptionMethodName = (unsigned char *)"des";
fbParams.encryptionParams = NULL_PTR;
fbParams.feedbackMethodName = (unsigned char *)"cbc";
fbParams.feedbackParams = (POINTER)&ivItem;
fbParams.paddingMethodName = (unsigned char *)"pad";
fbParams.paddingParams = NULL_PTR;
if ((status = B_SetAlgorithmInfo
(encryptionObject, AI_FeedbackCipher,(POINTER)&fbParams)) != 0)
break;
B_KEY_OBJ desKey = (B_KEY_OBJ)NULL_PTR;
if ((status = B_CreateKeyObject (&desKey)) != 0)
break;
Vista de página 201
1 2 ... 197 198 199 200 201 202 203 204 205 206 207 ... 375 376

Comentários a estes Manuais

Sem comentários