Hi, All!
Following code works on Windows XP SP2/SP1 (eng, IE 6.0.2900.2180), but does
not work on Windows 2000 SP4 (eng, IE 5.00.3700.1000). On both system .NET
Framework 1.1.4 is installed.
CspParameters csp = new CspParameters();
csp.KeyContainerName = "OC_AS_asax_1_11";
csp.ProviderType=1;
csp.ProviderName="Microsoft Base Cryptographic Provider v1.0";
csp.Flags = CspProviderFlags.UseMachineKeyStore;
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(1024,csp);
byte[] buf = new byte[58];
byte[] ebuf=rsa.Encrypt(buf, false);
"Bad key" exception throws when Encrypt is called. It works only when I
replace "Microsoft Base Cryptographic Provider v1.0" with "Microsoft
Enhanced Cryptographic Provider v1.0". Why? Does anybody know what is the
problem?
Valery Pryamikov - 04 Oct 2005 22:16 GMT
Hi,
Base Cryptographic Provider doesn't support RSA encryption keys stronger
than 512 bits. This provider is reminders of last century's USA strong
crypto exporting restrictions and it should not be used nowadays - use
Strong or Enhanced providers instead.
-Valery.
http://www.harper.no/valery
> Hi, All!
>
[quoted text clipped - 22 lines]
> Enhanced Cryptographic Provider v1.0". Why? Does anybody know what is the
> problem?