Ändeurngen Hashverfahren test
This commit is contained in:
@@ -51,7 +51,6 @@ Public Class VERAG_VARIABLES
|
||||
|
||||
Public Shared Function HashPassword(password As String, salt As Byte(), nIterations As Integer, nHash As Integer) As Byte()
|
||||
'Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(password))
|
||||
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
|
||||
Argon.Salt = salt
|
||||
@@ -72,7 +71,6 @@ Public Class VERAG_VARIABLES
|
||||
End Function
|
||||
Public Shared Async Function HashPasswordAsync(password As String, salt As Byte(), nIterations As Integer, nHash As Integer) As Task(Of Byte())
|
||||
'Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(password))
|
||||
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
|
||||
Argon.Salt = salt
|
||||
@@ -89,7 +87,6 @@ Public Class VERAG_VARIABLES
|
||||
Return Await Argon.GetBytesAsync(nHash)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Shared Function Verifyhash(ByVal passw As String, salt As Byte(), ByVal hash As Byte(), ByVal nIterations As Integer, ByVal nHash As Integer) As Boolean
|
||||
Dim newHash As Byte() = HashPassword(passw, salt, nIterations, nHash)
|
||||
Return hash.SequenceEqual(newHash)
|
||||
@@ -104,6 +101,4 @@ Public Class VERAG_VARIABLES
|
||||
rand.GetBytes(one_byte)
|
||||
Return min + (max - min) * (one_byte(0) / 255)
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user