Does Signing an exe makes the communication slow?

341 views Asked by At

Scenario

I have a C# executable, signed using strong key. From this C# application I'm invoking C++ execuatbles(Which are not signed), using 'pinvoke'. I observe there is significant delay in the exceution of the C++ executables. Is there any reason for this?

1

There are 1 answers

0
Oleksii G. On

Please, refer the neighbor answer at How do I strongly name an Unmanaged C++ Dll

In general, strong name for assembly, is only a checksum, that nobody has changed/hacked/injected into your code (injection could be something like virus or trojan app). It is not very safe protection of code, that's why it does not need a lot of time to complete all tests on assembly. Surely, signed code, will take a bit more time to be loaded, than simple assembly.

On the other hand, PInvoke, is like a web-service call, where .Net code don't mind if that code is safe or not. Here delays could be only if you have many arguments, and argument types are coming with some 3rd party structures from some big signed assemblies. And here you may see some little time delays, because those big assembly is loaded into memory, types are checked, and PInvoke is made.

Maybe, you should try to move all classes and structures from many assemblies into one, and use there PInvoke. So, in this case, you will not need to load many assemblies.