Hello

I have two columns in my MS Access database called 'hashed' and 'salt' and would now like to populate them from my 'Register new user' Web page. I have the following code (not always sure which line to comment out and which not):

Code:
Imports System.Security.Cryptography
Imports System.Web.Helpers
Imports System.Text 

'Hash the password:

'Public Function Hash512(password As String, salt As String) As String

Public Function HashSHA512(password As String, salt As String) As String

        Dim convertedToBytes As Byte() = Encoding.UTF8.GetBytes(password & salt)

        Dim hashType As HashAlgorithm = New SHA512Managed()

        Dim hashBytes As Byte() = hashType.ComputeHash(convertedToBytes)

        Dim hashedResult As String = Convert.ToBase64String(hashBytes)

        Return hashedResult

End Function

'Handle the button click event:

Protected Sub btnReg_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReg.Click

'Private Sub btnReg_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReg.Click

        'hashedResult = (Hash512(password.Text, CreateRandomSalt))

        hashedResult = (HashSHA512(password.Text, CreateRandomSalt))

        End Sub
Is this all I need to do, please, to populate my two columns? It gets very confusing with other code snippets referring to RNGCryptoServiceProvider(), GenerateRandomSalt, GenerateRandomNumber, etc.

All basically I would like to do is salt and hash the password that the user submits when registering as a new user.

Thank you.