Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello guys.
This is my first post so please forgive me for any error.
Ok I am making a Online Yu-Gi-Oh card game with vb.net
So first I made the server (a free webhost) then I made a signup form with MD5 hash encryption (Not decryptable)that creates a file in the host with the Username as its name, and encrypted password as its text.

This works fine but the problem is my Log In code.
It does not seem to work.

VB
Dim username As String
    Dim passwordclient As String
    Dim passwordserver As String
    Dim encrypted As String

'Login Button (Click)
    Private Sub loginbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loginbutton.Click
        loginbutton.Image = My.Resources.largeButton_orange_down

        'Check if blank
        If TextBox1.Text.Length = 0 Or TextBox2.Text.Length = 0 Then
            MsgBox("One of the fields is blank.")
            Exit Sub
        Else
            username = TextBox1.Text
            passwordclient = TextBox2.Text
        End If
        encrypted = StringToMD5(passwordclient)

        'Server connection
        WebBrowser1.Navigate("http://yugioh.hes78.com/" & username)
        'Goes to WebBrowser1_DocumentCompleted

End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        
passwordserver = WebBrowser1.DocumentText

        If encrypted = passwordserver Then
            Form2.Show()
            Me.Hide()

        Else
            MsgBox("Error")
        End If

    End Sub


It always shows the error msgbox at the end, when I click the login button.
Thanks.
Posted

The DocumentText[^] property contains much more that just the password. You need to parse the document to find the correct field to compare against. You should also know that MD5 is a hash that can be cracked fairly easily, it is not an encryption.
 
Share this answer
 
Comments
ShinigamiXoY 16-Jun-12 7:24am    
I thought MD5 was not decryptable, one way hash.
Richard MacCutchan 16-Jun-12 7:27am    
Dave Kreskowiak 16-Jun-12 10:05am    
It is a hash, and, on paper, it's not decryptable, well, because it's a hash.

The problem is MD5 was found to be weak and is considered broken by the industry, not to be used for any purposes. It can be attacked fairly easily and eventually (talking hours here) the password you hashed can be figured out.
Richard MacCutchan 16-Jun-12 10:12am    
Yes, my comments were perhaps an over simplification.
ShinigamiXoY 17-Jun-12 15:56pm    
Well what do you propose, what kind of password encryption is the most safest?
Nevermind i got it working.
Thanks anyway.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900