7 Replies - 770 Views - Last Post: 28 March 2009 - 05:45 PM Rate Topic: -----

#1 Mr Dylan  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 25-March 09

Amateur Coder Searching for help. [VB.net]

Posted 25 March 2009 - 04:39 PM

Hello All. Recently I found this website while searching google for some answers.

Though I know your site ask for some effort on my part im not exactly sure where to start.. I know how to code some decent things and such but recently I wanted to make a serial code system..

What Im looking for is to have a list of Serials on my website (possibly through MySQL? Or something simpler Not sure on this either)

I know about the obvious

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		If TextBox1.Text = "BLAH123" Then
			MsgBox("Valid Registration key. Thank you")
		Else
			MsgBox("Invalid Registration key. Please try again or contact support")
		End If
	End Sub


But I do not like this system as I have no control over multiple uses. I want to pull the keys from my website (hell through a notepad if its easier) therefore allowing me to delete and add serial keys as needed..


Post if you need more details sorry im short on a bit...

Whoops wrong section. Could someone please move this?

Is This A Good Question/Topic? 0
  • +

Replies To: Amateur Coder Searching for help. [VB.net]

#2 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Amateur Coder Searching for help. [VB.net]

Posted 25 March 2009 - 06:18 PM

You can host a database on a public server (that can be accessed globally or in the limits of a WAN), that contains a table with keys that can be accessed and verified. In this case you should start with the basics of SQL (you will have to use either MS-SQL or any other RDBMS).

Then, from your application you will connect to that specific database the way you connect to any other local database with some adjustments.

However, instead of using a set of keys that are stored on a server I would recommend creating an algorithm that will generate keys automatically, based on the user name. Apply the same algorithm to verify the key (instead of checking it with the database). This will require some more work, but will be more reliable.
Was This Post Helpful? 0
  • +
  • -

#3 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: Amateur Coder Searching for help. [VB.net]

Posted 25 March 2009 - 10:30 PM

Haha I use MD5 because its easy but i use a algo before converting into MD5
Was This Post Helpful? 0
  • +
  • -

#4 Mr Dylan  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 25-March 09

Re: Amateur Coder Searching for help. [VB.net]

Posted 26 March 2009 - 01:08 PM

View PostCore, on 25 Mar, 2009 - 05:18 PM, said:

You can host a database on a public server (that can be accessed globally or in the limits of a WAN), that contains a table with keys that can be accessed and verified. In this case you should start with the basics of SQL (you will have to use either MS-SQL or any other RDBMS).

Then, from your application you will connect to that specific database the way you connect to any other local database with some adjustments.

However, instead of using a set of keys that are stored on a server I would recommend creating an algorithm that will generate keys automatically, based on the user name. Apply the same algorithm to verify the key (instead of checking it with the database). This will require some more work, but will be more reliable.


Sounds interesting and somewhat difficult. Do you have a link for a simple tutorial or such?
Was This Post Helpful? 0
  • +
  • -

#5 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: Amateur Coder Searching for help. [VB.net]

Posted 26 March 2009 - 11:08 PM

I will show you the code that I use from a tutorial I think thats on this site but im not sure any more.

#Region "MD5"
	Function getMD5Hash(ByVal strToHash As String) As String
		Dim md5Obj As New Security.Cryptography.MD5CryptoServiceProvider
		Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)

		bytesToHash = md5Obj.ComputeHash(bytesToHash)

		Dim strResult As String = ""

		For Each b As Byte In bytesToHash
			strResult += b.ToString("x2")
		Next

		Return strResult
	End Function
#End Region



Now to use it all you need is some sort of string and to use the function just type this in.

getMD5Hash("somename")


Was This Post Helpful? 0
  • +
  • -

#6 krum110487  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 291
  • Joined: 07-February 09

Re: Amateur Coder Searching for help. [VB.net]

Posted 27 March 2009 - 06:48 AM

the idea behind it is that you "Hash" the password and/or username, then when you are checking if they have the correct Username/password in the database, you do the same before you compare...


Example:
User: Krum
Pass: Password

the hashes are:
Krum = 1234567
Password = 2345678

(Hashes are only ONE way, so each character combination has a unique hash)

Md5 does have some vulnerabilities, but is fine for basic protection.

so you will go....
	 if Hash(usertextbox.text) = 1234567 then 'this would involve the database call'
		  if Hash(PasswordTextBox.text) = 2345678 then
			   'correct password'
		  else
			   'incorrect password'
		  end if
	 else
		  'invalid username'
	 end if



of course this isn't what the actual code would look like, it's just the concept.

This post has been edited by krum110487: 27 March 2009 - 06:48 AM

Was This Post Helpful? 0
  • +
  • -

#7 Ändrew  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 25
  • View blog
  • Posts: 312
  • Joined: 21-April 08

Re: Amateur Coder Searching for help. [VB.net]

Posted 27 March 2009 - 06:39 PM

MD5 have vulnerabilities! Never I know people are trying to crack it but there a long way off ;)
Was This Post Helpful? 0
  • +
  • -

#8 krum110487  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 291
  • Joined: 07-February 09

Re: Amateur Coder Searching for help. [VB.net]

Posted 28 March 2009 - 05:45 PM

View PostÄndrew, on 27 Mar, 2009 - 05:39 PM, said:

MD5 have vulnerabilities! Never I know people are trying to crack it but there a long way off ;)


yes, MD5 without random salt (not sure with) has a vulnerability with making 2 different hashes that equal eachother (starting with different words of course)

it's been proven :-P
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1