Prevent decompiling of the code

T

Torben Laursen

Hi

I need to be sure that my C# code is as hard as possible to decompile.

Can anyone tell what is the best tool for that job?

Also will this be a part of Visual Studio 2008?
It seems natural to me that the .net framework came with a solution so other
people could not see your source code

Torben
 
J

Jon Skeet [C# MVP]

I need to be sure that my C# code is as hard as possible to decompile.

Do you really, really need to? I personally believe a lot of people
are somewhat paranoid on this point. That's not to say it's always an
inappropriate concern, but it often is.

See http://pobox.com/~skeet/csharp/obfuscation.html
Can anyone tell what is the best tool for that job?

Also will this be a part of Visual Studio 2008?
It seems natural to me that the .net framework came with a solution so other
people could not see your source code

Well, there is an MS solution which is very recent (and which I
haven't looked at):
http://www.microsoft.com/downloads/...AA-8B7C-4E3A-AF83-B71B6877705B&displaylang=en

Jon
 
T

Torben Laursen

Jon,

Thanks for your feed back.

Yes I need it since I write very specialised engineering code that is sold
in a few high cost licenses.
I am looking very hard at the new solution from Microsoft to handle
licenses.
Currently I use a different solution (SentinelLM) but they have raised the
price big time so I need a replacement and I allready have a MSDN.

As fra as I can see right now my best bet is the "Gold dotfuscator" solution
from preemptive.com

Torben
 
J

Jon Skeet [C# MVP]

Thanks for your feed back.

Yes I need it since I write very specialised engineering code that is sold
in a few high cost licenses.

And is piracy a genuine issue within this engineering community? Code
that is sold for a few high cost licences typically doesn't have much
piracy because there's usually a fair amount of communication between
the vendor and the user - that makes it easy to spot pirates.
I am looking very hard at the new solution from Microsoft to handle
licenses.
Currently I use a different solution (SentinelLM) but they have raised the
price big time so I need a replacement and I allready have a MSDN.

As fra as I can see right now my best bet is the "Gold dotfuscator" solution
from preemptive.com

Fair enough. I'd still think about the costs vs actual likelihood of
revenue loss before going too far. Don't forget that the costs are
more than just the upfront cost of the obfuscation software - anything
which effectively changes how your code executes will have
implications in build, test, and support.

Jon
 
T

Torben Laursen

Jon,

You are 100% right, and I have been thinking about this for some time.

I have a lot of contact with my customers and they are all very big
company's so piracy is a minor problem.
However the knowhow inside the code must be protected since what I implement
is public but how to implement it is the big secret.

One thing that I am not clear on is will using ngen.exe give me some
protection against decompiling?
That would be a simple solution

Torben
 
J

Jon Skeet [C# MVP]

You are 100% right, and I have been thinking about this for some time.

I have a lot of contact with my customers and they are all very big
company's so piracy is a minor problem.
However the knowhow inside the code must be protected since what I implement
is public but how to implement it is the big secret.

Is it a secret there is a significant risk that anyone will steal,
however? Would it be obvious if someone *had* stolen it?
One thing that I am not clear on is will using ngen.exe give me some
protection against decompiling?

No, none at all - the metadata is still included after ngen.

Is there any possibility of running the sensitive code on a server you
own, and having the non-sensitive stuff talk to the server? That way
your secret code never gets onto a system which you can't physically
protect - it's the most secure way of protecting algorithms etc.

Jon
 
V

verbiest

Jon,

You are 100% right, and I have been thinking about this for some time.

I have a lot of contact with my customers and they are all very big
company's so piracy is a minor problem.
However the knowhow inside the code must be protected since what I implement
is public but how to implement it is the big secret.

One thing that I am not clear on is will using ngen.exe give me some
protection against decompiling?
That would be a simple solution

Torben








- Tekst uit oorspronkelijk bericht weergeven -

Ngen will not help you, because the assembly containing the IL still
has to be deployed on the client's computer.
 
P

Peter Duniho

Torben said:
Jon,

You are 100% right, and I have been thinking about this for some time.

I have a lot of contact with my customers and they are all very big
company's so piracy is a minor problem.
However the knowhow inside the code must be protected since what I
implement is public but how to implement it is the big secret.

It can't be that important of a secret if you can afford to publish
software that implements it.

Let me first point out that obfuscation or other copy protection
techniques are not necessary in order for you to properly protect your
secret. That is, yes...someone could theoretically duplicate your
implementation (they can no matter what...see below), but whether you
make it difficult or not, you always have legal recourse against
copyright violators. And assuming this is the sort of niche market it
seems to be, it seems unlikely that your implementation could gain any
sort of wide use that might be damaging to your business without you
finding out about it.

For the same reason that piracy isn't a major problem for you, so too
should it not be a problem for your implementation details to be
discoverable. Besides, you can't keep your implementation secret unless
you don't allow anyone else to use software that incorporates that
implementation.

Which brings me to the rest of my post...

There have been a number of threads here and in other .NET newsgroups on
the subject, so I won't bother with all of the details. The bottom line
here is that if you have something that is actually worth investing a
lot of time, money, and effort into protecting, then it's worth a
hacker's time, money, and effort to undo whatever protection you have
put into place.

The #1 rule of computer security is that if the attacker has access,
your security WILL be broken. You cannot give someone software that
runs without there being some way for the person to decipher what that
software does.

Yes, you can make it hard. But you can't make it impossible. And since
the degree of protection you're likely to put on is going to be
proportional to the importance of protecting the code, the more
protection you put on the code, the more likely it is that someone will
want to break the protection and will bypass whatever you do.

In other words, no matter what level of protection you put on the code,
either you've put on not enough or just enough, in which case it will be
broken, or you've put on too much, in which case you've wasted a lot of
resources better applied somewhere else.

It is a logical impossibility that there is some appropriate amount of
resources to apply to the problem.

And please pay very close attention to Jon's admonishment about the
potential unforeseen costs of obfuscation and other techniques. In
addition to those direct costs he mentions, consider also the effect the
protection will have on the end user. Simpler means of protection don't
do much (so why bother?) and more complicated means of protection often
involve techniques that can interfere with legitimate clients' use of
the software (while hackers who have, predictably, bypassed the
protection are not hindered in any such way).

I know, I said I wouldn't bother with all the details. Trust me, this
isn't nearly ALL the details. :) But simply as a regular user of
computers and consumer electronics, I run into problems related to
attempts at copy protection practically once a month, and it's always
frustrating.

Whether it's Windows or Office complaining that I've changed my
hardware, or me not being able to easily repair a hardware problem with
my Tivo, or some music that I bought legally not being playable any more
because of some bug or oversight with respect to the DRM, I am
consistently impeded by mechanisms that are doing exactly the opposite
of what they were meant to do. They prevent me, the legal customer,
from using the product while the people who are using the product
illegally are not affected because part of their theft of the product
involves disabling or otherwise bypassing these protections.

Pete
 
R

Robbe Morris - [MVP] C#

http://www.dotfuscator.com

Yes, you definitely should make it hard for someone
to decompile your assemblies especially in the
arena you are in. It doesn't make it 100% impossible
but does make it very difficult.

Basically, you want to look at ways to minimize the
number of candidates who can decompile your code
and make that effort expensive. In b2b environment,
this will most likely be sufficient.

The dotfuscator guys have some nice tamper
protection tools.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorial...af-5cd3abe27a75/net-propertygrid-control.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top