Click here to Skip to main content
15,881,882 members
Articles / Silverlight

Obfuscating Silverlight

Rate me:
Please Sign up or sign in to vote.
2.33/5 (3 votes)
16 Sep 2010CPOL1 min read 15.6K   3   3
Obfuscating Silverlight

“Obfuscation is the concealment of intended meaning in communication, making communication confusing, intentionally ambiguous, and more difficult to interpret.”

Obfuscation has been used in programming for ages helping protect intellectual property! WPF and Silverlight is a little more tricky to obfuscate because of the way XAML work! While searching for a solution, I found that Dotfuscator does support Silverlight XAML & WPF BAML obfuscation.

“With XAML Obfuscation, developers can protect Intellectual Property and prevent tampering by renaming XAML resources, trim and compress Silverlight assemblies to optimize load time and performance, and automatically re-sign assemblies. Developers can fully obfuscate and instrument Silverlight XAP files resulting in a streamlined automated build process.”

WARNING: Dotfuscator is NOT a FREE tool

Let's try it out! What I have done is created an extremely simple Silverlight application. Next, I opened Dotfuscator and added my XAP to the project and obfuscated it (I left all the settings on their defaults) and compared the 2 XAPs.

The original XAP is 3,730 bytes and the obfuscated XAP is 4,134 bytes… Let's open it with reflector and compare.

Here is the MainPage un-obfuscated:

And here is the same page obfuscated:

Here is the un-obfuscated XAML:

And here is the same XAML obfuscated:

Dotfuscator has hundreds of settings to control the way it obfuscates code… so play with the settings and let me know what you think!

PS. Dotfuscator is not the only tool that has some XAML support… If you find any other that you like, please let me know!!!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
South Africa South Africa
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
Member 160649019-Dec-12 0:44
Member 160649019-Dec-12 0:44 
GeneralMy vote of 1 Pin
redcheek23-Sep-10 16:24
redcheek23-Sep-10 16:24 
AD .no use.
GeneralMy vote of 1 Pin
S.H.Bouwhuis20-Sep-10 22:23
S.H.Bouwhuis20-Sep-10 22:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.