473,654 Members | 3,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Licence Key generator

Hi,
We would like to develop a product in VB.Net. This is the first time I'm
involving in such type of practice. Can any one please provide the
information about the fallowing???
1. How to generate Licence Key(s) for the product? Are there any components
available to do so?
2. Since the product is distributed thru CDs, what is the process to provide
licence keys for the clients?

Please help.
Jul 19 '05 #1
2 27960
Hello,

Providing a licensing system can be difficult. There are many
approaches you can take.

On the simple end, you can use a simple algorithm with an encryption
algorithm. An example of this would be to use an int32 and every
number divisible by 13 is valid. Then encrypt the number with
Rijndael and use that as the key. Simple to generate, looks random to
the user.

More advanced, you could require some input from the user to generate
the code, via registration. In this scenario you'd have the user
register his name, and you'd issue a key that is linked to his name.
Again, using Rijndael or some other encryption algorithm would provide
the necessary key. Another way is using a hash and then requiring
some characteristics of the output. This requires you to spend a lot
of computing time finding hashes that work, but can be successful at
limiting key-generators.

For even more protection, you could use a hardware dongle, or require
per-computer activation (like Windows XP). This is best way to
prevent "casual" piracy, where a company buys 1 license, and installs
it on multiple computers.

Regardless, you should most likely develop your own algorithm. Using
a prepackaged protection system can be easier to crack because many
times most of the work has been done before for another product. To
give them to the client, you'll just need to print off one key out of
the sequence of keys available. Your CD manufacturer can give you
more details. Sometimes it's possible to have each CD have a serial
or volume encoded on it, which you can use to require a specific key.
Again, your CD manufacturer can give you more details.

Another thing you need to do are find a way to transfer the licenses
(sending a long binary or Base64 string isn't nice for users). A
packed (where the transform works on one byte at a time instead of
multiple bytes), modified (modify the output so that the 32 characters
are easy to distinguish, for instance, don't use 0 and O, I and l)
Base32 algorithm is a good way to do this.

The most important issue, no matter which scheme you use, is
providing anti-cracking measures. Ignoring this is like having a door
with an advanced digital lock, but having the actual door made of
rotten wood - an attacker will just bypass the lock and break down the
door. If your app just simply does something like this:
If CheckForLicense () Then
MessageBox.Show ("Valid license!")
Else
MessageBox.Show ("Invalid license!")
Return
End
It will be cracked extremely fast, even if it is obfuscated. An
attacker will simply add a breakpoint for MessageBox.Show , and then
trace the code back up to the branch. For an added bonus, they'll
jump into the CheckForLicense () and reverse engineer it and make a key
generator which will most likely work even across-versions of your
software. This can be easy in x86, and extremely easy in IL.

The use of multiple threads or processes can make debugging much
harder. As well, writing code in IL or x86 embedded in IL that's
designed to be hard to read. The CLR is very flexible and we can take
advantage of this to write very confusing code, if don't mind loosing
verifiability.

Finally, a strong obfuscator that encrypts strings and hides calls to
your code and to system code will make all your code even harder to
read. Then, an encrypted loader (where your .exe has a data section
that contains the encrypted program, and the IL inside the .exe is
just to load it up) can raise the bar very high to even get to your
IL.

If you are interested, I can help you design these features and write
code to do this. As well, I have an internal program that creates an
encrypted loader, as well as does some interesting obfuscation
techniques that have been successful in stopping the .NET debuggers
from attaching to a process and prevent ILDASM/ASM round-tripping. My
email address is mg*@Atrevido.ne t.

Thanks,
-mike
MVP
"Kiran" <ki********@nun et-tech.com> wrote in message
news:uu******** ******@TK2MSFTN GP12.phx.gbl...
Hi,
We would like to develop a product in VB.Net. This is the first time I'm involving in such type of practice. Can any one please provide the
information about the fallowing???
1. How to generate Licence Key(s) for the product? Are there any components available to do so?
2. Since the product is distributed thru CDs, what is the process to provide licence keys for the clients?

Please help.

Jul 19 '05 #2
Sorry, I meant RC2, not Rijndael (the output will be smaller, which is
useful for codes the user has to type in). Here is a small example
and it's output. As you can see, the results are quite varied, and
make it impossible for someone to determine any algorithm just by
looking at masses of keycodes.

----
13 = MTYzRrmgAS8=
26 = FJ3UJexjokY=
39 = aQvGR1KY4Xg=
52 = R87PYZsb1KM=
65 = SuX6VixFu8A=
78 = ELNcDX4L6Dk=
91 = QSXQi8LCyJY=
104 = XoUHL7Jgqmw=
117 = DJsLb8H8Htc=
130 = 4HNg2zLLXGQ=
143 = aOPKYj056kU=
156 = ewCz0BMCrS8=
169 = hL4zLl7hZ7o=
182 = xHFVolS4h2g=
195 = 5zKC1O0GhAQ=
----

using System;
using System.Security .Cryptography;

namespace testY {
public class Class1 {
static void Main() {
RC2 r = RC2.Create();
r.GenerateIV();
r.GenerateKey() ;

for (short i = 13; i < 200; i+=13) {
byte[] data = System.BitConve rter.GetBytes(i );
byte[] enc = r.CreateEncrypt or().TransformF inalBlock(data, 0, 2);
Console.WriteLi ne("{0}\t= {1}", i, Convert.ToBase6 4String(enc));
}
Console.ReadLin e();
}

}
}

-mike
"Michael Giagnocavo [MVP]" <mg*******@Atre vido.net> wrote in message
news:uU******** *****@TK2MSFTNG P10.phx.gbl...
Hello,

Providing a licensing system can be difficult. There are many
approaches you can take.

On the simple end, you can use a simple algorithm with an encryption algorithm. An example of this would be to use an int32 and every
number divisible by 13 is valid. Then encrypt the number with
Rijndael and use that as the key. Simple to generate, looks random to the user.

More advanced, you could require some input from the user to generate the code, via registration. In this scenario you'd have the user
register his name, and you'd issue a key that is linked to his name.
Again, using Rijndael or some other encryption algorithm would provide the necessary key. Another way is using a hash and then requiring
some characteristics of the output. This requires you to spend a lot of computing time finding hashes that work, but can be successful at
limiting key-generators.

For even more protection, you could use a hardware dongle, or require per-computer activation (like Windows XP). This is best way to
prevent "casual" piracy, where a company buys 1 license, and installs it on multiple computers.

Regardless, you should most likely develop your own algorithm. Using a prepackaged protection system can be easier to crack because many
times most of the work has been done before for another product. To
give them to the client, you'll just need to print off one key out of the sequence of keys available. Your CD manufacturer can give you
more details. Sometimes it's possible to have each CD have a serial
or volume encoded on it, which you can use to require a specific key. Again, your CD manufacturer can give you more details.

Another thing you need to do are find a way to transfer the licenses (sending a long binary or Base64 string isn't nice for users). A
packed (where the transform works on one byte at a time instead of
multiple bytes), modified (modify the output so that the 32 characters are easy to distinguish, for instance, don't use 0 and O, I and l)
Base32 algorithm is a good way to do this.

The most important issue, no matter which scheme you use, is
providing anti-cracking measures. Ignoring this is like having a door with an advanced digital lock, but having the actual door made of
rotten wood - an attacker will just bypass the lock and break down the door. If your app just simply does something like this:
If CheckForLicense () Then
MessageBox.Show ("Valid license!")
Else
MessageBox.Show ("Invalid license!")
Return
End
It will be cracked extremely fast, even if it is obfuscated. An
attacker will simply add a breakpoint for MessageBox.Show , and then
trace the code back up to the branch. For an added bonus, they'll
jump into the CheckForLicense () and reverse engineer it and make a key generator which will most likely work even across-versions of your
software. This can be easy in x86, and extremely easy in IL.

The use of multiple threads or processes can make debugging much
harder. As well, writing code in IL or x86 embedded in IL that's
designed to be hard to read. The CLR is very flexible and we can take advantage of this to write very confusing code, if don't mind loosing verifiability.

Finally, a strong obfuscator that encrypts strings and hides calls to your code and to system code will make all your code even harder to
read. Then, an encrypted loader (where your .exe has a data section
that contains the encrypted program, and the IL inside the .exe is
just to load it up) can raise the bar very high to even get to your
IL.

If you are interested, I can help you design these features and write code to do this. As well, I have an internal program that creates an encrypted loader, as well as does some interesting obfuscation
techniques that have been successful in stopping the .NET debuggers
from attaching to a process and prevent ILDASM/ASM round-tripping. My email address is mg*@Atrevido.ne t.

Thanks,
-mike
MVP
"Kiran" <ki********@nun et-tech.com> wrote in message
news:uu******** ******@TK2MSFTN GP12.phx.gbl...
Hi,
We would like to develop a product in VB.Net. This is the first
time I'm
involving in such type of practice. Can any one please provide the
information about the fallowing???
1. How to generate Licence Key(s) for the product? Are there any components
available to do so?
2. Since the product is distributed thru CDs, what is the process

to provide
licence keys for the clients?

Please help.


Jul 19 '05 #3

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

Similar topics

2
3672
by: Google alias | last post by:
My trial period for Zend studio has just ended, I've requested a personal licence, and got it. After I've entered and rebooted by computer I still get a popup saying "Licence expired!" everytime I request a php-page from localhost. Very annoying! If googled on on licence expired zend studion personal edition. But that gave me mostely Russian Crack sites. Very tempting 8-) Can anybody please help me to remove the popup permanently? Im...
0
2458
by: Jakov | last post by:
Ok there are some issues about LGPL licence. I am not a lawyer, and reading LGPL licence is making me confused. This is my problem. I have woking on some commercial application, all the software in this application is my property. Let say this software is in package "my.commercial.package". Next on net I found some binaries and sources which are covered in LGPL licence. Let say this software is in package "some.LGPL.package". There are...
17
2053
by: Laszlo Zsolt Nagy | last post by:
Hi All! I know there has been a post about Python licencing but I have different questions. I tried to Google for "Python Licence" and "Python Licencing" but I could not find the answer. Is there a place where I can ready about Python licencing? (A FAQ maybe?) I really need to know the details of the licence, but not in the lawyer's language. Just simple questions: - How put a software under the Python licence?
2
8314
by: Dave | last post by:
Hi, Can anyone suggest a way to generate a licence key from C/C++ program? I want to create a licence file include an encrypted text and an expiry date. The private key is hard coded in the program which will be used to encrypt and decrypt the licence key from the licence text file. With RSA, I want to hardcode a plain text as a private key in the C/C++ program, and store a signed public-key (the licence key - also include an expiry...
2
533
by: Kiran | last post by:
Hi, We would like to develop a product in VB.Net. This is the first time I'm involving in such type of practice. Can any one please provide the information about the fallowing??? 1. How to generate Licence Key(s) for the product? Are there any components available to do so? 2. Since the product is distributed thru CDs, what is the process to provide licence keys for the clients? Please help.
3
1486
by: DD | last post by:
I am after help in generating the code... The end user enters a licence no in the software to use the software as you do with Microsoft products. Can anyone help Regards DD
6
1913
by: Hani Atassi | last post by:
If i am using a form type authintication, do I need a licence for each logged in user? The application maintain their own user list and they are not Windows accounts. If I am using SQL Server from my web application, and SQL server uses 1 windows account, how many CAL do I need for my web application to run on the internet?
84
6513
by: John Perks and Sarah Mount | last post by:
we have some Python code we're planning to GPL. However, bits of it were cut&pasted from some wxPython-licenced code to use as a starting point for implementation. It is possible that some fragments of this code remains unchanged at the end. How should we refer to this in terms of copyright statements and bundled Licence files? Is there, say, a standard wording to be appended to the GPL header in each source file? Does the original...
1
1996
by: IanWright | last post by:
I'm trying to think of a suitable licence model for a toolkit that I'm designing, and have come up with the following, and would like thoughts / opinions or suggestions that people can offer. The toolkit is going to allow setup + solving of specific non linear problems. The ideas I had were: 2 different licences. 1 Developer, 1 Runtime, which I want to strictly be used appropriately. Developer licence: Allow many instances of the toolkit...
0
8379
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8709
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.