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

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

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

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

  2. Similar Questions and Discussions

    1. Cryptographic service provider (CSP) could not be found for this algorithm.
      I'm running an ASP.NET webapplication on a Windows 2000 Server SP4 machine with .Net Framework 1.0 installed. The ASP.Net application uses...
    2. DPAPI Encryption Constraints & implementation
      I am working on using DPAPI user profile store to encrypt a connection string in web.config file, using VB.NET 1. I have a situation here, I...
    3. Problem with CryptoAPI in web service
      Hello, Can anybody help me? I have very strange (from my point of view) problem. My web service, which was working ages, suddenly has been...
    4. Using Microsoft Cryptographic API in a .Net web service.
      Hi, I used the Microsoft Cryptographic API in VB6, worked fine. It works well in a VB.Net window application as well. However, it does not work...
    5. Can't find a cryptographic service provider (CSP) in this algorythm...
      Hi! I'm trying to use a System.Security.Criptography function, it works on my machine but when I publish the site, it gives me the following...
  3. #2

    Default RE: CryptoAPI cryptographic service provider (CSP) for this implementa

    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
    >
    Chris Tanger Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139