Use .NET RSACryptoServiceProvider for encryption and let OpenSSL decrypt

2008-09-05 Thread PMicke
I want to write a .NET client that sends an encrypted message to a server written in C with OpenSSL crypto library, and decrypt the message there. I use RSA with PKCS1 padding. I have managed to get that to work for C clients using crypto library, Java clients using standard 1.5 library classes.

Using javax.crypto.Cipher with RSA and an OpenSSL generated public key

2008-09-03 Thread PMicke
Hi, I want to write a .NET client that sends an encrypted message to a server written in C, and decrypt the message there. I use RSA with PKCS1 padding.. But the server cannot decrypt the sequence from the .NET client. error:2006E079:BIO routines:BIO_puts:unsupported method I see 3 possible so

Re: Using javax.crypto.Cipher with RSA and an OpenSSL generated public key

2008-09-02 Thread PMicke
I found the solution for the interoperability problem between Java and C: no padding does not work, but PKCS1PADDING does. In the Java code below, change the line: Cipher c = Cipher.getInstance("RSA/ECB/PKCS1PADDING"); And in the C code the change at decryption is to use RSA_PKCS1_PADDING inste

Using javax.crypto.Cipher with RSA and an OpenSSL generated public key

2008-08-24 Thread PMicke
Hi, we have a server using OpenSLL crypto library functions around RSA. I want to write a Java client that sends an encrypted message to the server, which can be decrypted there. To test this I use the following Java code below: The encoded public key is created with OpenSSL. R