Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired during encryption

Reply
Thread Tools

CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired during encryption

 
 
Don Nelson
Guest
Posts: n/a
 
      10-25-2004
Hi,
We are trying to encrypt and decrypt some fields using RSA
algorithm.The class being used is RSACryptoServiceProvider.We have put
a key in its XML representation in Registry and evrytime whenever we
invoke our custom encryption class, it instantiates
RSACryptoServiceProvider class with its default constructor.Please
look at following snippet:
RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider();

/* Creating the RSACryptoServiceProvider object from the XML string
of the Key(which is read from the registry.)
The key is inserted in the registry while environment was et up
initially. */

rsaProvider.FromXmlString(Key);

Our environment has 5 machines and all the 5 machines have this key in
their registry.This ensures that passwords encrypted on one machine
can be decrypted on other machine.That is the reason we cannot use
cspParameters class and cspFlags and hence UseMachineKeyStore
property.
The problem occurs when we run around 1000 successive requests for
encryption.After successful execution of 300-400 requests, we get an
error saying "CryptoAPI cryptographic service provider (CSP) for this
implementation could not be acquired".As much as we have read on Net,
this occurs because ASP.net is not an interactive user and hence needs
to use UseMachineKeyStore property.However we cannot use this for the
above mentioned reasons.Also first 300 requests execute
successfully.otherwise this error should have come at the first
request itself.
Can anyone please help us?
Thanks in advance.
Don
 
Reply With Quote
 
 
 
 
Chris Tanger
Guest
Posts: n/a
 
      02-03-2005
I have a similar problem while trying to instantiate an
RSACryptoServiceProvider for the 30th time or so in a C# dll class.
Basically I have multiple threads using the RSACryptoServiceProvider and
periodically about 1 every 30 tries I get the same error you are getting. I
am wondering if the underlying cryptoAPI in windows is threadsafe or not.

Look for my post to Microsoft in dotnet.framework

"Don Nelson" wrote:

> Hi,
> We are trying to encrypt and decrypt some fields using RSA
> algorithm.The class being used is RSACryptoServiceProvider.We have put
> a key in its XML representation in Registry and evrytime whenever we
> invoke our custom encryption class, it instantiates
> RSACryptoServiceProvider class with its default constructor.Please
> look at following snippet:
> RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider();
>
> /* Creating the RSACryptoServiceProvider object from the XML string
> of the Key(which is read from the registry.)
> The key is inserted in the registry while environment was et up
> initially. */
>
> rsaProvider.FromXmlString(Key);
>
> Our environment has 5 machines and all the 5 machines have this key in
> their registry.This ensures that passwords encrypted on one machine
> can be decrypted on other machine.That is the reason we cannot use
> cspParameters class and cspFlags and hence UseMachineKeyStore
> property.
> The problem occurs when we run around 1000 successive requests for
> encryption.After successful execution of 300-400 requests, we get an
> error saying "CryptoAPI cryptographic service provider (CSP) for this
> implementation could not be acquired".As much as we have read on Net,
> this occurs because ASP.net is not an interactive user and hence needs
> to use UseMachineKeyStore property.However we cannot use this for the
> above mentioned reasons.Also first 300 requests execute
> successfully.otherwise this error should have come at the first
> request itself.
> Can anyone please help us?
> Thanks in advance.
> Don
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired Kim H ASP .Net Security 0 08-14-2006 10:29 AM
Cryptographic Service Provider supporting Via's Padlock (AES-encryption) Lars J. Java 0 07-31-2005 08:03 AM
CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired exception Mike P ASP .Net 0 03-12-2005 03:02 PM
Error:Cryptographic service provider (CSP) could not be found Gabor ASP .Net 0 12-22-2004 08:24 PM
Cryptographic service provider (CSP) could not be found for this algorithm. Sven-Torben Janus ASP .Net 3 09-10-2004 07:24 AM



Advertisments