I\'m using a website as a frontend and all users are authenticated with the standard ASP.NET Membership-Provider. Passwords are saved \"hashed\" within a SQL-Database.
Quick dirty method
Public Shared Function GetSaltKey() As String
Dim saltBytes() As Byte
Dim minSaltSize As Integer = 4
Dim maxSaltSize As Integer = 8
' Generate a random number for the size of the salt.
Dim random As Random
random = New Random()
Dim saltSize As Integer
saltSize = random.Next(minSaltSize, maxSaltSize)
' Allocate a byte array, which will hold the salt.
saltBytes = New Byte(saltSize - 1) {}
' Initialize a random number generator.
Dim rng As RNGCryptoServiceProvider
rng = New RNGCryptoServiceProvider()
' Fill the salt with cryptographically strong byte values.
rng.GetNonZeroBytes(saltBytes)
' Convert plain text into a byte array.
Return Convert.ToBase64String(saltBytes)
End Function
Public Shared Function ComputeHash(ByVal password As String, ByVal salt As String) As String
Return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(salt & password, _
System.Web.Configuration.FormsAuthPasswordFormat.SHA1.ToString)
End Function
Although, the membership namespace has stuff built in for this as well, as stated by Forgotten Semicolon