hello all
not sure if this is the right place for this but ill give it a shot
i am having trouble with md5 hashing. when i hash my password and send it to the database it looks like this
i wish my password to hash and look like this
im using mysql as my database and i have 3 fields id, user, and pass
i used varchar for pass but im not sure thats the right type
the type i need has to be able to store binary data. heres my code can you point out anything that would make it no be hexadecimal. Is there away to convert my hash to hexadecimal?
not sure if this is the right place for this but ill give it a shot
i am having trouble with md5 hashing. when i hash my password and send it to the database it looks like this
i wish my password to hash and look like this
im using mysql as my database and i have 3 fields id, user, and pass
i used varchar for pass but im not sure thats the right type
the type i need has to be able to store binary data. heres my code can you point out anything that would make it no be hexadecimal. Is there away to convert my hash to hexadecimal?
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim connectionString As String = "Driver={MySQL ODBC 3.51 Driver};option=4;SERVER=localhost;DATABASE=test;uid=root;pwd=omhoux;"
conn = New OdbcConnection(connectionString)
conn.Open()
Dim ix As New OdbcCommand("INSERT INTO info(user, pass) VALUES (?,?)", conn)
ix.Parameters.Add("@user", OdbcType.VarChar, 255).Value = TextBox1.Text
'Encrypt the password
Dim md5Hasher As New MD5CryptoServiceProvider
Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding
hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(TextBox2.Text))
ix.Parameters.Add("@pass", OdbcType.Binary, 32).Value = hashedBytes
ix.ExecuteNonQuery()
conn.Close()
Label3.Text = "Success!"
TextBox1.Text = ""
TextBox2.Text = ""
End Sub