.Net security noob here... What is the simplest way to prevent someone else from loading my assembly?
Background: Although I am really looking for just 'good enough' protection (with enough time/money/smarts someone can successfully crack, hack and attack), this seems like it should already be a solved problem and I'm just missing it.
Here is what I (think) I know:
While strong naming can be used a layer of security, it wasn't necessarily intended to be, according to this microsoft documentation (see Warning: Do not rely on strong names for security. They provide a unique identity only.)
On that^ note I have encountered situations where I wasn't able to load a third party assembly (Aspose I think it was) because they did not sign their assemblies, however all of mine were. So I had to ildasm their assembly, sign it with our own snk, then ilasm back) in order to use their library. So, strong naming doesn't seem like a good security mechanism to me. HOWEVER...what about a simple check, in code, to verify that the calling assembly is signed with the my public key token? Is this effective enough?
If strong naming shouldn't be used for what I'm trying to accomplish, is implementing an Authenticode digital signature check on the dll the better a route (seems wintrust.dll can help with this)?
I've been going through a several vendors' tooling for obfuscation and many come with licensing and all kinds of stuff. I will likely use a little bit of obfuscation to hide some sensitive parts, however I would still like to have a mechanism for preventing someone from loading my sensitive library, without having to use features such as string and code encryption, which often come with performance (and other) costs.
So back to the question, What is the simplest way to prevent someone from loading my assembly?