Symbol Renaming All Tiers
Symbol renaming is the foundation of .NET obfuscation. Demeanor replaces all type, method, field, property, event, and parameter names with short, meaningless identifiers. The IL remains structurally valid and executes identically — but decompilers produce unreadable output.
Usage
| CLI | MSBuild | Tier |
|---|---|---|
| (enabled by default) | <Obfuscate>true</Obfuscate> | Community+ |
--no-types | <ObfuscateNoTypes>true</ObfuscateNoTypes> | Disable type renaming |
--no-methods | <ObfuscateNoMethods>true</ObfuscateNoMethods> | Disable method renaming |
--no-fields | <ObfuscateNoFields>true</ObfuscateNoFields> | Disable field renaming |
--no-properties | <ObfuscateNoProperties>true</ObfuscateNoProperties> | Disable property renaming |
--no-events | <ObfuscateNoEvents>true</ObfuscateNoEvents> | Disable event renaming |
--no-parameters | <ObfuscateNoParameters>true</ObfuscateNoParameters> | Disable parameter renaming |
--names Unicode | <ObfuscateNamingMode>Unicode</ObfuscateNamingMode> | Enterprise |
Before & After
public class PricingEngine
{
private readonly decimal _basePrice;
private readonly string _currency;
private decimal _discount;
public decimal BasePrice => _basePrice;
public string Currency => _currency;
public void ApplyDiscount(DiscountType type, decimal amount) { ... }
public decimal CalculateTotal(int quantity, TaxRegion region) { ... }
public string FormatReceipt(int quantity, TaxRegion region) { ... }
}public class f
{
private decimal m_a;
private string b;
private decimal c;
decimal a() => m_a;
string a() => b;
void a(g a, decimal a) { ... }
decimal a(int a, h a) { ... }
string a(int a, h a) { ... }
}Real ILSpy output from samples/DocSample. All type, method, field, and parameter names replaced with single-letter identifiers. Methods share the same name a (resolved by signature at runtime). Property metadata stripped.
How It Works
Demeanor assigns sequential names (a, b, c, ...) within five independent ECMA-335 naming scopes: type names, method names per type, field names per type, property names, and event names. This produces the shortest possible names while respecting the CLR's name resolution rules.
At Enterprise tier, Unicode mode replaces names with Canadian Aboriginal Syllabics (U+1401-U+167E) — valid CLI identifiers that render as obscure glyphs on most systems and cannot be typed in a source editor.
When to Disable
- Reflection by name — code using
Type.GetMethod("MethodName")or data binding by property name will fail if those names are renamed. Use[Obfuscation(Exclude = true)]or--excludeto protect specific symbols. - Serialization —
JSON.NET,System.Text.Json,BinaryFormatter, and XML serialization resolve members by name. Use--no-serializableor attribute-level exclusions. - Public library API — public types and members are preserved by default in library DLLs. Use
--include-publicsonly for executables.
Ready to protect your .NET code?