Jump to content

Is this a good product key generator/creator

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
17 replies to this topic

#1
Danerd100

Danerd100

    Learning Programmer

  • Members
  • PipPipPip
  • 52 posts
Okay, Say I was making a program that required a product key. Is this a good set of formulas?

I have a textbox that can store 9 digits and then it has 7 check digits

Private Sub CommandButton1_OnEvent()

  Dim a as string = TextBox1.Text

  Dim a1 as integer = val(Mid(a, 1, 1))

  Dim a2 as integer = val(Mid(a, 2, 1))

  Dim a3 as integer = val(Mid(a, 3, 1))

  Dim a4 as integer = val(Mid(a, 4, 1))

  Dim a5 as integer = val(Mid(a, 5, 1))

  Dim a6 as integer = val(Mid(a, 6, 1))

  Dim a7 as integer = val(Mid(a, 7, 1))

  Dim a8 as integer = val(Mid(a, 8, 1))

  Dim a9 as integer = val(Mid(a, 9, 1))

  dim key1 as integer = (a1^2 + a5) mod 10

  dim key2 as integer = (a2 / a8) mod 10

  dim key3 as integer = (a3 * a4 / a6) mod 10

  dim key4 as integer = (a7 + a9 / a1) mod 10

  dim key5 as integer = (a3 - a8 * a7 ^0.5 + a1 -a4) mod 10

  dim key6 as integer = (a2 + a5^2 * a6 - a7 * a9) mod 10

  dim key7 as integer = (((a1 + a3 * a2 / a4 * a5) mod a7 * (a8 + a9)) mod 10)

  Label1.text = a & key1 & key2 & key3 & key4 & key5 & key6 & key7

End Sub



If I enter the number 975224897
I get 975224897-(These are the same as the top)-3028234
without the dashes

I would then write a decryptor into the main program that checks the 7 check digits

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I think most keys are hex values that have a common hash value (usually a pretty simple hash). What you're proposing could work well, however.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Bear in mind that an automated tool could be implemented to run through all the most common ways, so maybe pick a standard algorithm and then just make a slight change, to confuse the hackers. :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#4
Danerd100

Danerd100

    Learning Programmer

  • Members
  • PipPipPip
  • 52 posts
Trust me, the software that I am using this for, people won't hack. It is for schools to use. I just wanted to make it for a new feature, as i have not yet thought of another project to work on.

#5
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
OK. I suppose the children won't really feel the need to crack open the system, I suppose. :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#6
Danerd100

Danerd100

    Learning Programmer

  • Members
  • PipPipPip
  • 52 posts
It isn't for the kids...A brief explanation of my program...

Okay, Quiz Bowl is a game like jeopardy. There are toss Up questions, and bonus questions and 2 teams. I have made a score board for quiz bowl that is available for mac and windows. I am going to sell this. I will have keys registered (this is what I hope to do, though it may be a long way off) so only 1 computer can run each key. I will give each school about 25 keys they can use (because that is about how many they need)

#7
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
OK - but just make sure people can't take a look at the sample keys, and work out their own...
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#8
Danerd100

Danerd100

    Learning Programmer

  • Members
  • PipPipPip
  • 52 posts
I know, only the tech guys who will be installing it will be able to look at it.

#9
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Well, only the tech guys who will be installing it will have access to the program anyway, so... well, I suppose you just have to trust them on this one.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#10
Danerd100

Danerd100

    Learning Programmer

  • Members
  • PipPipPip
  • 52 posts
I mainly added the feature for fun. You can trust most schools.

BTW

Others will be running the scoreboards during the tournaments. The tech guys most likely won't be there, I will be there for the first few at each school as support and troubleshooting.

...Man, that's kinda wierd, I will be the support guy...on a program i wrote...and people will use...maybe...

lol

#11
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
I hope so. I've never actually written anything that can be sold - just for fun. :)
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#12
MeTh0Dz

MeTh0Dz

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,119 posts
You'll have to hope that no one has much computer knowledge, because it would be very simple to reverse engineer and crack this algorithm.

Just my 2 cents.