First of all read this: How to protect source code?
Protecting intellectual property
There really is a certain exaggeration in thinking that people will decompile and reuse the code. It’s not that simple and you have to be crazy to do it. I don’t see it happening out there. In simple codes not worth the work, in complex codes decompile does not solve much.
It’s not so true that you can recover the entire original code. In addition to not recovering comments, it does not recover the name of local variables that is also documented. Without these things it complicates the understanding of the code. Also the flow does not come back exactly as it was. Most of the time you will be able to build it again but it will be very difficult to maintain.
No technique is effective, some make it a little difficult. Obfuscation is what works best because it modifies the code to make it more unreadable and make life difficult for decompilers, but it doesn’t make decompilation impossible, it can’t do this.
If you’re still doing this, use one of the obfuscators available for . NET. By experience almost all programmers know that rarely worth the work.
Some of them do a job "so good" that prevents the Assembly function properly. Others generate huge inefficiency of execution.
Protect sensitive data
Obviously, sensitive information should not be placed within the code (passwords, addresses and other information that should be private). This should be outside and should be encrypted (preferably not near the application, inside or outside).
I used IDA and I could see the name of the variables and see the comments of the program.
– Francisco
It’s impossible to see what doesn’t exist.
– Maniero
What do you mean by that?
– Francisco
Exactly what is written, if you have no comments and the names of the local variables in the executable nothing can show it to you. The decompiler will put something he chose only.
– Maniero
I know it wasn’t the meaning of the question or the answer, but there’s a very interesting book about it: Secret Java. It deals, precisely, with reverse engineering techniques and obfuscation of Java code
– Arthur Siqueira