Home All Groups Group Topic Archive Search About
Author
18 Jul 2006 3:04 AM
Jason Chan
Hi all,

I'm new in encryption and I have a question.

I want to encrypt a message using RSA RC4 in one machine with the public and
decrypt it in another machine with the private key.

I have wrote two pages in classic asp for encrypt/decrypt using CAPICOM API.
Now my boss want me to move the encryption part to .NET environment and
using native .NET code to do the encryption (no CAPICOM)

Basically I have no idea how to start, and would like someone can give me a
hand.

Somethings I have to figure out first.
1. Does .Net framework have native class library to do RC4 encryption
2. I have a public key, a .p7b file, how can I load the public key and use
it to encrypt a message.

Thanks in advance.

Jason

Author
18 Jul 2006 7:59 AM
Valery Pryamikov
Hi,
i'd rather advise you to avoid using RC4 encryption, especially because
you are new to cryptography. RC4 could be secure if used correctly, but
it is a extremely tricky to use correctly. Eg. first few hundreds of
bytes of RC4 key stream is highly correlated to key - i.e. you have to
drop them before using RC4 stream, you can never reuse key stream +++.
For real life example of failures caused by incorrect using of RC4 by
not-very-experienced-in-cryptography people look at WEP and history of
WEP breaks...

Use AES instead (extra bonus is that you have Native Rijndael that is
the same as AES when you use it with block size 128 and key sizes 128,
192 or 256 bits).

-Valery.

Jason Chan wrote:
Show quoteHide quote
> Hi all,
>
> I'm new in encryption and I have a question.
>
> I want to encrypt a message using RSA RC4 in one machine with the public and
> decrypt it in another machine with the private key.
>
> I have wrote two pages in classic asp for encrypt/decrypt using CAPICOM API.
> Now my boss want me to move the encryption part to .NET environment and
> using native .NET code to do the encryption (no CAPICOM)
>
> Basically I have no idea how to start, and would like someone can give me a
> hand.
>
> Somethings I have to figure out first.
> 1. Does .Net framework have native class library to do RC4 encryption
> 2. I have a public key, a .p7b file, how can I load the public key and use
> it to encrypt a message.
>
> Thanks in advance.
>
> Jason