Anpassungen an Serversettings vs localhost Hosting bzgl Sicherheit

This commit is contained in:
ja
2022-01-14 08:49:57 +01:00
parent 94dc89aa04
commit 9d029524d0
3 changed files with 1553 additions and 1550 deletions

View File

@@ -177,14 +177,23 @@ Public Class TestPerformance
For zahl As Integer = 0 To zahlint
sw1.Start()
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 8))))
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 8))))
Else
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 10))))
End If
arrzahl_iterats.Add(VERAG_VARIABLES.getiterationnumber)
arrzahl.Add(zahlint)
sw1.Stop()
arrzeitp1.Add(sw1.ElapsedMilliseconds)
sw1.Reset()
Next
Dim pw As String = "PasswordV" + VERAG_VARIABLES.RandomInteger(5, zahlint - 5).ToString + "!!%"
Dim pw As String
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
pw = "PasswordV" + VERAG_VARIABLES.RandomInteger(5, zahlint - 5).ToString + "!!%"
Else
pw = "&WAS5$WdAG&" + VERAG_VARIABLES.RandomInteger(55, zahlint - VERAG_VARIABLES.RandomInteger(5, 87)).ToString + "#*p(=+UY"
End If
For zahl As Integer = 0 To zahlint
sw2.Start()
hashbytes.Add(Await VERAG_VARIABLES.HashPasswordAsync(pw, hashsalts(zahl), arrzahl_iterats(zahl), arrzahl(zahl)))

View File

@@ -19,8 +19,14 @@ Partial Class login_FLEX
Else
Try
Dim teststr = String.Empty
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 13))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 3), Math.Pow(2, 7)))
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 7), Math.Pow(2, 11))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(2, Math.Pow(2, 10)))
Else
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 8), Math.Pow(2, 14))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 11)))
End If
If String.Equals(teststr, String.Empty) = False Then
intzahliterats = VERAG_VARIABLES.getiterationnumber
End If