Protect your Blazor WebAssembly app against decompiling

Publish with AOT, and TrustSig Protect obfuscates and virtualizes the WebAssembly to protect your C# logic against decompiling.

01The problem

Blazor WebAssembly apps can be decompiled back to C#

A Blazor app publishes into files the browser downloads.

  1. A default publish sends .NET assemblies to your visitors, and they sit in the browser cache.

  2. Free decompilers read those assemblies back into something close to the C# you wrote.

  3. Class names, method names and your licence-check logic come back with them.

02Start with AOT

Publish with AOT, then protect the WebAssembly

AOT compiles your C# into WebAssembly before it reaches the browser.

  1. Turn AOT compilation on in your publish profile and your methods are compiled into WebAssembly.

  2. Protect works on that WebAssembly, which is where your compiled logic lives.

  3. A default interpreted build is not covered, so run the AOT publish first.

03Obfuscation

Protect your app against static analysis with obfuscation

Names are removed and the structure of your code is hidden.

  1. Function, import and export names are stripped or randomised.

  2. Control-flow flattening hides the order your code runs in.

  3. Opaque predicates add fake decision points that mislead analysis tools.

04Protections

What TrustSig Protect adds to your publish

Virtualization
The methods you pick run as bytecode in a virtual machine unique to your build.
Control-flow flattening
Hides the order your code runs in.
Symbol scrubbing
Function, import and export names are stripped or randomised.
Polymorphic builds
Each publish comes out different, down to the layout of the bytecode.
String encryption
Sensitive values stay encrypted and are decrypted only when they are used.
Anti-debugging
Detects breakpoints and single-stepping while your app runs.
05 Questions

Blazor WebAssembly, answered

Protect works on the WebAssembly an AOT publish produces, so turn AOT compilation on before you protect a build.

Yes, the runtime still needs them. Protect covers the WebAssembly your AOT publish produces, which is where your compiled methods live.

Yes. Protect ships an engine for JavaScript as well, so interop code and anything else you choose gets the same treatment.

Only the methods you choose run inside the engine, so the rest of your app runs at the speed AOT gave it.

06Contact

Talk to us

Tell us what your Blazor app does and what needs protecting. We will get back to you by email.