473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Protect application data from the administrator i.e. such as a licensed flag


I am trying to create licensing functionality in a .NET application.
When the software is licensed then I want it to store this fact somewhere on
the user's computer, this way the next time the program is run it will know
it is licensed. Does windows provide a secure store for applications to put
data such as this?
It seems to me that windows could easily provide a store class that
would store data in an os protected location authenticated by the hash of
the calling dll or executable. Not much space would be needed only 1K or so
to store a private key for the application to use to encrypt/decrypt larger
data stored in unsecure locations.

Additional details:
Basically I need to store three pieces of information, an installID, a
licensed flag, and a license expiration date.
I need to make it impossible or difficult for someone with
administrative rights to change the licensed flag and/or license expiration
date to make the software think it has been licensed. The location at least
needs to be very difficult to find or detect (such as entropy scanning).

I know these demands are difficult and it is an age old problem ensuring
legitimate software use in the face of people that write crack programs etc.

I have given the issue some thought and have come to the conclusion that the
only way to make this perfectly secure is for it to be a feature available
in hardware (such as the CPU). However, I believe there must be many less
perfect solutions that would work well. Any ideas?

Thanks,

-Chris


Jul 21 '05 #1
5 1584

According to this article there is no good way of doing this

http://msdn.microsoft.com/msdnmag/is...a/default.aspx

"Chris" <ch*********************@technocisive.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

I am trying to create licensing functionality in a .NET application.
When the software is licensed then I want it to store this fact somewhere on the user's computer, this way the next time the program is run it will know it is licensed. Does windows provide a secure store for applications to put data such as this?
It seems to me that windows could easily provide a store class that
would store data in an os protected location authenticated by the hash of
the calling dll or executable. Not much space would be needed only 1K or so to store a private key for the application to use to encrypt/decrypt larger data stored in unsecure locations.

Additional details:
Basically I need to store three pieces of information, an installID, a
licensed flag, and a license expiration date.
I need to make it impossible or difficult for someone with
administrative rights to change the licensed flag and/or license expiration date to make the software think it has been licensed. The location at least needs to be very difficult to find or detect (such as entropy scanning).

I know these demands are difficult and it is an age old problem ensuring
legitimate software use in the face of people that write crack programs etc.
I have given the issue some thought and have come to the conclusion that the only way to make this perfectly secure is for it to be a feature available
in hardware (such as the CPU). However, I believe there must be many less
perfect solutions that would work well. Any ideas?

Thanks,

-Chris

Jul 21 '05 #2
Hello Chris,

Thanks for your post. As I understand, you want to license in a .NET
application. Please correct me if there is any misunderstanding. I now
share the following information with you:

1. In the .NET Framework, licensing is designed into the runtime. You can
create you main class as a licensed class which requires run-time license.
Please refer to the following articles for detailed information:

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

Licensing Components and Controls
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconlicensingcomponentscontrols.asp

2. In addition, you can also encrypt your license information (say,
installID, a licensed flag, and a license expiration data) and then save it
to the persistent storage say, registry, file, etc, during the installation
of your application. What the app startup, it will check if the license
inforamtion exists, descrypt it, and then verify it. .NET Class Library
provides cryptographic services.

.NET Samples - How To: Cryptography
http://msdn.microsoft.com/library/de...us/cpqstart/ht
ml/cpsmpnetsamples-howtocryptography.asp

System.Security.Cryptography Namespace
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemSecurityCryptography.asp?frame=true

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.

Jul 21 '05 #3

Thanks for the information on licensing. I am aware of the .NET
cryptography namespace. The problem is not hiding the license information
from being seen, but preventing someone from replacing the licensing
information to activate the software without licensing it. I could encrypt
the license file so only my application would be able to decrypt it. The
problem is that my application would need to have the key to decrypt the
license file(where can this key be safely stored so the administrator cannot
obtain it, use it, or replace it?). If I embed this key in my code a
cracker could easily find this key in my application's code by searching for
areas in the code containing high randomness. Once they have obtained the
key they can use it to decrypt the license file and see the format it is in.
Once this is done they can change any flags such as the licensed flag to
true, re-encrypt the file and replace the legitimate license file with their
own.
I was not aware there were licensing classes in .NET thank you for
drawing my attention to them. I am however concerned that the .NET license
classes might become a common target for crackers however, perhaps it is
built strongly enough to withstand attack. Unless the operating system
protects the .NET licensing dll from the administrator it seems to me that a
cracker could simply replace the .NET licensing dll with their own which
would of course provide them with the ability to render this license
checking class ineffective.
-Chris
"Tian Min Huang" <ti******@online.microsoft.com> wrote in message
news:XS**************@cpmsftngxa10.phx.gbl...
Hello Chris,

Thanks for your post. As I understand, you want to license in a .NET
application. Please correct me if there is any misunderstanding. I now
share the following information with you:

1. In the .NET Framework, licensing is designed into the runtime. You can
create you main class as a licensed class which requires run-time license.
Please refer to the following articles for detailed information:

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

Licensing Components and Controls
http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconlicensingcomponentscontrols.asp

2. In addition, you can also encrypt your license information (say,
installID, a licensed flag, and a license expiration data) and then save it to the persistent storage say, registry, file, etc, during the installation of your application. What the app startup, it will check if the license
inforamtion exists, descrypt it, and then verify it. .NET Class Library
provides cryptographic services.

NET Samples - How To: Cryptography
http://msdn.microsoft.com/library/de...us/cpqstart/ht ml/cpsmpnetsamples-howtocryptography.asp

System.Security.Cryptography Namespace
http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfSystemSecurityCryptography.asp?frame=true

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.

Jul 21 '05 #4

Thanks for the information on licensing. I am aware of the .NET
cryptography namespace. The problem is not hiding the license information
from being seen, but preventing someone from replacing the licensing
information to activate the software without licensing it. I could encrypt
the license file so only my application would be able to decrypt it. The
problem is that my application would need to have the key to decrypt the
license file(where can this key be safely stored so the administrator cannot
obtain it, use it, or replace it?). If I embed this key in my code a
cracker could easily find this key in my application's code by searching for
areas in the code containing high randomness. Once they have obtained the
key they can use it to decrypt the license file and see the format it is in.
Once this is done they can change any flags such as the licensed flag to
true, re-encrypt the file and replace the legitimate license file with their
own.
I was not aware there were licensing classes in .NET thank you for
drawing my attention to them. I am however concerned that the .NET license
classes might become a common target for crackers however, perhaps it is
built strongly enough to withstand attack. Unless the operating system
protects the .NET licensing dll from the administrator it seems to me that a
cracker could simply replace the .NET licensing dll with their own which
would of course provide them with the ability to render this license
checking class ineffective.
-Chris
"Tian Min Huang" <ti******@online.microsoft.com> wrote in message
news:XS**************@cpmsftngxa10.phx.gbl...
Hello Chris,

Thanks for your post. As I understand, you want to license in a .NET
application. Please correct me if there is any misunderstanding. I now
share the following information with you:

1. In the .NET Framework, licensing is designed into the runtime. You can
create you main class as a licensed class which requires run-time license.
Please refer to the following articles for detailed information:

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

Licensing Components and Controls
http://msdn.microsoft.com/library/de...us/cpguide/htm l/cpconlicensingcomponentscontrols.asp

2. In addition, you can also encrypt your license information (say,
installID, a licensed flag, and a license expiration data) and then save it to the persistent storage say, registry, file, etc, during the installation of your application. What the app startup, it will check if the license
inforamtion exists, descrypt it, and then verify it. .NET Class Library
provides cryptographic services.

NET Samples - How To: Cryptography
http://msdn.microsoft.com/library/de...us/cpqstart/ht ml/cpsmpnetsamples-howtocryptography.asp

System.Security.Cryptography Namespace
http://msdn.microsoft.com/library/de...us/cpref/html/ frlrfSystemSecurityCryptography.asp?frame=true

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.

Jul 21 '05 #5
Hello Chris,

Thanks for your response. I suggest that you can also encry each machine's
hareware information to the license information, so that the license
information cannot be deployed to other machines and it's also difficult to
crack. Please also kindly note that there is no system which is 100% cecure.

In addition, I'd also recommend you post such security questions to more
appropriate newsgroups, say,

microsoft.public.win2000.security
microsoft.public.platformsdk.security
microsoft.public.dotnet.security

Have a nice day!

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.

Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: YK | last post by:
All, What is the best way to protect IL code? --------------------------------------------------- Typical scenario: Visual Studio .NET 2003 includes Dotfuscator Community Edition, which...
11
by: siliconmike | last post by:
Is there a way to protect data files from access by root ? I have a data-centered website and would like to protect data piracy from any foot-loose hosting company employee. Any ideas? ...
29
by: Frank Millman | last post by:
Hi all I am writing a multi-user accounting/business system. Data is stored in a database (PostgreSQL on Linux, SQL Server on Windows). I have written a Python program to run on the client,...
4
by: Tolga Tanriverdi | last post by:
i saw something named obfuscator and its decompiling the source code of my program which written in c# and my program includes mysql root password inside of it is there anyway to protect my...
8
by: John Blair | last post by:
Hi, I updated the latest .Net patch on my system this moring and now my SQL Web Data Administrator application is not working. I get the following error: Server Application Unavailable The...
3
by: SpIcH | last post by:
Hi All, This is all about protecting my data in Executable file. I have developed a program in Visual Basic .NET 2002. I have many questions in mind... please help me to complete my project. ...
4
by: Chris | last post by:
I am trying to create licensing functionality in a .NET application. When the software is licensed then I want it to store this fact somewhere on the user's computer, this way the next time the...
22
by: teejayem | last post by:
Hi, I am new to programming with databases and was wanting some help. Is there any way to password protect an access database and access sent sql commands to it via vb.net code? Any help...
15
by: eltonchew | last post by:
Hi, We have an inhouse developed VB.NET Windows application which runs successfully only when the user is given a local administrator rights. Without which, it fails to start. There isn't...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.