SV: Java -> .NET RSA Encryption

Fredrik Hesse <[email protected]> Wed, 30 Mar 2005 08:59:25 +0200
Newsgroups gmane.comp.security.web-applications,gmane.comp.security.programming,gmane.comp.security.vulnerabilities
Message-ID <0E1AFF618B72D7478F000242316D112903339F7D@srv1liljeholmen.liljeholmen.nexus.se>
A tip regarding the exchange of keys:
Traditional Java keystores does not allow you to import
or export a private key. Only to generate it in the keystore.
However, you can load a PKCS12 (pfx) file as a keystore instead.
So by generating the keys using OpenSSL and packaging them
as a PKCS12-package you can make them available for both platforms
without installing additional providers.

Regards
Fredr!k
=20

-----Ursprungligt meddelande-----
Fr=E5n: john bart
Till: [email protected]; [email protected];
[email protected]; [email protected];
[email protected]
Skickat: 2005-03-28 17:43
=C4mne: Java -> .NET  RSA Encryption

Hello all,
I want to RSA encrypt a message in a java environment, and to decrypt =
it
in=20
.NET.
I thought it would be easy - encrypt the message using a public key
(java=20
environment), and decrypt it (.net environment) with the private key.
Sounds=20
simple in theory...

So far, i didn't manage to do that.
I had problems from the beginning, when i tried to generate the =
key-pair
and=20
export it between the environment. How can i generate the keys, put the =

private key in the .net environment and the private key in the java=20
environment (JKS) ?

Also, do i need an external provider for java, like BouncyCastle? some
of=20
the articles say that i must use that, but in the documentation of Java
1.5=20
there's a provider that can do RSA encryption. I'm confused..

If enyone have an example to do such encryption (and some explanation =
on
key=20
generation and exchange..) it'll be great...

thanks in advance,
john.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's =
FREE!

http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/