Home - Forums-.NET - Spices.Net - Recommendations for a commercial class library

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

Recommendations for a commercial class library
Link Posted: 21-Jan-2007 07:28
I am creating a class library meant for commercial distribution.  Since its public members will be used by others, what are the recommended settings to use from the command line tool? I would like the member names to be available, but I want the contents to be obfuscated.

Thanks for your help.
Link Posted: 21-Jan-2007 10:44
[list=1]
  • If you plan to allow inheritance of some classes of your assembly please use ObfuscationOptions.Members = KeepInheritance, otherwise use KeepSerialization (if assembly uses serialization/reflection, some classes can be used at desgin time) or DefaultImproved modes.
  • [/*:m]
  • NamespaceRestructuring = AllTypesOneNamespace to decrease size of the assembly and place obfuscated classes to the single namespace.
  • [/*:m]
  • Naming = NumbersAndNonDisplayable to prevent from ILASM/ILDASM rountrip and provide more shorten names for the obfuscated members.
  • [/*:m]
  • Optimizer.Properties, Optimizer.Events, Optimizer.Parameters set to Obfuscated to optimize your assembly by size - remove unused members from metadata.
  • [/*:m]
  • StringEncryption = Encrypt to encrypt strings and prevent assembly from tampering.
  • [/*:m]
  • antiILDASM = True to prevent assembly from disassembling.
  • [/*:m][/list:o]
    Link Posted: 21-Jan-2007 11:18
    Thanks for the quick response.  I tried your recommendations, but it didn't quite work for me.  

    I created another project, added a reference to my new obfuscated dll, and then tried to use a class from the obfuscated dll.  While everything seemed fine at design time, when I compiled my application I received the error that the namespace from the obfuscated dll could not be found.
    Link Posted: 21-Jan-2007 11:35
    Seems that you've used some protected members to override in your application. In this case try to use ObfuscationOptions.Members = KeepInheritance mode, this mode doesn't obfuscates overridable members (internal protected, protected, etc).
    Link Posted: 21-Jan-2007 13:14
    I don't believe there are any protected members.  I created a test class that has one private method and one public method that does nothing more than call the private one.  My external app is trying to call the public method.

    But in the case that your solution can solve my problem, is there a way to specify that on the command line interface?
    Link Posted: 21-Jan-2007 13:21
    The best way - creating the Spices.Project by spices.net evaluation version or by using utility that included into Spices.Obfuscator console and use this spices.prject with Spices.Obfuscator Console.
    Link Posted: 21-Jan-2007 15:29
    I don't mean to seem obtuse, but I don't understand how to do that in the Spices.Net application.  Is there a certain place I can look in the documentation to find out where to change those settings?
    Link Posted: 22-Jan-2007 09:26
    You can see the:
    [list]
  • Video tutorials (you can find videos on the Spices.Obfuscator product page) that help you to familiarize with Spices.Obfuscator and specify obfuscation properties.
  • [/*:m]
  • Spices.Net Manual, Spices.Obfuscator\\Spices.Obfuscator Walkthrough and another articles related to Spices.Obfuscator.
  • [/*:m]
  • Articles that you can find on the Spices.Obfuscator product page
  • [/*:m][/list:u]
    Link Posted: 22-Jan-2007 16:06
    Thank you for your patience.  The video was very helpful.  Unfortunately, though, I'm still having a problem.  Instead of my namespace not being found, it's the obfuscated class that \"could not be found\" when I try to compile. Any ideas?

    Let me explain my test scenario again just make sure you understand what I've done.

    I created a class library.  I then created a console app.  I obfuscated the class library (as you instructed me to) and added a reference to it in the console app.  When I try to reference a class from the class library in the Main of the console app, I get a \"type or namespace could not be found\" error with blue squigglies under the name of the class when I compile.  Intellisense can find the class and is happy with it, but the compiler doesn't seem to like it.
    Link Posted: 23-Jan-2007 05:45
    Instead of my namespace not being found, it's the obfuscated class that \"could not be found\" when I try to compile. Any ideas?

    I need to see your obfuscations options to more precisely answer.
    Probably you have obfuscated public and overridable members that have used in the external assembly. Please check the ObfuscationOptions.Members to exclude these types of members.

    I created a class library. I then created a console app. I obfuscated the class library (as you instructed me to) and added a reference to it in the console app. When I try to reference a class from the class library in the Main of the console app, I get a \"type or namespace could not be found\" error with blue squigglies under the name of the class when I compile. Intellisense can find the class and is happy with it, but the compiler doesn't seem to like it.


    Can you send us () your spices.prject used for obfuscation to give you recommendations?