RSA Security Projection Television 5.2.2 Bedienungsanleitung Seite 205

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 376
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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);
Seitenansicht 204
1 2 ... 200 201 202 203 204 205 206 207 208 209 210 ... 375 376

Kommentare zu diesen Handbüchern

Keine Kommentare