Windows developer tool

.NET code obfuscation

Combine renaming, string encryption, and method virtualization to suit your project. Reuse the same settings in CLI builds.

No subscription · Buy onceView code exclusion examples

Windows x64 · Desktop UI and CLI

Confuser StudioEnglish
Confuser Studio assembly protection workspace in English
Control protection scope

Exclude code where execution speed matters

Set exclusions for frequently called methods and fields whose names must stay unchanged. See how with C# and VB.NET examples.

View code exclusion examples
Why obfuscate code?

Compiled .NET DLLs and EXEs can be decompiled into readable code

Managed .NET DLLs and EXEs built from C#, VB.NET and other .NET languages retain IL and metadata. A decompiler can use them to reconstruct readable calculations and strings. The example below shows how method virtualization and string encryption change that view.

Original DLL decompiled

The example's discount and shipping calculations and message strings are visible.

Protected DLL decompiled

In the same example, the calculation becomes a VM call and the message strings become protected read calls.

Matching C# and VB.NET source examples

C#
internal static class PriceCalculator
{
    internal static int CalculateTotal(
        int unitPrice,
        int quantity,
        bool isMember)
    {
        int subtotal =
            unitPrice * quantity;
        int discount = isMember
            ? subtotal / 5
            : subtotal / 20;
        int shipping = subtotal >= 50000
            ? 0 : 3000;
        return subtotal - discount
            + shipping;
    }

    internal static string DescribeDiscount(bool isMember)
    {
        string discountMessage = isMember
            ? "Member discount: 20%"
            : "Standard discount: 5%";
        return discountMessage;
    }
}
VB.NET
Friend NotInheritable Class PriceCalculator
    Friend Shared Function CalculateTotal(
        unitPrice As Integer,
        quantity As Integer,
        isMember As Boolean
    ) As Integer
        Dim subtotal As Integer = unitPrice * quantity
        Dim discount As Integer = If(isMember,
            subtotal \ 5, subtotal \ 20)
        Dim shipping As Integer = If(subtotal >= 50000, 0, 3000)
        Return subtotal - discount + shipping
    End Function

    Friend Shared Function DescribeDiscount(
        isMember As Boolean
    ) As String
        Dim discountMessage As String = If(isMember,
            "Member discount: 20%", "Standard discount: 5%")
        Return discountMessage
    End Function
End Class

String encryption protects the values assigned to a variable, not its name. The method that returns the discount message is excluded from VM protection so you can see the change to its strings.

Decompiled result of the original filedotPeek · Demo.PriceApp.dll
dotPeek decompiling the original DLL and showing calculations and discount strings
The original DLL shows the discount and shipping calculations and the ‘Member discount: 20%’ message. Select the image to enlarge it.
Decompiled result of the protected filedotPeek · Demo.PriceApp.dll
dotPeek decompiling the protected DLL and showing VM and ProtectedStrings.Read calls
The protected DLL shows a VM call in place of the calculation and ProtectedStrings.Read(...) calls in place of string values. Select the image to enlarge it.

Make protection part of your release workflow

Make your logic harder to inspect, check that your app still works, and carry your settings into the next build.

Assembly protection

Make your logic harder to follow

Apply renaming, string encryption and control flow obfuscation to make the intent of your code harder to read from distributed assemblies.

Release review

Keep errors traceable after protection

Preview your deployment files and use name mappings to restore readable names in obfuscated stack traces. Keep the mapping for each build you release.

Build automation

Reuse your settings in the next build

Save your desktop settings in a project and reuse it from the CLI. Add protection to your build process without selecting every option again.

Core protection features

Choose protection that fits your code

Apply method protection to important calculations and encryption to strings and resources. For frequently executed code, compare its speed with the original and adjust the protection you apply.

Diagram of method code converted into VM instructions
Protect critical logic

Method virtualization

Supported methods become separate instructions executed by the protection runtime. Apply this to important calculations and test performance in frequently run code.

View setup guide
Diagram of readable names and branching becoming obfuscated
Protect code structure

Renaming and control flow obfuscation

Change eligible type and member names and method branch flow. Check behavior before and after protection where reflection or serialization depends on names.

View setup guide
Diagram of strings and embedded resources being protected
Protect data

String and resource encryption

Protect eligible string literals and resources embedded in the assembly. Check that the first screen, images and localized resources load correctly.

View setup guide
Diagram of integrity and debugger checks around an assembly
Runtime protection

Debugger and tamper detection

Choose debugger detection and file integrity checks to fit your deployment and troubleshooting process.

View setup guide

The images are conceptual diagrams. Results vary by assembly and settings.

Control what gets protected

Focus protection where it matters

Exclude selected code where speed or compatibility matters, such as a hot loop or a field accessed by name. Add an Obfuscation attribute to its declaration while keeping protection enabled for the rest of the project.

  1. Choose your protection options. Standard projects honor exclusion attributes in your source by default.
  2. Add the attribute below to the type, field or method you want to exclude.
  3. Rebuild the original project, run protection again, then review applied and excluded items in the private mapping report.
Keep a name unchanged

Exclude a specific field from renaming

Apply this to a field whose name is used by persisted data or reflection. Other eligible fields may still be renamed.

C#
using System.Reflection;

internal sealed class AppState
{
    [Obfuscation(Exclude = true, Feature = "renaming")]
    private string persistedId = "";

    private int workingCount;
}
VB.NET
Imports System.Reflection

Friend NotInheritable Class AppState
    <Obfuscation(Exclude:=True, Feature:="renaming")>
    Private persistedId As String = ""

    Private workingCount As Integer
End Class
Keep a string literal unchanged

Skip string encryption in one method

Use this on a method where first-use string loading matters, such as a startup screen. Its string literals will not be encrypted by this option.

C#
using System.Reflection;

[Obfuscation(Exclude = true, Feature = "strings")]
private static string StartupLabel() => "Ready";
VB.NET
Imports System.Reflection

<Obfuscation(Exclude:=True, Feature:="strings")>
Private Shared Function StartupLabel() As String
    Return "Ready"
End Function
Compare performance

Exclude one method from control flow obfuscation

Apply this to a frequently called calculation method, then compare behavior and execution time before and after protection.

C#
using System.Reflection;

[Obfuscation(Exclude = true, Feature = "controlflow")]
private static int HotPath(int value) => value * 3;
VB.NET
Imports System.Reflection

<Obfuscation(Exclude:=True, Feature:="controlflow")>
Private Shared Function HotPath(value As Integer) As Integer
    Return value * 3
End Function
Preserve compatibility

Exclude VM, body protection and call hiding together

Excluding only VM may leave body encryption or call hiding in place. Include the related features when a method needs ordinary IL.

C#
using System.Reflection;

[Obfuscation(Exclude = true,
    Feature = "ilcodehiding;virtualization;code;calls")]
private static int RenderLoopStep(int value)
    => value * 2;
VB.NET
Imports System.Reflection

<Obfuscation(Exclude:=True,
    Feature:="ilcodehiding;virtualization;code;calls")>
Private Shared Function RenderLoopStep(value As Integer) As Integer
    Return value * 2
End Function

These examples control protection for selected code. App-wide options such as debugger detection and file integrity checks are configured in the project settings.

Read the exclusion and performance guide

See the result on your own app

Your seven-day trial starts on first launch. Try it with your own assemblies, including on an offline PC.

  1. Install Confuser Studio with the Windows x64 installer.
  2. The seven-day trial starts on first launch without registration.
  3. Choose the DLL or EXE, output folder and protection options, then save the project.
  4. Review the protected output and deployment files, and run them in the target environment.

Download

Use the seven-day trial to compare your protected app with the original and check how fast it runs. The Windows x64 installer includes the required .NET runtime.

The trial runs for 7 days from first launch. Protected files created with the trial run for 14 days after creation and are for evaluation, not customer distribution. For a production release, activate a paid license and protect the original build again.

v1.0.34 · SHA-256 eead066f08d9d9b629d0768b8d72e967183942f426566243d613296c47cc46e5

The distributed version of Confuser Studio exits at startup if a monitored decompiler or analysis tool is running. Apply “Exit when a monitored debugger runs” when protecting your own app, and it will also exit automatically when one of those tools is detected.

Buy once. No subscription.

Once you’ve checked your app’s behavior and speed in the trial, continue your release work with a full license.

One license covers one PC and includes updates released during the first two years after purchase. After the update period ends, the last version you became eligible to use remains available on the same PC.

US$99
No subscription fees · No automatic charges
License information