Re: Problem to cipher/decypher a struct with RSA

2005-05-11 Thread Nils Larsch
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

Re: Problem to cipher/decypher a struct with RSA

2005-05-11 Thread Angel Martinez Gonzalez
Hello: Thanks Nils for you help, but I obtain the problem. I have tried your advice: RSA_public_encrypt(sizeof(texto)+1, texto, textocifrado, claveRSA, RSA_PKCS1_PADDING); but the problem is the same. - Original Message - From: Nils Larsch [EMAIL PROTECTED] To:

Re: Problem to cipher/decypher a struct with RSA

2005-05-11 Thread Gyorgy Camaszotisz
I'm afraid sizeof(texto) returns the size of the pointer itself (4 in case of IA-32), not the data length. sizeof(struct PeticionSeudonimo) would be more effective. Also, you are using pointers in your struct (like char *mensaje), which means you are ciphering the pointer only, not the data it

Problem to cipher/decypher a struct with RSA

2005-05-10 Thread Angel Martinez Gonzalez
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