Obfuscating your code with SmartAssembly
Published 31 December 2012
SmartAssembly allows you to obfuscate your code in many ways.
For maximum protection, you should enable as many of the different types of obfuscation as possible.
Protecting several assemblies without merging them
SmartAssembly creates one assembly at a time. If you want to obfuscate several assemblies without merging them, see Protecting several assemblies.
Warning:
Your application may stop working if you apply some types of obfuscation at too high a level.
You may need to experiment with the appropriate options, and set up any exclusions, depending on your code. For guidance, see Troubleshooting after building.
SmartAssembly offers the following types of obfuscation:
- Strong name signing
Provides some protection against modification for your application. - Dependencies merging
Embeds dependencies, for example DLLs, inside your assembly so that the dependencies are obfuscated in the same way as the main assembly. - Dependencies embedding
Packs dependencies inside your assembly and unpacks them at runtime. You can compress and encrypt the dependencies.
Use this when you cannot merge a dependency. - Pruning unused code
Removes code that can never be run and some metadata. - Name mangling
Changes the names of your classes and methods to unreadable characters. - Control flow obfuscation
Changes the code inside your methods into 'spaghetti code', which is hard for a human to follow. - References dynamic proxy
Creates a proxy to hide the eventual destination of external calls from your application. - Resources compression and encryption
Makes your code harder to understand by encrypting resources. - Strings encoding
Encodes strings, making it hard to understand your code by following the references to a known string. - MSIL Disassembler protection
Prevents ildasm.exe from opening your assembly.
The available features may depend on the type of assembly you have selected in your project.