Whenever it comes to Dll security, all the results on online search talk about obfuscation. Now, my question is that is there anything more than obfuscation that we can do to make our assemblies more secure and immune to re-engineering?
The reason I am asking is that because I am preparing for a code security presentation and I know that de-obfuscation happens and if you throw people determined enough to spend their time in re-engineering any code than they will end up doing it. Moral of the story is that obfuscation is not a full-proof solution, it just makes it hard to re-engineer the code. But if we combine obfuscation with some other technique then it will make it even harder.
Any suggestions?
Unfortunately, there is NO way to ensure that nobody will be able to decompile your code. The root problem is really that the code sits on a user-controlled machine can be fully analyzed by anyone with sufficient knowledge, patience and time, and get a somewhat legible source code from the binaries. The computer itself is able to decode and run it, so people are too.
Obfuscation, encryption, packaging or anything else will only give problems to potential hackers, but none of the are really impossible to bypass, you're just raising the bar. This not only happens on .NET, but in all and every programming language, decompilation is always possible, just more difficult or easy, and because the binary sits on a place where the user can read it.
The only safe measure is to put the binaries in a place where the user cannot even read them, which usually means a computer that you control, totally inaccessible to users directly. A web service is a classical approach to this problem, where your web page runs the code, and the user only has a tiny client program, or even just a browser. Of course, that has enormous implications on the way you deploy and the infrastructure they need or want to have, but it's the tradeoff to pay for code security.