diff --git a/App_Code/TestPerformance.vb b/App_Code/TestPerformance.vb index 70ae32e..28ff71e 100644 --- a/App_Code/TestPerformance.vb +++ b/App_Code/TestPerformance.vb @@ -130,14 +130,14 @@ Public Class TestPerformance Dim finalhash As Byte() For zahl As Integer = 0 To zahlint sw1.Start() - hashsalts.Add(VERAG_VARIABLES.GenerateSalt(arrzahl(zahl))) + hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 1), Math.Pow(2, 5)))) arrzahl_iterats.Add(VERAG_VARIABLES.getiterationnumber) arrzahl.Add(zahlint) sw1.Stop() arrzeitp1.Add(sw1.ElapsedMilliseconds) sw1.Reset() Next - Dim pw As String = "qV64nS4" + Dim pw As String = "q!V64nS4" For zahl As Integer = 0 To zahlint sw2.Start() hashbytes.Add(VERAG_VARIABLES.HashPassword(pw, hashsalts(zahl), arrzahl_iterats(zahl), arrzahl(zahl))) diff --git a/Customers/Default2.aspx b/Customers/Default2.aspx index c1bdd1b..0686373 100644 --- a/Customers/Default2.aspx +++ b/Customers/Default2.aspx @@ -80,7 +80,7 @@ - + diff --git a/Customers/Default2.aspx.vb b/Customers/Default2.aspx.vb index b51dcea..14deabb 100644 --- a/Customers/Default2.aspx.vb +++ b/Customers/Default2.aspx.vb @@ -1,6 +1,7 @@ Imports Konscious.Security.Cryptography Partial Class Customers_Default2 Inherits System.Web.UI.Page + Dim nIterations As Integer = VERAG_VARIABLES.getiterationnumber Protected Sub Page_Load(ByVal sender As Object, e As EventArgs) Handles Me.Load If Page.IsPostBack Then @@ -35,6 +36,27 @@ Partial Class Customers_Default2 End Sub Protected Sub btn_TesthashrateServer_ClickAsync(sender As Object, e As EventArgs) Handles btn_TesthashrateServer.Click - Dim pwhashresult As Byte() = TestPerformance.TestHashrateServer(VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 2), Math.Pow(2, 5)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 7)))) + Dim Boole As Boolean = New Boolean + Dim ram As Double = Double.Parse(My.Computer.Info.TotalPhysicalMemory.ToString) + + Dim MemorySizelocal = ((nIterations * 4.98 - (nIterations * 1.23) / 4 * 1.5) / 1.05) + 1 * 290 + Dim MemorySizeProductionServ = ((nIterations * 8.485 - (nIterations * 0.56) / 1.85 * 2.28) / 8.28) + 1.024 * 416 + + If MemorySizelocal < ram And HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then + Dim pwhashresult As Byte() = TestPerformance.TestHashrateServer(VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 0), Math.Pow(2, 3)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 6)))) + Boole = True + ElseIf MemorySizeProductionServ < ram And Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then + Dim pwhashresult As Byte() = TestPerformance.TestHashrateServer(VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 2), Math.Pow(2, 4)), VERAG_VARIABLES.RandomInteger(Math.Pow(2, 5), Math.Pow(2, 7)))) + Boole = True + Else + Boole = False + End If + If Boole = True Then + lbl_Status.Text = "Der Test wurde erfolgreich bestanden!" + ElseIf Boole = False AndAlso HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then + lbl_Status.Text = "Test fehlgeschlagen! Es fehlen mindestens " + MemorySizelocal - ram + "Bytes RAM!" + ElseIf Boole = False AndAlso Not HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then + lbl_Status.Text = "Test fehlgeschlagen! Es fehlen mindestens " + MemorySizeProductionServ - ram + "Bytes RAM!" + End If End Sub End Class diff --git a/Customers/LKWs.aspx b/Customers/LKWs.aspx index c92cc82..53687c3 100644 --- a/Customers/LKWs.aspx +++ b/Customers/LKWs.aspx @@ -310,8 +310,11 @@ }