Re: 'Illegal key size for this algorithm

From: Alek Davis (alek_DOT_davis_AT_intel_DOT_com)
Date: 04/29/03


Date: Tue, 29 Apr 2003 09:39:10 -0700


Ron,

If you are using long keys, make sure that High Encryption Pack is installed
on the Win 98 system. If it is not, this will explain why it works on XP and
does not work on 98 (XP comes with high encryption pack by default).

-- Alek

"Ron" <namortaror@hotmail.com> wrote in message
news:05fa01c30a9d$40b73e80$3401280a@phx.gbl...
> I'm getting the 'Illegal key size for this algorithm '
> exception when running my application on Win 98. It runs
> fine on XP.
>
> I don't control the client's environment. The application
> is a window forms application and it is excpected to be
> installed on any .net platform win98 and up. I am
> desperate for a solution. The application needs to encode
> some personal info prior to sending it over the net (web
> service connection) the center. The exacutable is build
> on XP and it works fine on XP but not on NT, 98 and 2000.
> Please Help.
>
>
> Here is my implementation of my encription method;
>
> public static byte[] Encrypt(string text, string
> rsaPubKey)
> {
> UTF8Encoding utf8 = new UTF8Encoding();
> byte[] plaintext = utf8.GetBytes(text);
>
> RSACryptoServiceProvider rsa = new
> RSACryptoServiceProvider();
> rsa.FromXmlString(rsaPubKey);
>
> byte[] cipherText = rsa.Encrypt(plaintext, false);
>
> return cipherText;
> }
>
> and here is the code that created the keys;
>
> RSACryptoServiceProvider rsa = new
> RSACryptoServiceProvider();
>
> publicKye = rsa.ToXmlString(false);
> privateKye = rsa.ToXmlString(true);
>
> Any help greatly appreciated,
> Ron