Re: RSA.Create() - performance issues



Hi,

The problem exists only in framework 1.1 or so I'm told.
In 2.0 MS have changed the functionality, so that a key is only created when
actually needed.
Maybe you are running 2.0 and that's why you don't see it.
Using RSACryptoServiceProvider doesn't change anything.
I have tried RSACryptoServiceProvider object where I specify the keysize to
be only 512 and that help a little bit, but there are still major
performance problems.

Regards,
Kim

"Zemp Dominik" <zemp.dominik@xxxxxxxxxxxxxxxxxxx> skrev i en meddelelse
news:534C2140-3D14-4376-B11A-94EB964D84A1@xxxxxxxxxxxxxxxx
Hi

I've use also the RSA.Create() method in my XML signing application, but I
haven't a performance issue (Anyhow I did not determine that up to now).

You can try to use the RSACryptoServiceProvider. Perhaps this helps you.

// Create an RSA crypto service provider from the embedded
// XML document resource (the public key).
RSACryptoServiceProvider csp = new RSACryptoServiceProvider();
csp.FromXmlString(xmlkey);


Dominik

"Kim Hellan" wrote:

I doing something like this in code:
RSA myKey = RSA.Create();
myKey.FromXmlString(....);

Apparently RSA.Create() always creates a keypair which has a huge impact
on
the performance of my assembly, about 10 times as slow with this one line
included.
Is there really no way to just create an empty RSA object when you know,
that you will always load a key anyway?

Thanks,
Kim





.



Relevant Pages

  • private Key aus P12 Datei
    ... public string Sign(string TextToSign, string PrivateKey) ... RSACryptoServiceProvider rsaCryptoServiceProvider = new ... RSA RSA = RSA.Create; ... ASCIIEncoding Encoding = new ASCIIEncoding; ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • RE: Implementing RSACryptoServiceProvider *and* JavaScript
    ... One of the things I discovered is the 'standard' RSA algorithms, ... I've more-or-less come to the conclusion that the RSACryptoServiceProvider ... >> passwords and other sensitive information is passed from the client back to ... >> a JavaScript RSA implementation that works with the RSACryptoServiceProvider. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • 2.0 breaking change. Cant figure it out.
    ... If you create a new RSA, ... private const int magic_size = 4; ... RSACryptoServiceProvider rsa = GetRSAFromSnkBytes; ... RSAParameters ret = new RSAParameters; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Suggested additional constructor for RSACryptoServiceProvider
    ... Since we're on the subject of the RSACryptoServiceProvider class, ... generates new RSA public/private transient key-pairs each time invoked. ... creates a persistent key container with the name ... >> constructors support initializing with existing RSA credentials using ...
    (microsoft.public.dotnet.security)
  • RSA maximum key size
    ... I have a question about what key lengths are supported by RSA ... encryption in .Net. ... RSACryptoServiceProvider RSA = new RSACryptoServiceProvider; ... asking is whether the .Net libraries are actually capable of supporting the ...
    (microsoft.public.dotnet.security)