Angel Martinez Gonzalez wrote:
Hello:

I want to cypher/decypher an struct:

struct PeticionSeudonimo
 {
  char *mensaje;
  int id_peticion;
  DES_cblock *clave_simetrica;
 }peticion_seudonimo;

To do this, I first convert this struct to char *:

 char *ptrPeticionSeudonimo = (char *)&peticion_seudonimo;

Then I use this function to cipher:

char *CifradoClavePublica(RSA *claveRSA, char *texto)
{
     char *textocifrado;

     textocifrado =malloc(RSA_size(claveRSA));
     RSA_public_encrypt(strlen(texto)+1, texto, textocifrado, claveRSA,

I wouldn't use strlen(), sizeof() might be more appropriate

Nils
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to