RSA Security Projection Television 5.2.2 Manual de usuario Pagina 205

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 204
Chapter 6 Symmetric-Key Operations 183
Block Ciphers
Step 5: Final
Step 6: Destroy
Remember to destroy all objects that you created and free up any memory that you
allocated:
Note: Using
T_free means you can no longer access the data at that address. Do not
free a buffer until you no longer need the data it contains. If you will need the
data later, you might want to save it to a file first.
Decrypting
As in the Introductory Example on page 9, decrypting is similar to encrypting. Use
the same AI, IV, and key data. Use the proper decryption AM and call
B_DecryptInit,
B_DecryptUpdate, and B_DecryptFinal.
if ((status = B_EncryptUpdate
(encryptionObject, encryptedData, &outputLenUpdate,
encryptedDataLen, (unsigned char *)dataToEncrypt,
dataToEncryptLen, (B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
if ((status = B_EncryptFinal
(encryptionObject, encryptedData + outputLenUpdate,
&outputLenFinal, encryptedDataLen - outputLenUpdate,
(B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
B_DestroyKeyObject (&desKey);
B_DestroyAlgorithmObject (&encryptionObject);
B_DestroyAlgorithmObject (&randomAlgorithm);
T_free (encryptedData);
Vista de pagina 204
1 2 ... 200 201 202 203 204 205 206 207 208 209 210 ... 375 376

Comentarios a estos manuales

Sin comentarios