I am working on a project, where I "read" (with Visual Basic) the serial number of the hard disk of the user's PC, save it in a variable and send it to a php page. I have solved the problem by sending it by the Get method, however, I want to send the data in a more secure way, that is, in which it is not visible to the user. Is there any way to do it? , I would greatly appreciate your help.
The code (in Visual Basic) that I have is the following:
Imports System.Security.Cryptography
Imports System.Text
Public Class Form1
Function MDhash(ByVal password As String)
Dim md5 As MD5 = New MD5CryptoServiceProvider()
Dim result As Byte()
result = md5.ComputeHash(Encoding.ASCII.GetBytes(password))
Dim strBuilder As New StringBuilder()
For i As Integer = 0 To result.Length - 1
strBuilder.Append(result(i).ToString("x2"))
Next
Return strBuilder.ToString()
End Function
Private Sub btnSalir_Click(sender As System.Object, e As System.EventArgs) Handles btnSalir.Click
Dim salir As Integer
salir = MessageBox.Show("Desea salir", "ADMINISTRADOR", _
MessageBoxButtons.OKCancel, MessageBoxIcon.Stop)
If salir = 1 Then
Close()
End If
End Sub
Private Sub btnIniciar_Click(sender As System.Object, e As System.EventArgs) Handles btnIniciar.Click
Dim disco As New _
System.Management.ManagementObject( _
"Win32_PhysicalMedia='\.\PHYSICALDRIVE0'") 'Código para saber serial físico del Disco Duro'
Dim value As String = MDhash(disco.Properties("SerialNumber").Value)
Process.Start("http://localhost/proyecto/index.php?" & value)
Me.Close()
End Sub
End Class