How can I obfuscate my c# code, so it can't be deobfuscated so easily?
You could have a look at the many obfuscation tools that are out there, for example these:
- http://gapotchenko.com/eazfuscator.net
- http://orangeheap.blogspot.nl
http://confuser.codeplex.com (succeeded by https://yck1509.github.io/ConfuserEx/ and then again by https://github.com/XenocodeRCE/neo-ConfuserEx)
http://ntoolbox.com)
Best method to obfuscate or secure .Net assemblies
This is a pretty good list of obfuscators from Visual Studio Marketplace
Obfuscators
- ArmDot
- Crypto Obfuscator
- Demeanor for .NET
- DeployLX CodeVeil
- Dotfuscator .NET Obfuscator
- Semantic Designs: C# Source Code Obfuscator
- Smartassembly
- Spices.Net
- Xenocode Postbuild 2006
- .NET Reactor
I have not observed any performance issues when obfuscating my code. If your just sending text basted stack traces you might have a problem translating the method names.
Obfuscating source code when publishing (C#)
Dotfuscator Community Edition is installed along with Visual Studio Professional or higher versions. The Community edition, however, is a hobbyist or introductory version that only allows you to obfuscate the code to a degree by simple renaming of all members, is not integrated within VS and does not allow for robust features such as string encryption.
Prevent Decompiling
You cannot prevent decompiling, if you compile into MSIL (intermediate language). In such case you need to use obfuscation
For a deeper discussion on the subject check out this post .NET obfuscation tools/strategy
You can find a similar discussion here How can I obfuscate my c# code, so it can't be deobfuscated so easily?
You can also opt to generate a native image using Ngen.exe for a specific platform - that will bypass the IL and generate compiled processor specific machine code, and that one is pretty much safe from standpoint of reverse - engineering.
Using an IL is a quite common design choice - and it has it's drawbacks and benefits - the main ones being easier support of multiple languages on one platform, and multiple target platforms, i.e cross platform
To get a glimpse of some of the benefits of using IL - check this out - stackoverflow.com/questions/1926386/…
Java also uses an intermediate language - java bytecode - javaworld.com/article/2077233/core-java/bytecode-basics.html
Related Topics
On Postback, How to Check Which Control Cause Postback in Page_Init Event
Hashtable with Multidimensional Key in C#
Cannot Close Excel.Exe After Interop Process
Recursive Hierarchy - Recursive Query Using Linq
What Does It Mean for a Property to Be [Required] and Nullable
How to Mark a Method as Obsolete or Deprecated
Why Are Private Fields Private to the Type, Not the Instance
What Does |= (Single Pipe Equal) and &=(Single Ampersand Equal) Mean
How to Determine for Which Platform an Executable Is Compiled
The Input Is Not a Valid Base-64 String as It Contains a Non-Base 64 Character
How to Add an Extra Button to the Window's Title Bar
What Is the Algorithm to Convert an Excel Column Letter into Its Number
How to Convert Datatable to JSON String Using JSON.Net
Why Is Array.Length an Int, and Not an Uint
Are There Any Suggestions for Developing a C# Coding Standards/Best Practices Document
What .Net Collection Provides the Fastest Search
Cannot Set Some Http Headers When Using System.Net.Webrequest