Home All Groups Group Topic Archive Search About

Assymetric Encryption - Interorperability between Java2, .NET and Openssl

Author
1 Mar 2005 7:28 PM
mathew alexander
Hi,
I am porting an application from Java to .NET. The application encrypts
data using RSA, and this data is sent to a Linux box where it is decrypted
using
openssl libraries. Public(.crt file) and Private Keys(.key file) are
generated on the Linux box with openssl routines.

The java application uses the following cipher to encrypt the data.

Cipher cipher = Cipher.getInstance("RSA/ECB/PKCSIPadding","BC")

what is the equivalent .NET security provider for this?

I am assuming it is the RSACryptoService Provider. The
RSACryptoServiceProvider however initializes with a CspParameter. How will I
import my .crt public key into a windows key container.

thanks,

Mathew

Author
2 Mar 2005 12:46 AM
Shawn Farkas [MS]
Hi Matthew,

The easiest thing to do would probably be to load your .crt file into a
Windows key container, then use the RSA CSP to access that key and do your
decryption.  I'm not familiar with OpenSSL at all ... would it be easy to
P/Invoke to it and have it import the key for you?

-Shawn
http://blogs.msdn.com/shawnfa 
-- 
This posting is provided "AS IS" with no warranties, and confers no rights.


Note: 
For the benefit of the community-at-large, all responses to this message
are best directed to the newsgroup/thread from which they originated.
--------------------
> From: "mathew alexander" <mmat***@red-usa.com>
> Subject: Assymetric Encryption - Interorperability between Java2, .NET
and Openssl
> Date: Tue, 1 Mar 2005 14:28:50 -0500
> Lines: 22
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
> Message-ID: <eELPKUpHFHA.3***@TK2MSFTNGP14.phx.gbl>
> Newsgroups: microsoft.public.dotnet.security
> NNTP-Posting-Host: 65.204.56.55
> Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1
4.phx.gbl
Show quoteHide quote
> Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.security:9291
> X-Tomcat-NG: microsoft.public.dotnet.security
>
> Hi,
>  I am porting an application from Java to .NET. The application encrypts
> data using RSA, and this data is sent to a Linux box where it is decrypted
> using
> openssl libraries. Public(.crt file) and Private Keys(.key file) are
> generated on the Linux box with openssl routines.
>
> The java application uses the following cipher to encrypt the data.
>
> Cipher cipher = Cipher.getInstance("RSA/ECB/PKCSIPadding","BC")
>
> what is the equivalent .NET security provider for this?
>
>  I am assuming it is the RSACryptoService Provider. The
> RSACryptoServiceProvider however initializes with a CspParameter. How
will I
> import my .crt public key into a windows key container.
>
> thanks,
>
> Mathew
>
>
>