4

I have seen many C# obfuscators, and they all need an assembly (.exe, .dll, etc.) Why isn't it possible to just obfuscate the source code? Like you can do with javascript for example: http://www.javascriptobfuscator.com

3
  • 6
    I know at least two persons who can do the job, easily! Commented Aug 17, 2012 at 15:57
  • 2
    Why obfuscate source code when you can just... not give it them at all... Commented Aug 17, 2012 at 15:57
  • Why is it not possible? It is obviously possible. There's just no product available that does it. There's no real question here. Commented Oct 30, 2013 at 20:09

3 Answers 3

4

It doesn't make any sense to obfuscate source code. That's because source code is shared for maintainance or experience sharing. That's why obfuscation targets deployable artifacts, like exe or dll...

In case of JavaScript the code itself is deployable artifact, so for Java Script it has a perfect meaning for intellectual property protection.

Sign up to request clarification or add additional context in comments.

1 Comment

It doesn't make sense to challenge the question. It can be an academic ask. Not everything has a business reason.
2

You obfuscate what you release to the customer, not what you have to keep clear so that you can maintain it.

You release javascript files, you obfuscate them (and keep the non obfuscated ones to maintain the application). So you have two sets of javascript files : the source and the released. If there was a distinct released compiled format, this would probably be the obfuscation target.

You release .class files, not .java files, so you obfuscate the .class.

You release exe, not c or c# files, so you obfuscate the exe.

Other concrete reasons :

  • a C or C# file (or java) may be used in different applications. And the content that may be stripped or changed will be different depending on the application
  • a C, C# or java file contains items necessary for the compilation that can't be stripped only in one file : you have to obfuscate the whole set (for example, if you rename a class or a visible field, you usually maintain in memory a table while obfuscating).

Comments

0

I agree with @dystroy, in that you obfuscate what you release.

But to directly answer the question posed-- b/c so few people release C# code.

If you need to release C# code, AND you wish to obfuscate it, I recommend a one-two punch of:

  1. Make "internal" all types not needed to be "public"
  2. Compile your assembly containing the source code to be released
  3. Use RedGate SmartAssembly to obfuscate that assembly.
  4. Use JetBrains dotPeek to reveal the obfuscated source code, and dump to disk.
  5. Zip obfuscated source code and release it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.