D
Don Nelson
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
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