Ä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
sw1.Start()
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
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(VERAG_VARIABLES.RandomInteger(95, 105)))
End If
arrzahl_iterats.Add(VERAG_VARIABLES.RandomInteger(5, 10))
arrzahl_iterats.Add(VERAG_VARIABLES.RandomInteger(25, 45))
arrzahl.Add(zahlint)
sw1.Stop()
arrzeitp1.Add(sw1.ElapsedMilliseconds)
@@ -190,9 +190,9 @@ Public Class TestPerformance
Next
Dim pw As String
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
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
For zahl As Integer = 0 To zahlint
sw2.Start()

View File

@@ -69,7 +69,7 @@ Public Class VERAG_VARIABLES
Else
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
Argon.Salt = salt
Argon.DegreeOfParallelism = 8
Argon.DegreeOfParallelism = 48
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)
Return Await Argon.GetBytesAsync(nHash)

View File

@@ -475,7 +475,6 @@
natplaceholder.textContent = id.split(',')[1];
//debugger
//for (let i = 0; i <= 5; i++) {
// let SDL = "453543535434334543";
// let Bez = "Diesel";
@@ -533,7 +532,6 @@
natplaceholder.textContent = id_M.split(',')[1];
//debugger
//for (let i = 0; i <= 5; i++) {
// let SDL = "453543535434334543";
// let Bez = "Diesel";
@@ -561,13 +559,13 @@
for (let i = rowCount - 1; i >= 0; 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);
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>'
//alert('Horray! 200 status code!' + result[i]);
// 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)
$('#<%=tablemain_m.ClientID%>').append(strHTML4);
}
@@ -583,4 +581,12 @@
}
</script>
<script>
function detailtabelle(id) {
alert(id)
}
function detailtabelle_M(id_M) {
alert(id_M)
}
</script>
</asp:Content>

View File

@@ -558,13 +558,13 @@ Partial Class login_Change_PW
End If
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
Dim token As Byte()
Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl)
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)

View File

@@ -12,7 +12,6 @@ Partial Class login_FLEX
Public intzahliterats As Integer = -1
Protected Async Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
VERAG_VARIABLES.initerrorcount()
End Sub
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
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 7), Math.Pow(2, 10))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 7)))
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 6))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 5)))
Else
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 10), Math.Pow(2, 12))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 7)))
intzahliterats = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 3), Math.Pow(2, 5))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(95, Math.Pow(2, 6)))
End If
If String.Equals(teststr, String.Empty) = False Then
intzahliterats = VERAG_VARIABLES.getiterationnumber
@@ -255,7 +254,7 @@ Partial Class login_FLEX
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Username is not in the database!"
End If
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)
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