Änderungen LKWs.aspx Tabellengeneriung und Performanceanpassungen bei TestPerformance.vb und dem Login-HashTest Vorgang sowie der realen Passwortverhashung.

This commit is contained in:
ja
2022-01-19 10:57:31 +01:00
parent 402cad3ca0
commit 1c2d48fd51
6 changed files with 1812 additions and 1820 deletions

View File

@@ -178,11 +178,11 @@ Public Class TestPerformance
For zahl As Integer = 0 To zahlint For zahl As Integer = 0 To zahlint
sw1.Start() sw1.Start()
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(95, 105))) hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(95, 254)))
Else Else
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(95, 105))) hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(95, 105)))
End If End If
arrzahl_iterats.Add(VERAG_VARIABLES.RandomInteger(5, 10)) arrzahl_iterats.Add(VERAG_VARIABLES.RandomInteger(25, 45))
arrzahl.Add(zahlint) arrzahl.Add(zahlint)
sw1.Stop() sw1.Stop()
arrzeitp1.Add(sw1.ElapsedMilliseconds) arrzeitp1.Add(sw1.ElapsedMilliseconds)
@@ -190,9 +190,9 @@ Public Class TestPerformance
Next Next
Dim pw As String Dim pw As String
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
pw = "PasswordV$$$" + VERAG_VARIABLES.RandomInteger(115, 120 + (zahlint - 5)).ToString + "!!%" pw = "PasswordV$S" + VERAG_VARIABLES.RandomInteger(115, 120 + (zahlint - 5)).ToString + "!!%"
Else Else
pw = "&WAS5$WdAG&" + VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(1200, 2512), 3000 + (zahlint - VERAG_VARIABLES.RandomInteger(5, 17))).ToString + "##*p(=+UY" pw = "&WAS5$WdA&" + VERAG_VARIABLES.RandomInteger(VERAG_VARIABLES.RandomInteger(120, 512), VERAG_VARIABLES.RandomInteger(300, 8423) + (zahlint - VERAG_VARIABLES.RandomInteger(5, 17))).ToString + "#*p(=+UY"
End If End If
For zahl As Integer = 0 To zahlint For zahl As Integer = 0 To zahlint
sw2.Start() sw2.Start()

View File

@@ -69,7 +69,7 @@ Public Class VERAG_VARIABLES
Else Else
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password))) Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
Argon.Salt = salt Argon.Salt = salt
Argon.DegreeOfParallelism = 8 Argon.DegreeOfParallelism = 48
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 4) Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 4)
Argon.MemorySize = (((nIterations * 9.685 - (nIterations * 0.56) / 1.85 * 2.28) / 10.28) + 1.024 * 416) Argon.MemorySize = (((nIterations * 9.685 - (nIterations * 0.56) / 1.85 * 2.28) / 10.28) + 1.024 * 416)
Return Await Argon.GetBytesAsync(nHash) Return Await Argon.GetBytesAsync(nHash)

View File

@@ -474,8 +474,7 @@
Speditionslabel.textContent = id.split(',')[0]; Speditionslabel.textContent = id.split(',')[0];
natplaceholder.textContent = id.split(',')[1]; natplaceholder.textContent = id.split(',')[1];
//debugger //debugger
//for (let i = 0; i <= 5; i++) { //for (let i = 0; i <= 5; i++) {
// let SDL = "453543535434334543"; // let SDL = "453543535434334543";
// let Bez = "Diesel"; // let Bez = "Diesel";
@@ -533,7 +532,6 @@
natplaceholder.textContent = id_M.split(',')[1]; natplaceholder.textContent = id_M.split(',')[1];
//debugger //debugger
//for (let i = 0; i <= 5; i++) { //for (let i = 0; i <= 5; i++) {
// let SDL = "453543535434334543"; // let SDL = "453543535434334543";
// let Bez = "Diesel"; // let Bez = "Diesel";
@@ -561,13 +559,13 @@
for (let i = rowCount - 1; i >= 0; i--) { for (let i = rowCount - 1; i >= 0; i--) {
table_M.deleteRow(i); table_M.deleteRow(i);
} }
let strheader_M = '<tr style="background-color:#043381;color:#fff;width:385.5px"><th><td style="font-weight:600; color:white">SDL-Nr</td></th><th><td style="font-weight:600; color:white">Bezeichnung</td></th><th><td style="font-weight:600; color:white">Gueltig bis</td></th><th><td style="font-weight:600; color:white">Karten-Nummer</td></th></tr>'; let strheader_M = '<tr style="background-color:#043381;color:#fff;width:385.5px"><th style="font-weight:600; color:white;width:96.375px">SDL-Nr</th><th style="font-weight:600; color:white;width:96.375px">Bezeichnung</th><th style="font-weight:600; color:white;width:96.375px">Gueltig bis</th><th style="font-weight:600; color:white;width:96.375px">Karten-Nummer</th></tr>';
$('#<%=tablemain_m.ClientID%>').append(strheader_M); $('#<%=tablemain_m.ClientID%>').append(strheader_M);
for (var i = 0; i < result.length; i++) { for (var i = 0; i < result.length; i++) {
//let strHTML4 = '<tr><td>878465464634</td><td>DIESEL</td><td>12/05/2026</td><td>151515313521351</td></tr>' //let strHTML4 = '<tr><td>878465464634</td><td>DIESEL</td><td>12/05/2026</td><td>151515313521351</td></tr>'
//alert('Horray! 200 status code!' + result[i]); //alert('Horray! 200 status code!' + result[i]);
// alert(result.rows.length) // alert(result.rows.length)
let strHTML4 = '<tr style="width:385.5px"><td>' + result[i]["0"] + '</td><td>' + result[i]["1"] + '</td><td>' + result[i]["2"] + '</td><td>' + result[i]["3"] + '</td></tr>' let strHTML4 = '<tr style="width:385.5px"><td style="width:96.375px">' + result[i]["0"] + '</td><td style="width:96.375px">' + result[i]["1"] + '</td><td style="width:96.375px">' + result[i]["2"] + '</td><td style="width:96.375px">' + result[i]["3"] + '</td></tr>'
//alert(strHTML4) //alert(strHTML4)
$('#<%=tablemain_m.ClientID%>').append(strHTML4); $('#<%=tablemain_m.ClientID%>').append(strHTML4);
} }
@@ -583,4 +581,12 @@
} }
</script> </script>
<script>
function detailtabelle(id) {
alert(id)
}
function detailtabelle_M(id_M) {
alert(id_M)
}
</script>
</asp:Content> </asp:Content>

View File

@@ -558,13 +558,13 @@ Partial Class login_Change_PW
End If End If
End Function End Function
Function gensaltTokenAsync(STrings As String) As String Async Function gensaltTokenAsync(STrings As String) As Task(Of String)
If String.IsNullOrEmpty(STrings) = False Then If String.IsNullOrEmpty(STrings) = False Then
Dim token As Byte() Dim token As Byte()
Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl) Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl)
Dim tok As String = STrings Dim tok As String = STrings
token = VERAG_VARIABLES.HashPassword(tok, salt, intzahliterats, intzahl) token = Await VERAG_VARIABLES.HashPasswordAsync(tok, salt, intzahliterats, intzahl)
Return Convert.ToBase64String(token) Return Convert.ToBase64String(token)

View File

@@ -12,7 +12,6 @@ Partial Class login_FLEX
Public intzahliterats As Integer = -1 Public intzahliterats As Integer = -1
Protected Async Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init Protected Async Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
VERAG_VARIABLES.initerrorcount() VERAG_VARIABLES.initerrorcount()
End Sub End Sub
Protected Async Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Async Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -24,11 +23,11 @@ Partial Class login_FLEX
Dim teststr = String.Empty Dim teststr = String.Empty
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 7), Math.Pow(2, 10)) intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 6))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 7))) teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 5)))
Else Else
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 10), Math.Pow(2, 12)) intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 3), Math.Pow(2, 5))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 7))) teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 6)))
End If End If
If String.Equals(teststr, String.Empty) = False Then If String.Equals(teststr, String.Empty) = False Then
intzahliterats = VERAG_VARIABLES.getiterationnumber intzahliterats = VERAG_VARIABLES.getiterationnumber
@@ -255,7 +254,7 @@ Partial Class login_FLEX
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!" Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!"
End If End If
If String.Equals(tb3.Text, dr("Password")) = True Then If String.Equals(tb3.Text, dr("Password")) = True Then
intzahl = VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 7)) intzahl = VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 6))
salt = VERAG_VARIABLES.GenerateSalt(intzahl) salt = VERAG_VARIABLES.GenerateSalt(intzahl)
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl) Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl)
If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then