Welcome to MSDN Blogs Sign in | Join | Help

Decrypt my World

Cryptography, Security, Debugging and more!

News

  • Any of my posts is supported under any Microsoft standard support program or service. They are provided "AS IS" without warranty of any kind, and confer no rights.

Where are my readers?

Locations of visitors to this page

Favorite Posts

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)

Posted: Thursday, April 30, 2009 3:43 PM by alejacma

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker