- Die Formen wurden alle vereinheitlicht, um die entsprechenden Parameter entgegenzunehmen.

Der zm Hashen des Passwortes benötigte Speicher wird  dynamisch je nach eingegebenem Passwort variiert, so kann kein Buffer-Overflow entstehen oder Underflow( Bei zu wenig Speicher pro Iterationenzahl/Bytesequenz).
This commit is contained in:
ja
2022-02-04 16:05:21 +01:00
parent eeddf3566f
commit bf91190e5e
17 changed files with 303 additions and 195 deletions

View File

@@ -22,9 +22,9 @@ Public Class VERAG_VARIABLES
End Function
Shared Function getiterationnumber() As Integer
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
Return RandomInteger(Math.Pow(2, 2), (0.55 * GetCpuSpeed()))
Return RandomInteger(Math.Pow(2, 2), (0.35 * GetCpuSpeed()))
Else
Return RandomInteger(Math.Pow(2, 3), (0.57 * GetMaxCpuSpeed()))
Return RandomInteger(Math.Pow(2, 5), (0.34 * GetCpuSpeed()))
End If
End Function
@@ -55,16 +55,18 @@ Public Class VERAG_VARIABLES
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
Argon.DegreeOfParallelism = 28
Argon.DegreeOfParallelism = 8
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 3)
Argon.MemorySize = (((nIterations * 9.98 - (nIterations * 10.23) / 14 * 2) / 4.058) + 1 * 190)
'Argon.MemorySize = (((nIterations * 19.98 - (nIterations * 10.23) / 14 * 2) / 4.058) + 1 * 190)
Argon.MemorySize = Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)).Length
Return Argon.GetBytes(nHash)
Else
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
Argon.Salt = salt
Argon.DegreeOfParallelism = 8
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 4)
Argon.MemorySize = (((nIterations * 13.88 - (nIterations * 10.23) / 8.85 * 2.28) / 10.28) + 2 * 878) / 13.1
Argon.DegreeOfParallelism = 10
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 3)
'Argon.MemorySize = (((nIterations * 20.98 - (nIterations * 10.23) / 14 * 2) / 4.058) + 1 * 190)
Argon.MemorySize = Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)).Length
Return Argon.GetBytes(nHash)
End If
End Function
@@ -74,16 +76,18 @@ Public Class VERAG_VARIABLES
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
Argon.DegreeOfParallelism = 44
Argon.DegreeOfParallelism = 8
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 3)
Argon.MemorySize = (((nIterations * 15.98 - (nIterations * 10.23) / 14 * 2) / 4.058) + 1 * 190)
'Argon.MemorySize = (((nIterations * 19.98 - (nIterations * 10.23) / 14 * 2) / 4.058) + 1 * 190)
Argon.MemorySize = Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)).Length
Return Await Argon.GetBytesAsync(nHash)
Else
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
Argon.Salt = salt
Argon.DegreeOfParallelism = 14
Argon.DegreeOfParallelism = 10
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 3)
Argon.MemorySize = (((nIterations * 13.88 - (nIterations * 10.23) / 8.85 * 2.28) / 10.28) + 2 * 878) / 13.1
'Argon.MemorySize = (((nIterations * 21.98 - (nIterations * 10.23) / 14 * 2) / 4.058) + 1 * 190)
Argon.MemorySize = Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)).Length
Return Await Argon.GetBytesAsync(nHash)
End If
End Function