Verbesserung LKW Methoden und AJAX Calls sowie Anpassungen der TestPerformance-Zeitoptimierungen

This commit is contained in:
ja
2022-01-11 16:56:54 +01:00
parent c73831e789
commit ead096abb5
6 changed files with 1262 additions and 1232 deletions

View File

@@ -193,6 +193,8 @@ Public Class TestPerformance
sw2.Reset() sw2.Reset()
Next Next
For Each zp1 In arrzeitp1 For Each zp1 In arrzeitp1
If arrzeitp1(zp1) < arrzeitp2(zp1) Then If arrzeitp1(zp1) < arrzeitp2(zp1) Then
arrzeitp3.Add(arrzeitp1.Item(zp1)) arrzeitp3.Add(arrzeitp1.Item(zp1))

View File

@@ -51,6 +51,7 @@ Public Class VERAG_VARIABLES
Argon.DegreeOfParallelism = 32 Argon.DegreeOfParallelism = 32
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 5) Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 5)
Argon.MemorySize = (((nIterations * 7.685 - (nIterations * 0.56) / 1.85 * 2.28) / 10.28) + 1.024 * 416) Argon.MemorySize = (((nIterations * 7.685 - (nIterations * 0.56) / 1.85 * 2.28) / 10.28) + 1.024 * 416)
Return Argon.GetBytes(nHash) Return Argon.GetBytes(nHash)
End If End If
@@ -69,11 +70,12 @@ 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 = 32 Argon.DegreeOfParallelism = 22
Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 5) Argon.Iterations = nIterations * VERAG_VARIABLES.RandomInteger(2, 5)
Argon.MemorySize = (((nIterations * 7.685 - (nIterations * 0.56) / 1.85 * 2.28) / 10.28) + 1.024 * 416) Argon.MemorySize = (((nIterations * 7.685 - (nIterations * 0.56) / 1.85 * 2.28) / 10.28) + 1.024 * 416)
Return Await Argon.GetBytesAsync(nHash) Return Await Argon.GetBytesAsync(nHash)
End If End If
End Function End Function
Public Shared Function Verifyhash(ByVal passw As String, salt As Byte(), ByVal hash As Byte(), ByVal nIterations As Integer, ByVal nHash As Integer) As Boolean Public Shared Function Verifyhash(ByVal passw As String, salt As Byte(), ByVal hash As Byte(), ByVal nIterations As Integer, ByVal nHash As Integer) As Boolean

View File

@@ -88,23 +88,19 @@
<!-- <asp:Table ID="tbl_mainpage" ClientIDMode="Static" runat="server" Width="100%" style="background-color:#fff;overflow-y:auto;" CssClass="table table-striped col-12"> <!-- <asp:Table ID="tbl_mainpage" ClientIDMode="Static" runat="server" Width="100%" style="background-color:#fff;overflow-y:auto;" CssClass="table table-striped col-12">
<asp:TableHeaderRow ID="headrow1" runat="server" style="background-color:#043381;color:#fff;height:10px"><asp:TableHeaderCell ID="tblhc_SDLNr">SDL-Nr</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_Bez">Bezeichnung</asp:TableHeaderCell><asp:TableHeaderCell ID="tbl_gueltig">Gültig Bis</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_KarteNr">Karten-Nummer</asp:TableHeaderCell></asp:TableHeaderRow> <asp:TableHeaderRow ID="headrow1" runat="server" style="background-color:#043381;color:#fff;height:10px"><asp:TableHeaderCell ID="tblhc_SDLNr">SDL-Nr</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_Bez">Bezeichnung</asp:TableHeaderCell><asp:TableHeaderCell ID="tbl_gueltig">Gültig Bis</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_KarteNr">Karten-Nummer</asp:TableHeaderCell></asp:TableHeaderRow>
</asp:Table>--> </asp:Table>-->
<table runat="server" id="tablemain" class="col-12"> <table id="tablemain" runat="server" class="col-12">
<tr style="background-color: #043381; color: #fff"> <tr style="background-color: #043381; color: #fff">
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center">SDL <td style="font-weight: 600; color: white; text-align: center">SDL</td>
</td>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center">Bezeichnung <td style="font-weight: 600; color: white; text-align: center">Bezeichnung</td>
</td>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center">Gültig bis <td style="font-weight: 600; color: white; text-align: center">Gültig bis</td>
</td>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center">Kartennummer <td style="font-weight: 600; color: white; text-align: center">Kartennummer</td>
</td>
</th> </th>
</tr> </tr>
</table> </table>
@@ -150,27 +146,19 @@
<!-- <asp:Table ID="tbl_mainpage_M" ClientIDMode="Static" runat="server" Width="100%" CssClass="table table-striped col-12"> <!-- <asp:Table ID="tbl_mainpage_M" ClientIDMode="Static" runat="server" Width="100%" CssClass="table table-striped col-12">
<asp:TableHeaderRow runat="server" ID="headrow_M" style="background-color:#043381;color:#fff"><asp:TableHeaderCell ID="tblhc_SDLNr_M">SDL_Nr</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_Bez_M">Bezeichnung</asp:TableHeaderCell><asp:TableHeaderCell ID="tbl_gueltig_M">Gültig Bis</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_KarteNr_M">Karten-Nummer</asp:TableHeaderCell></asp:TableHeaderRow> <asp:TableHeaderRow runat="server" ID="headrow_M" style="background-color:#043381;color:#fff"><asp:TableHeaderCell ID="tblhc_SDLNr_M">SDL_Nr</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_Bez_M">Bezeichnung</asp:TableHeaderCell><asp:TableHeaderCell ID="tbl_gueltig_M">Gültig Bis</asp:TableHeaderCell><asp:TableHeaderCell ID="tblhc_KarteNr_M">Karten-Nummer</asp:TableHeaderCell></asp:TableHeaderRow>
</asp:Table>--> </asp:Table>-->
<table runat="server" id="tablemain_m" class="col-12"> <table id="tablemain_m" runat="server" class="col-12">
<tr style="background-color:#043381;color:#fff"> <tr style="background-color:#043381;color:#fff">
<th style="text-align:center"> <th style="text-align:center">
<td style="font-weight: 600;color:white"> <td style="font-weight: 600;color:white">SDL</td>
SDL
</td>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center"> <td style="font-weight: 600; color: white; text-align: center">Bezeichnung</td>
Bezeichnung
</td>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center"> <td style="font-weight: 600; color: white; text-align: center">Gültig bis</td>
Gültig bis
</td>
</th> </th>
<th style="text-align: center"> <th style="text-align: center">
<td style="font-weight: 600; color: white; text-align: center"> <td style="font-weight: 600; color: white; text-align: center">Kartennummer</td>
Kartennummer
</td>
</th> </th>
</tr> </tr>
</table> </table>
@@ -353,6 +341,42 @@
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
function renderTable(result) {
var dtData = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
$.each(result, function () {
dtData.push([
this.SDLNr,
this.Bez,
this.Gueltigbis,
this.Kartnr
]);
});
$('#<%=tablemain.ClientID%>').dataTable({
'aaData': dtData,
"bJQueryUI": true
});
}
function renderTable_M(result_M) {
var dtData = [];
// Data tables requires all data to be stuffed into a generic jagged array, so loop through our
// typed object and create one.
$.each(result_M, function () {
dtData.push([
this.SDLNr,
this.Bez,
this.Gueltigbis,
this.Kartnr
]);
});
$('#<%=tablemain_m.ClientID%>').dataTable({
'aaData': dtData,
"bJQueryUI": true
});
}
function doPostBack(id) { function doPostBack(id) {
let Speditionslabel = document.getElementById('<%=lbl_sped_Placeholder.ClientID%>'); let Speditionslabel = document.getElementById('<%=lbl_sped_Placeholder.ClientID%>');
let natplaceholder = document.getElementById('<%=lbl_Placeholder.ClientID%>'); let natplaceholder = document.getElementById('<%=lbl_Placeholder.ClientID%>');
@@ -389,15 +413,16 @@
success: function (data) { success: function (data) {
let JSONObj = data.d; let JSONObj = data.d;
// addheader(); // addheader();
let strHTML = '<tr style="background-color:#043381;color:#fff"><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 strHTML = '<tr style="background-color:#043381;color:#fff"><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>';
alert('Horray! 200 status code!'); alert('Horray! 200 status code!');
// alert(result.rows.length) // alert(result.rows.length)
$(JSONObj).each(function () { //$(JSONObj).each(function () {
let row = $(this)[0]; // let row = $(this)[0];
strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>'; // strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>';
alert(strHTML) // alert(strHTML)
}); // });
$('#<%=tablemain.ClientID%>').html(strHTML); // $('#<%'=tablemain.ClientID%>').html(strHTML);
renderTable(JSONObj)
}, },
error: function (jqXHR, textStatus, errorThrown) { error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown); alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);
@@ -438,15 +463,16 @@
success: function (data) { success: function (data) {
result = data.d; result = data.d;
// addheader(); // addheader();
let strHTML = '<tr style="background-color:#043381;color:#fff"><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 strHTML = '<tr style="background-color:#043381;color:#fff"><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>';
alert('Horray! 200 status code!'); alert('Horray! 200 status code!');
$(result).each(function () { //$(result).each(function () {
let row = $(this)[0]; // let row = $(this)[0];
strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>'; // strHTML += '<tr><td>' + row["SDL"] + '</td><td>' + row["Bez"] + '</td><td>' + row["Gueltigbis"] + '</td><td>' + row["KartNr"] + '</td></tr>';
alert(strHTML) // alert(strHTML)
}); //});
$('#<%=tablemain_m.ClientID%>').html(strHTML); //$('#<%'=tablemain_m.ClientID%>').html(strHTML);
renderTable_M(result);
}, },
error: function (jqXHR, textStatus, errorThrown) { error: function (jqXHR, textStatus, errorThrown) {
alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown); alert("Status:" + jqXHR.status + "\nStatusText: " + textStatus + "\nError:" + errorThrown);

View File

@@ -19,8 +19,8 @@ Partial Class login_FLEX
Else Else
Try Try
Dim teststr = String.Empty Dim teststr = String.Empty
intzahliterats = VERAG_VARIABLES.RandomInteger(2, Math.Pow(2, 10)) intzahliterats = VERAG_VARIABLES.RandomInteger(2, Math.Pow(2, 5))
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(2, Math.Pow(2, 6))) teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(2, Math.Pow(2, 7)))
If String.Equals(teststr, String.Empty) = False Then If String.Equals(teststr, String.Empty) = False Then
intzahliterats = VERAG_VARIABLES.getiterationnumber intzahliterats = VERAG_VARIABLES.getiterationnumber
End If End If
@@ -246,7 +246,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(Math.Pow(2, 8), Math.Pow(2, 10)) intzahl = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 8), Math.Pow(2, 12))
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