RSACryptoServiceProvider questions

From: Daryn Kiely (anonymous_at_discussions.microsoft.com)
Date: 10/29/03


Date: Tue, 28 Oct 2003 23:40:24 -0800

I have 2 questions regarding the RSACryptoServiceProvider
class:

1) Why is it that if I try to encrypt something that is
longer than 117 bytes I get an cryptographic exception
with an invalid length? My key is 1024 bits, so I would
expect to be able to use a block size of 128 bytes (ok, I
must be missing something here, but what????).

2) What does a Cryptograhic exception with the
message "Bad Data" really mean? I have not been able to
find any documentation anywhere and have been getting
this regularly when trying to decrypt a message. I am
just a little frustrated!!!

Thanks in advance.

Daryn Kiely



Relevant Pages

  • RSACryptoServiceProvider questions
    ... I have 2 questions regarding the RSACryptoServiceProvider ... Why is it that if I try to encrypt something that is ... longer than 117 bytes I get an cryptographic exception ... this regularly when trying to decrypt a message. ...
    (microsoft.public.platformsdk.security)
  • RSACryptoServiceProvider Question
    ... I have 2 questions regarding the RSACryptoServiceProvider ... Why is it that if I try to encrypt something that is ... longer than 117 bytes I get an cryptographic exception ... this regularly when trying to decrypt a message. ...
    (microsoft.public.platformsdk.security)
  • private to public decrypt now working
    ... If you switch it to use the public key to encrypt and private to decrypt it works. ... RSACryptoServiceProvider rsaPrivate = new RSACryptoServiceProvider; ...
    (microsoft.public.dotnet.security)
  • Re: Couldn;t load assembly
    ... Trying to run following code to encrypt config file... ...
    (microsoft.public.dotnet.security)
  • Re: Use my your own HashAlgorithm Class
    ... Rather than use the EncryptValue / DecryptValue methods (which RSACryptoServiceProvider doesn't support), ... the Encrypt and Decrypt methods. ... >> doesn't know about your new algorithm. ... But CAPI doesn't work with OIDs directly, ...
    (microsoft.public.dotnet.security)