7 Replies - 11605 Views - Last Post: 22 September 2010 - 04:31 AM Rate Topic: -----

#1 Themitchel0  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 107
  • Joined: 14-April 10

Making a keygen in c#

Posted 19 September 2010 - 01:38 PM

ok so i know what your thinking, hes gonna try to hack something or something like that, but thats not what i want to know, i want to know how to make a keygen for a program that i have made, like they have to enter it into the program to gain acsess
any help is appreciated! thank you
Is This A Good Question/Topic? 0
  • +

Replies To: Making a keygen in c#

#2 reaper4334  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 107
  • Joined: 01-November 09

Re: Making a keygen in c#

Posted 19 September 2010 - 02:42 PM

Well do you understand what a keygen does?

You'd need to have some sort of algorithm that the keygen follows to produce keys, then the program follows to check the key it's given is valid.
Was This Post Helpful? 1
  • +
  • -

#3 Themitchel0  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 107
  • Joined: 14-April 10

Re: Making a keygen in c#

Posted 19 September 2010 - 02:54 PM

wouldn't i also need a server communication or something to check if the code has been used? and how complex does the algorith need to be?
Was This Post Helpful? 0
  • +
  • -

#4 reaper4334  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 107
  • Joined: 01-November 09

Re: Making a keygen in c#

Posted 19 September 2010 - 03:24 PM

That all depends on what level of security you need for the program.

As far as I can see, you'd just need to store some information in a database somewhere to tell you which keys have been used. Doesn't have to be the key itself though, if your algorithm allows you could store it in a simpler form to save space.

Check a few of these links out...

http://www.debugging.com/bug/16115 - contains some other links and a bit of information
http://social.msdn.m...65-790b367d3a05

http://blogs.msdn.co.../10/437293.aspx - This looks like a good one to look at, it has a Product Activation bit and a Product Registration bit and they're already in an example applciation so you should be able to get a good idea how they work.
[Edit] it seems some of the links are broken from this blog page :(

This post has been edited by reaper4334: 19 September 2010 - 03:26 PM

Was This Post Helpful? 0
  • +
  • -

#5 Themitchel0  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 107
  • Joined: 14-April 10

Re: Making a keygen in c#

Posted 19 September 2010 - 04:50 PM

ok thanks ill try these out
Was This Post Helpful? 0
  • +
  • -

#6 reaper4334  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 107
  • Joined: 01-November 09

Re: Making a keygen in c#

Posted 19 September 2010 - 05:02 PM

No worries, it is a difficult one to research just 'cause so many people search for keygens to crack things lol.

Let us know how it goes, I know my links weren't great but it should help a little :)
Was This Post Helpful? 2
  • +
  • -

#7 StorminNorman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 21-September 10

Re: Making a keygen in c#

Posted 21 September 2010 - 08:36 PM

View Postreaper4334, on 19 September 2010 - 01:42 PM, said:

Well do you understand what a keygen does?

You'd need to have some sort of algorithm that the keygen follows to produce keys, then the program follows to check the key it's given is valid.


If your not using an online method to validate your software. You need to embed code within your software that will check a key given to the consumer.

ex. You have a product key of 20 characters. You can parse the first 5 characters (or however you choose) into a group and have an algorithm calculated whether or not those groups of numbers or letters match.

Say you have that first block [63TY9] as an example, both 63 and 9 both divide by 3. The letters could be derived from another algorithm using ASCII or just random junk to throw off people that create keygens to "Crack" programs.

If you are using an online method of verifying product key I would definitely use a database and store which key's have been used and deny access to those already used.
Was This Post Helpful? 0
  • +
  • -

#8 Imdsm  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 103
  • View blog
  • Posts: 362
  • Joined: 21-March 09

Re: Making a keygen in c#

Posted 22 September 2010 - 04:31 AM

Edit: In regards to negative reputation I'm receiving, let me ask you this question; how do you expect to be able to protect your software without first understanding how it is vulnerable? The OP asked a question and said it is for his own application, by understanding how keygens are made, he can better protect himself and his software against them.

Just to make it clear, I am not a hax0r, a pirate or a Swedish filesharer, I am simply a developer who does a proper job.

As for removing the link to the crackme website, the link harboured no bad reputation or files, on the contrary in fact, many reputable and decent coders use it, working together to write better code obfuscation and cracker protection.

Though I guess another option, other to doing the job properly, is burying your head in the sand.


Original Post: Well you're not just talking about a keygen here, you're also talking about a crack. Sometimes you can use offline activation, the way this works is the product application has an embedded (and usually obfuscated) algorithm that checks to see if (usually) the username when put into the serial generator, creates the serial that you have provided. The second way is online activation, which checks in a database. There is no simple way to emulate the server, so these require cracks - basically you open up the app and rewrite the code to not connect to the server, instead returning that it was all OK or something similar.

For cracking the offline activation, it's a case of opening up the application and reading the code, working out the algorithm and then coding it in your own app to take the name and generate a serial from it.

Now what type of app you're cracking makes a difference too, some are compiled into machine code, so you can use certain programs such as a kernal debugger (SoftIce) or a free one if you, like the rest of us, aren't made of money. These will let you see memory registers, and whatnot, but more importantly you'll be able to see the code (usually in ASM).

If the app has been written in .NET then it will be easier, as these are compiled into CIL (was MSIL), which is pretty readable. The way to get around this is to obfuscate your code, MS offer "Dotfuscator Software Services" with certain releases of Visual Studio. Obfuscating your code makes it harder to read, but not impossible, and if someone is determined then they will crack your app.

In summary, you can make it harder for people to crack your security, but you can't make it impossible. As soon as MS or Adobe come up with it, the rest of us might stand a chance.

This post has been edited by Imdsm: 22 September 2010 - 08:11 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1