RE: RSA encryption and Decryption code in C language

2013-06-18 Thread enrico d';urso
Hi, I'm implementing a software very similar to yours. This is a small function that I used to generate private and public key: #include int main() { char * file_pem = "key_priv"; char * file_pem_pub = "key_pub"; FILE * fp; int bits = 1024; unsigned long exp = RSA_F4; RS

R: Re: [Encrypting_Decrypting with DES]

2013-06-17 Thread enrico d';urso
Hi, I will consider the fact to use an other mode of encryption. It seems best solution in my case. Thanks for support. Best regards Enrico Inviato da Samsung Mobile Matt Caswell ha scritto: >On 17 June 2013 14:02, enrico d'urso wrote: >> Hi, thanks for answer. >>

RE: [Encrypting_Decrypting with DES]

2013-06-17 Thread enrico d';urso
Hi, thanks for answer. At the moment in my application I create an random IV and a random KEY. Client after this creation send them to Server encrpyting all with RSA public key. Client decrypt the message with private key, and from this point the communication will be based on DES in cbc mode usi

RE: [Encrypting_Decrypting with DES]

2013-06-17 Thread enrico d';urso
Hi, thanks for your answer. I didn't call them all times, just first time. The fact is that I would like to use 'cbc' scheme, so I Could make this way, if re call EncryptInit will delete the state of the context : Take a random IV, and use it. Encrypt a message, and save last cipher-text ( Let

[When call EVP_cleanup]

2013-06-16 Thread enrico d';urso
Hi all. I'm developing a simple software that gets input from stdin and send it (after encrypting) to a server. Since, i don't know if text from user is multiple of 8 byte( i'm using des), in my encryption function I always call: EVP_EncryptUpdate and then: EVP_EncryptFinal_ex All works fine bu

[Encrypting_Decrypting with DES]

2013-06-16 Thread enrico d';urso
Hi all, I have a problem using EVP interface . This is my routine to encrypt data: int encrypt(EVP_CIPHER_CTX *x, char * in, char * buf_out ) { int text_len; int loutU; int loutF; text_len = strlen(in) + 1; // i.e : adding '\0' if( EVP_EncryptUpdate(x, (unsigned char *)buf