I regularly use a license key method that I've found to be very safe. It
involves the construction of a long string of data such as the computer
name, user name and other metrics that are unique to the machine the product
is to be installed. This long string is used to generate a hash key that is
unique for every installation. In most instances I use a web-service to do
the key generation so that is under the control of my server.
I created a licensing component that uses this hash key to grant or deny
licenses based upon runtime / design time use and I also do horrible stuff
like check for the presence of different sorts of debugger running on the
machine. This licensing component is heavily obfuscated with an obfuscator
that crashes the IL disassemblers and it's guts are also encrypted wherever
possible.
I feel that I can explain this because the heart of the system depends upon
so many factors that go together to create a string of information which
averages about 1000 characters. Hash key cracking systems such as lookup
tables are unreliable past 15 or 20 characters so my strings with all the
weird information I collect are, I think, quite safe.
IMO If anyone has the energy to crack such a variable system as one that is
different for each and every installation, even if it's installed twice on
the same machine, then they are the very low percentage of people who will
be deterred by nothing. I know that a single crack would take an
inordinately long time and the key is so simple to change that a trivial
update on my part will make the hackers have to go through the whole reverse
engineering process again.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
>I regularly use a license key method that I've found to be very safe. It
>involves the construction of a long string of data such as the computer
>name, user name and other metrics that are unique to the machine the product
>is to be installed. This long string is used to generate a hash key that is
>unique for every installation. In most instances I use a web-service to do
>the key generation so that is under the control of my server.
This is a store the key on the users computer system and match the key
to the user system.
>I created a licensing component that uses this hash key to grant or deny
>licenses based upon runtime / design time use and I also do horrible stuff
>like check for the presence of different sorts of debugger running on the
>machine. This licensing component is heavily obfuscated with an obfuscator
>that crashes the IL disassemblers and it's guts are also encrypted wherever
>possible.
Hackers can defeat such programs using a variety of methods.
First and simplest is to use a ICE. Another method that is slower but
more cost effective is to use a computer emulator. The third method
is to use an offline disassembler. The first step would be to remove
any run time checks for debuggers. Patching an executable is
a simple thing.
Encrypting the guts of your program requires the key to be available
to run the program. A hacker can obtain a legitimate key and then
decrypt the code. However unless each program is individially
encrypted at distribution time all of them will use the same key for
the encryption portion.
>I feel that I can explain this because the heart of the system depends upon
>so many factors that go together to create a string of information which
>averages about 1000 characters. Hash key cracking systems such as lookup
>tables are unreliable past 15 or 20 characters so my strings with all the
>weird information I collect are, I think, quite safe.
A hacker would simply bypass whatever checks were put in place.
Patching such code is trivial.
>IMO If anyone has the energy to crack such a variable system as one that is
>different for each and every installation, even if it's installed twice on
[quoted text clipped - 3 lines]
>update on my part will make the hackers have to go through the whole reverse
>engineering process again.
Do you compile a custom version for each user? If not then each
installation is still the same.
If hackers think your software is worth the trouble to pirate, nothing
will stop them. A single crack would probably take a week.
This crack allows the hacker to make an infinite number of copies.
They don't need to reverse engineer the whole thing for each copy.
They simply remove all the obfuscation and run time checks.
Copy protection only works when the adversary does not have access
to the machine the program is running on. Offloading critical
computation to a PCI/USB hardware device greatly increases the
difficulty of defeating copy protection. Of course this is an
expensive solution since it requires custom hardware be designed
and only works for computation dependent software. I have not
yet seen such devices. If someone can point me to a dongle
which does computational work for the program I would be most
interested.
Leslie 'Mack' McBride
remove text between _ marks to respond via e-mail