Home

Awesome

CSharp Obfuscator

CSharp Obfuscator protects your .NET application code through obfuscation transforms, while maintaining debugging abilities for quality assurance testing. This is made possible by the Roslyn open source project.

Features

Renaming

Rename obfuscation applies trivial names, as short as a single character, to methods, variables, classes, and fields that allow code readability. obfuscation

Scrambling Strings

CSharp Obfuscator extracts all strings and puts them in a seperate source file. All strings are serialized and encoded, which blocks the hacker from locating the critical method by searching for keyword strings. For further protection, you can encrypt the strings using your unique key.

Before

string1

After

string2

string file

string3

Encrypt strings with an extension DLL

Integrate with the existing development cycle

CSharp Obfuscator obfuscates your source code, so you can run full quality assurance tests even after your source code has been obfuscated, ensuring that your code is both tested and protected. It will also update Xamarin XAML files with the obfuscated code.

flow

It can be seamlessly integrated with the exising development cycle when each c# project only targets one framework. If a c# project targets multiple framework, you need obfuscate the project for each framework seperately.

Versions

Both free and premium versions are available. Please check NorWest Solution for details.

Command Line

Usage: cso.exe [MSBuild options] [Options]
    
MSBuild options: the same options when you use MSBuild.exe to build your solution.

Options:
-activate:account={account};sn={sn}        Activate your license
-deactivate                                Deactivate your license
-config:{file}                             A file containing the obfuscation configuration and rules

Obfuscation Configuration File

Configuration

NameValueNote
MSBuildPathpath of MSBuild.exeSpecify the path if you have more than one MSBuild.exe installed
ObfuscateallBy default, all public declarations will not be obfuscated. Use this option to obfuscate all declarations.
UseASCIItrueBy default, declarations will be obfuscated with symbol characters. Use this option to obfuscate all declaration with ASCII characters.
Reservecomma separated word listReserved keywords
ASCIIcomma separated word listUse ASCII characters for the matched declaration
Suffixany letter that is allowed to be used as a declaration nameThe suffix of an obfuscated declaration.
Prefixany letter that is allowed to be used as a declaration nameThe prefix of an obfuscated declaration.
ReusetrueSave the obfuscation result into a file (cso.db). Reuse the file for your next obfuscation.
Extensionpath of the extension assemblyUse the extension assembly to encrypt strings.

Rules

Use rules to skip the obfuscation of matched declarations. Use the following format to define a rule:

keep {type} {pattern}

A pattern should be the fullname of a declaration and can use an asterisk (*) as the wildcard, such as

keep namespace *.Tests
Available rules
NameNote
projectskip processing matched projects
file:stringdoes not extract strings from matched files
namespacekeep declarations within the matched namespace
namespace:namekeep the namespace name only
typekeep declarations within the matched type, it could be a class, enum or interface
type:namekeep the type name only
methodkeep declaration within the matched method
method:namekeep the method name only
method:parameterkeep method parameters
propertykeep property
variablekeep field variable
enum:valuekeep values of an enum
anycomma separated word, does not support wildcard