0

How can I be sure that my referenced dll(which is compiled by me) is not changed by someone else after distribution for bad purposes?

And if possible to understand this, is there a way to force not-loading changed dlls.

An example, I have a library which is packed as .net dll. Someone can easily change it, or create dll with same name, namespace, method name etc. and than can execute his malicious code. How can we prevent this?

AFgone
  • 1,172
  • 4
  • 16
  • 31
  • 1
    •If someone have full access to a system and your dll, then you can not do much to prevent they from changing the assembly. Anyway you can [sign](https://msdn.microsoft.com/en-us/library/xc31ft41(v=vs.110).aspx) dlls. But keep in mind the one who can inject something is dll, can disable checking the signature. •If the concern is about the exact dll which you are using and you want to see if it is original or not, you can compare it's checksum with checksum of an original dll. – Reza Aghaei Nov 05 '16 at 13:11

1 Answers1

1

You sould sign your dlls.

See C#: why sign an assembly?

Then in your project check the key

GetType().Assembly.GetName().GetPublicKey()
Community
  • 1
  • 1
MSL
  • 990
  • 1
  • 12
  • 28