Babel Obfuscator
HomeDocumentationShop
  • Introduction
    • General Features
  • Getting Started
    • Install
    • Product Activation
  • Command Line
    • Command Line Reference
      • Miscellaneous
      • Input Files
      • Output Files
      • Plugins
      • Merge and Embed
      • Renaming
      • Control Flow Obfuscation
      • Encryption and Protection
      • Code Generation
  • MSBuild Task
    • Babel Task Reference
    • Customizing Intellisense
  • NuGet Package
    • NuGet Pakage Reference
  • User Interface
    • Obfuscation
    • Tools
    • Custom Themes
  • Obfuscation Rules
    • XML Rules
      • Example Rules
    • Custom Attributes
    • Obfuscation Agent
  • Merge and Embed
    • Assembly Merging
    • Assembly Embedding
  • Symbols Renaming
    • XML Map Files
    • Cross Assembly Renaming
    • XAML Renaming
    • Decoding Stack Traces
  • String Encryption
    • Custom String Encryption
  • Control Flow Obfuscation
  • Code Encryption
    • External Code Files
    • Password Protected Code
    • Dynamic Code
  • Dynamic Proxy
  • Resource Encryption
  • Value And Array Encryption
  • Tampering Detection
  • Anti Debugging
  • Enhancing Code Security
  • Optimizations
    • Dead Code Removal
    • Metadata Optimizations
    • Code Optimizations
  • Appendix
  • Examples
    • Examples
    • General Samples
      • ClickOnce Deploy
      • Detecting Babel Obfuscation
      • Obfuscate .NET MAUI
      • Blazor Web App
    • Code Encryption
      • Feature Based Licenses
    • Cross Assembly Renaming
      • Publish .NET App
    • Build Servers
      • GitHub Actions
      • Unit Tests
    • Babel Obfuscator NuGet
      • Android Application
  • Plugins
    • Babel Obfuscator Plugins
    • Encrypt Plugin
      • Getting Started
      • Source Code
Powered by GitBook
On this page
  • Build Instructions
  • Changing the Code
  • Source Files
  • Debugging the Plugin

Was this helpful?

  1. Plugins
  2. Encrypt Plugin

Source Code

The plugin is distributed with full C# source code. To build the plugin from the source code, you need the following:

  • Visual Studio 2022 or greater

  • The latest release of Babel Obfuscator Enterprise or Company editions

Build Instructions

Open the Visual Studio solution file, Babel.BabelEncrypt.sln and build the project. The plugin project references babel.exe from the Babel install folder, typically C:\Program Files\Babel. If the babel.exe reference is not found, please remove the reference and add babel.exe from your local Babel Obfuscator install folder.

Changing the Code

If you plan to modify the source code, this resource provides a quick reference and helpful tips to ease your entry and ensure a smooth start.

Source Files

The Encrypt Plugin project contains the following files.

EncryptPlugin.cs

This file contains the EncryptPlugin class that implements the Babel plugin interface. The plugin registers the string encryption service class used by Babel Obfuscator to encrypt strings. The arguments passed at the babel command line are processed here when the plugin is initialized.

StringEncrypter.cs

The StringEncrypter class provides the string encryption service. It contains code for integrating the decrypter with the obfuscation target and implements the encryption methods for XOR and HASH algorithms. The Encrypt(...) method serves as the entry point, called by Babel Obfuscator during the string encryption phase, where the string is then processed by the XOR or HASH encrypter. Upon completion of the encryption phase, the Terminate() method is invoked to store the encrypted data within the target. The embedded decryption code will retrieve the encrypted data in the obfuscated target at runtime.

StringDecrypter.cs

This file contains all the decryption logic that will be merged with the target assembly. As the classes inside this file are to be compiled and merged during the execution of the plugin, this file is compiled as an Embedded Resource of the DLL plugin.

To temporarily check the code syntax or make any code changes, you can switch the Build Action from Embedded Resource to Compile. After making all the changes, you can switch back to Embedded Resource and start debugging your changes.

Debugging the Plugin

To debug the plugin, open Babel.BabelEncrypt project properties, select the Debug property page and create a new profile. Then set the following configuration:

Executable

C:\Program Files\Babel\babel.exe

Command line arguments

MyApp.exe @ -v5 --stringencrypt custom --plugin BabelEncrypt.dll

Where MyApp.exe is the target assembly that will be obfuscated using the plugin.

Last updated 2 years ago

Was this helpful?

Debug Configuration