SmartAssembly - 6.6

SmartAssembly

Encoding strings - SmartAssembly

Managed software stores all the strings in one place and in a clear structure. This makes it easy to find the strings in a decompiled assembly. By following the references to these strings, it may be possible to understand the purpose of your code, even after obfuscation.

String encoding protects against this.

Using string encoding

To encode strings, in the Project Settings window, go to Strings Encoding or click the icon in the toolbar.

Select I want to hide important information by encoding all the strings in my software.

Strings encoding options

The following strings encoding options are available:

I want to use strings encoding with improved protection

Protects against assembly modification.

Note: You cannot use this feature if you use another tool to modify your assembly after SmartAssembly.

You cannot use this option with assemblies using any version of Compact Framework, Silverlight, Windows Phone 7.x XNA, Xbox XNA, or Windows Phone 7.x.

I want to compress and encrypt the encoded strings

Improves protection and reduces assembly size.

You cannot use this option with assemblies using Xbox XNA.

I want my application to cache strings when decoded

Enables strings to be loaded quickly.

You can use this option with all of the technologies supported by SmartAssembly.

The strings are automatically decoded, when needed, at runtime.

When string encoding is enabled, the colored bars under the toolbar icon and to the left of the feature options are green. If it is disabled, the bars are orange.

Note: for SQL CLR assemblies, you cannot use 'I want to use strings encoding with improved protection' or 'I want to compress and encrypt the encoded strings'.

String encoding examples

The examples below show the effect of encoding three strings within an assembly:

Before string encoding:

"Fred.gate@hotmail.com"
"p@ssw0rd1"

"licensingUrl=http://licensing.red-gate.com/licensingactivation.asmx"

After string encoding:

"FNRFk1TTJZM016VTPQ==.bmV1dSBzcGVjaWZpZWQ9sbGVjdGlvbi4=L"

Note that enums are normally obfuscated, but you would not want an obfuscated enum value to be displayed in your UI. SmartAssembly assumes that enum values which have Format, GetName, GetNames, Parse, or ToString called on them will be displayed to users, and so these enums are excluded from obfuscation automatically.

Was this article helpful?

Search support
Forums
Visit the SmartAssembly forum.

SmartAssembly

all products