Security Code/ installation key

  • Thread starter Thread starter Tim Marsden
  • Start date Start date
T

Tim Marsden

Hi,

Any suggestions on how I can secure my application with some kind of
installation key, or put a expiry date on the software.

Tim
 
What I do is require a license key string consisting of encrypted letters
and numbers. Embedded in this is the expiration date of the software if it
is a "free trial", or a valid license key that is verified by a mathematical
algorithm.

Such a key can be placed in a web.config file, in the registry, or be
required to be passed into the constructor of the app's main class.

There is also a pretty well-developed licensing class scheme you can look up
in the .NET Documentation. This can be overriden to do things similar to
what I describe above.

Does that help?
--Peter
 
Hello Tim,

Thanks for your post. I agree with Peter, and I'd like to provide more
information on this subject:

1. As mentioned by Peter, you can refer to .NET Licensing which protects
the .NET controls and components:

..NET Licensing
http://windowsforms.net/articles/Licensing.aspx

Licensing Components and Controls
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconlicensingcomponentscontrols.asp

2. If you want to put an expiry date on the software, you may take a look
at the following algorithmn:

a. Create a setup program for your application. In the setup program, we
should record the installation time and registration flag to a persistent
storage (say, registry, file, etc) in an encrypted format if the
application was installed successfully.

b. Check the registration flag immediately after the the program starts. If
this product is registered, go to Step f, otherwise (flag is missing or is
set to unregistered) go to next step.

c. Get the current time and compare it with the installation time, if it
exceeds the trial period, then go to Step d, otherwise go to Step e.

d. Exit the program.

e. Display a dialog/message box urging the customer to enter a registration
key. And modify the registration flag if a user enter a valid regiatration
key.

f. Continue to work.

Note: You should also implement/apply encryption algorithmns for the
registration key/flag and installation time. I believe the following MSDN
article is helpful:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcryptographictasks.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top