Jaa


Default Provider Type for CspParameters has changed

Hi all,

Before .NET Framework 3.5 SP1, the default provider type for CspParameters was PROV_RSA_FULL (1) . Now it's PROV_RSA_AES (24) for all operating systems which support Microsoft Enhanced RSA and AES Cryptographic Provider (WinXP and higher).
So if your code depends on PROV_RSA_FULL being set as provider type, you will have to explicitly specify it yourself:

 CspParameters cspParams = new CspParameters();
cspParams.ProviderType = 1;
...
RSACryptoServiceProvider RSAalg = new RSACryptoServiceProvider(cspParams);
...

 

You can check which CSPs you have here in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider

And here which CSP types we have and the default CSP per type:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider Types

You can i.e. check type 24 (RSA Full and AES) here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider Types\Type 024

 

I hope this helps.

Regards,

 

Alex (Alejandro Campos Magencio)