Obfuscating application code for deployment

Last reviewed: 6/1/2012

HOW Article ID: H061201

The information in this article applies to:

  • GrammarKit 4
  • LexiconKit 4
  • ProfileKit 4
  • SpeechKit 7
  • VoiceMarkupKit 4


Code obfuscation is an important step in packaging applications for deployment written in bytecode languages such a C#, Java, and VB .NET.

There are variety of techniques and approaches used by code obfuscation tools to make it difficult to reverse engineer code back to its original source form.

In addition to securing code from tampering, obfuscator tools also offer packaging features such as code signing and file merging.

More Information

There are several open source and licensed obfuscation tools available:

The following example illustrates how to package the sample SpeechKit .NET Synthesis application using .NET Reactor from Eziriz:

  1. Launch .NET Reactor to create a project and save it in the Visual Studio project folder (e.g., synthesis.nproj).

  2. Press the Open button to select the application .exe file from the Release folder.

  3. Press the Add button to add two Chant assembly libraries.

    For applications that use SpeechKit COM based SAPI and other speech APIs, select the Chant.Shared.DLL and Chant.SpeechKit.DLL assemblies.

    Obfuscating Synthesis application with SpeechKit Full SAPI COM libraries using .NET Reactor Files tab

    For applications that use SpeechKit managed SAPI, select the Chant.Shared.Speech.DLL and Chant.SpeechKit.Speech.DLL assemblies.

    Obfuscating Synthesis application with SpeechKit Manged SAPI libraries using .NET Reactor Files tab

  4. Check the Embed Assemblies box for both of these libraries. This ensures the libraries are embedded in the .exe as part of the obfuscation process.

  5. Press the Settings tab to select additional options.

    Obfuscating Synthesis application with SpeechKit using .NET Reactor Settings tab

  6. To use a digital code signing certificate (highly recommended), set the code signing files under Digital Certificate.

  7. To sign the assemblies (Signing tab under Visual Studio Project Properties) with a strong name key file, then set the KeyPair File and Password fields under the Strong Name.

  8. Review and adjust and Protection Settings. However, these are automatically set by the Files tab Quick Settings check boxes.

  9. Click the Save Project link to save project settings.

  10. Click the Protect link to run the obfuscator.

To automate obfuscation as part of the build process, run the obfuscator project as a post-build event command line (Build Events tab under Visual Studio Project Properties).

    "C:\Program Files\Eziriz\.NET Reactor\dotNET_Reactor.exe" -project "C:/Users/Chant Development/Documents/Chant SpeechKit 7/Win32/NET WinForms/VS 2010/CSharp/Synthesis/synthesis.nrproj"

Use the same process to obfuscate .NET applications with GrammarKit, LexiconKit, ProfileKit, and VoiceMarkupKit.

For additional help with obfuscating application with Chant libraries, contact Chant Support via Chant Support Contacts or web.