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

From: Don Nelson (justwantananswer_at_rediffmail.com)
Date: 10/25/04


Date: 25 Oct 2004 03:11:47 -0700

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



Relevant Pages

  • Re: Crypt questions
    ... For the right account it can be decrypted if both accounts have ... If the machines are not both ... If I encrypt the harddrives on ... will a theif be able to decrypt the data? ...
    (microsoft.public.windowsxp.security_admin)
  • RE: Rijndael decryption succeeds SOMETIMES
    ... while our dev machines are single proc. ... >> it to produce an crypto key, which is then used to encrypt and decrypt. ...
    (microsoft.public.dotnet.security)
  • RE: NTE_BAD_DATA
    ... They are NOT used DIRECTLY to encrypt / decrypt data; ... you should generate a RANDOM SESSION KEY and select a SYMMETRIC ENCRYPTION ... // imported from a BLOB read in from the source file or having ...
    (microsoft.public.platformsdk.security)
  • Re: Back Doors
    ... >> Design into the system a master key. ... Encrypt that with public key. ... Decrypt random symmetric key with private key. ...
    (sci.crypt)
  • Re: CAPI and RC4: can not decrypt when Final parameter is set to F
    ... to store ASYMMETRIC key pairs - never symmetric keys like RC4, ... Now when you need to encrypt at one place and decrypt at the other normally ... Get a HCRYPTPROV handle to a key container with CryptAcquireContext ...
    (microsoft.public.platformsdk.security)