Crypt COM component very slow (General questions)
Hi all,
I try to use the Cryt COM component to sign some data that have to verified on a server with .NET. This seems to work, however, the signature process takes about 10s. I think that this is a very long time and I wonder if this is normal. If it is not, do you have an idea of what I may doing wrong?
Thanks for your help.
Michaël
Re: Crypt COM component very slow
Michael,
I would say this is more/less normal. By definition, sign/verify process (or any operation with assymetric cryptography) is, by definition, VERY long and time consuming process.
But you shouldn't be doing that anyway. You should calculate MD5 or SHA1 digest (which you can be almost sure is unique) and sign that - that operation will be very fast.
From security aspect, you got almost the same level of security.
Of course, when you verify the signature, you must do the same - verify if signature of MD5/SHA1 hash is the same.
Hope I helped!
Kreso
Re: Crypt COM component very slow
Hi kreso,
I do understand that RSA encryption can be time consuming. However, as fare as I know, signing means, more or less, to hash the message with MD5 or sHA1 and then to encrypt this hash with the private key. Therefore, I can't understand why it takes so mutch time to hash 107 bytes and then to encrypt 16 or 24 bytes... do I miss something?
Moreover, it seems that when signing 2 messages, it takes about no time for the second one.
Thanks for your help.
Kind Regards,
Michaël
Re: Crypt COM component very slow
Michael,
oh, I think I know what's the problem. I think it initializes random number generator.
I'll try to duplicate this and see if it can somehow be avoided. Any chance you can send us a sample of what you're doing at techsupport@weonlydo.com so we can easily duplicate the issue?
Kreso
Re: Crypt COM component very slow
Hi all,
I think I've got it... the problem seems to happen only when running in the IDE; once compiled it works like a charm
Thanks for your support!
Kind Regards,
Michaël