RSA Security Projection Television 5.2.2 Manual de usuario Pagina 231

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 230
Chapter 6 Symmetric-Key Operations 209
Block Ciphers
secure; it is used for illustrative purposes only. It is not for duplication:
You should zeroize any sensitive data after leaving the
do-while. In fact, you might
want to zeroize the memory immediately after you set the key:
Now that you have a key, you need an algorithm chooser and a surrender context.
This is a speedy function, so it is reasonable to use a properly cast
NULL_PTR for the
surrender context. You do want to build a chooser:
unsigned char enteredPassword[MAX_PW_LEN];
ITEM pbeKeyItem;
puts ("Enter the password, then press Return or Enter");
gets ((char *)enteredPassword);
pbeKeyItem.data = enteredPassword;
pbeKeyItem.len = strlen (enteredPassword);
if ((status = B_SetKeyInfo
(pbeKey, KI_Item, (POINTER)&pbeKeyItem)) != 0)
break;
T_memset (pbeKeyItem.data, 0, MAX_PW_LEN);
B_ALGORITHM_METHOD *PBE_CHOOSER[] = {
&AM_MD5,
&AM_RC2_CBC_ENCRYPT,
(B_ALGORITHM_METHOD *)NULL_PTR
};
if ((status = B_EncryptInit
(pbEncrypter, pbeKey, PBE_CHOOSER,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
Vista de pagina 230
1 2 ... 226 227 228 229 230 231 232 233 234 235 236 ... 375 376

Comentarios a estos manuales

Sin comentarios