473,396 Members | 1,834 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,396 software developers and data experts.

Licensing

Hello,

I was thinking of using XML based digital signatures as a licensing scheme
in my application:
http://www.codeproject.com/dotnet/xmldsiglic.asp

As the authtor points out, the public key should be incorporated into the
application itself, and not in the xml license file,
in order to prevent people from signing their own license file's and using
them.

Does anyone have comments of this is a good or bad idea, or if there are
other options out there which are more suitable?
Christian H.
Nov 16 '05 #1
2 1996
You either do that or encrypt it and save it to binary file , check this
link
http://www.eggheadcafe.com/articles/20021221b.asp
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
It is a good idea to protect against this kind of attack/workaround. I
would even obfuscate the code, encrypt the XML string of the public key in a
hardcoded string field using the obfuscator to encrypt the field string.
Then on startup (or other) get the public key string, compare against the
public key bytes of the signed assembly. Now I ~think this proves that your
code has not been modified as the public key on assem matches what you
stored in string at build and also that user/hacker did not mod your code
and/or "re-sign" it with there own key pair. So now you have reasonable
assurance your public key is the one you set and can use it to verify
digital signature of lic file(s). However, all this does not *prevent one
from modifying your code and removing all these checks and just hard coding
"True" from one or more of your test points - hence bypassing all your PKI
stuff and lic files. However nothing can stop that attack. All programs on
a user HD (even native EXE) are vulnerable to this. As it turns out
however, the obfuscation will most likely make this attack not worth the
effort at worst and improbable at best. I recommend XenoCode obfuscator
with conservative settings and to encrypt your required strings and/or
Watermark strings.

Also keep your lic file simple xml and one digital signature signed by the
private key in one of the elements. Require that the lic file exist by name
in the same dir as the EXE or dll. This makes it easier for you and the
user. You have one simple rule and don't need edge logic to test if exists
here or there or in ISO storage etc. Keep it simple with one rule.
"MyAppLic.xml" or similar must exist in exe dir and digital sig must verify
using pub key above - simple. However the same Lic will work on anyone's
machine unless you also use a Machine hash or something unique the Users
machine/sw. You could use a unique Watermark in each exe, but that requires
a new build for each customer (a pain). You could also use a sha1 hash of a
combination of some unique info on the machine such as Machine Name, domain,
bios name/version, etc. However I would not use things like User Name or
IPAddress because if I install product using staceyw, I may want to also run
it when logged in as Admin or other and verify would fail. Domain name is
probably not good either as some users connect to different domains and roam
around. Also I do change IPs and nics at times so IP and MAC is not good
either IMO. Using the Windows GUID as shown in the article did not work on
my Windows 2003 server either (If I remember) so not sure I would trust that
in all cases. So the following are probably ok, but new key would need to be
generated if any of them change:
- Machine Name
- Windows Version
- Windows DIR path
- RAM size
- CPU Name
- BIOS Name & Ver

Unlocking by Product Key (i.e. XXXXX-XXXXX-XXXXX-XXXXX) is another option,
but less secure simply because you have less bytes and brute force attacks
are simpler and need have a secret at client side. Most of the bytes could
be X bytes of the machine hash that is hashed using hmacsha1 or something
using a concat string of all the above machine strings and a shared secret
both sides know. client side secret is encrypted using the Obfuscator
function. You give up some lic security for easy of user to unlock the lic
with simple product key - which can be emailed or given out over the phone.
The down side is more probable to have matching hash for multiple users (as
many can have same machine name, Windows version *and we can't fit the whole
20 byte sha1 hash in 20 or 25 bytes of Base36 format) and the shared secret
can be gotten using a debugger or something while stepping through the code
as runtime. However if you accept the down sides, it can be a nice option
for your sw and users that may be "good enouph".

--
William Stacey, MVP
http://mvp.support.microsoft.com

"Christian H" <n@n.no> wrote in message
news:SF******************@news4.e.nsc.no...
Hello,

I was thinking of using XML based digital signatures as a licensing scheme
in my application:
http://www.codeproject.com/dotnet/xmldsiglic.asp

As the authtor points out, the public key should be incorporated into the
application itself, and not in the xml license file,
in order to prevent people from signing their own license file's and using
them.

Does anyone have comments of this is a good or bad idea, or if there are
other options out there which are more suitable?
Christian H.


Nov 16 '05 #3

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

Similar topics

18
by: Adrian B. | last post by:
Does anyone know of a framework or library that will enable me to use publish/subscribe comms? I want to create a server (using Python) running on a Unix box that will accept client connections...
15
by: nospam | last post by:
Once Yukon is released (whenever that might be) does anyone from MS have any comment on licensing for Yukon and on SQL 2000. I really don't think anyone with SQL 2000 licenses are going to...
4
by: vbportal | last post by:
Hi, Not sure if this is the right group for the question: I've just finished a course/certification where I've used Visual Studio and want to work further on software development with C#,ADO,ASP...
5
by: Sandeep Srinivasa | last post by:
hi, I have a software which has licensing (enabled through flexlm). Now, an end user can build apps (As loadable modules) using this base software. I am introducing a new feature, which I am...
7
by: ML | last post by:
What is the best/easiest means to return the serial/volume number of the drive containing the OS using VB.NET? I'm looking to get this information as a unique ID for activation/registration of a...
9
by: vbdotnetmania | last post by:
Hi, I have looked through similar posts and have found Ken Tucker giving the reply about looking at article http://windowsforms.net/articles/Licensing.aspx This appears to be for controls and...
7
by: Andrew Smith | last post by:
Hi, does anybody know a good jumpstart for techniques to protect software with license keys? Thanks in advance Andrew -- Andrew Smith
5
by: Nikolay Petrov | last post by:
I would like to store a licensing information in a assembly. It's easy to crypt/decrypt it, but how to stote it, if my app is referencing and using this dll? Is this possible?
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
4
by: Steve | last post by:
I'm in the process of finishing a vb2005 application for commerical use, and wanted to know if anyone has any favorites for licensing software? Would like something reasonably priced for a...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.