Home All Groups Group Topic Archive Search About

Re: Encrypting using RSA private Key

Author
12 Mar 2009 7:01 AM
VIVEK KUMAR
Hi,

I want to do RSA encryption with the private key and i want to decrypt
using public key. I am been able to encrypt it using private key but
while decrypting, I am getting the "BAD KEY" error.
                Can any one help me out as it is very urgent to me.
Could you please provide me the code in .NET so that i can add it in my
code and get it done soon.

Thank You in Advance.

Regards,
Vivek

*** Sent via Developersdex http://www.developersdex.com ***

Author
12 Mar 2009 4:00 PM
Joe Kaplan
This is not a supported use case for RSA key pairs, hence the error.  You
encrypt with public keys and decrypt with private keys.

It sounds like you want to implement digital signature instead.  In this use
case, you sign with private key and verify with public key.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
Show quoteHide quote
"VIVEK KUMAR" <vivek.ku***@infogain.com> wrote in message
news:e5ttTBuoJHA.1248@TK2MSFTNGP03.phx.gbl...
>
>
> Hi,
>
> I want to do RSA encryption with the private key and i want to decrypt
> using public key. I am been able to encrypt it using private key but
> while decrypting, I am getting the "BAD KEY" error.
>                Can any one help me out as it is very urgent to me.
> Could you please provide me the code in .NET so that i can add it in my
> code and get it done soon.
>
> Thank You in Advance.
>
> Regards,
> Vivek
>
> *** Sent via Developersdex http://www.developersdex.com ***