470,833 Members | 1,354 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Ecncryption between java and c#

Hi NG.

How do I encrypt a string from a C# application and then be able to read
that string on a java applikation.

Im figuring that I should use something with a public and a private key,
where the public key is with the c# application and the private key is with
the java applikation.
Anyone who can give me a hint how to get it working and which algorithm to
use? Should be one above 128bit.

Thanks in advance

SonofonoS
Jul 17 '05 #1
2 1994
SonofonoS <so*******@hotmail.com> tried to express:
Hi NG.

How do I encrypt a string from a C# application and then be able to read
that string on a java applikation.

Im figuring that I should use something with a public and a private key,
where the public key is with the c# application and the private key is with
the java applikation.
Anyone who can give me a hint how to get it working and which algorithm to
use? Should be one above 128bit.


Are you talking about a message sender and receiver, or simply taking the
encrypted string that is produced under c# and decrypting it under java?

For RSA type encryption algorithms the key length is arbitrary. Just note
that strong encryption using primes is computationally expensive.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 17 '05 #2
no***@uber.usachoice.net (Wiseguy) wrote in news:41********@127.0.0.1:
SonofonoS <so*******@hotmail.com> tried to express:
Hi NG.

How do I encrypt a string from a C# application and then be able to
read that string on a java applikation.

Im figuring that I should use something with a public and a private
key, where the public key is with the c# application and the private
key is with the java applikation.
Anyone who can give me a hint how to get it working and which
algorithm to use? Should be one above 128bit.


Are you talking about a message sender and receiver, or simply taking
the encrypted string that is produced under c# and decrypting it under
java?

For RSA type encryption algorithms the key length is arbitrary. Just
note that strong encryption using primes is computationally expensive.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the
World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total
Privacy via Encryption =---


Well, now I got it figured... Almost!

I can make the keys with my java applikation. I can encode a string with
a .net public key, and put it in a file on the hd. Then when tryig to
decode the string in the file i just get bad data. Just alot of different
chars! Not the same string that I encoded.

At first I take the string and makes it into a byte[] with
utf8encoding.getBytes()
I then encode that byte[] and put it in a file.

After that i load the bytes from the file into a java byte[] and decode
them with the a cipher object, using the private key.

SonofonoS
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Michael | last post: by
reply views Thread by Ravi Tallury | last post: by
1 post views Thread by ptaz | last post: by
reply views Thread by Markus Wollny | last post: by
oll3i
reply views Thread by oll3i | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.