@@ -1,10 +1,8 @@
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports System.Diagnostics
|
|
||||||
Imports Microsoft.VisualBasic
|
Imports Microsoft.VisualBasic
|
||||||
|
|
||||||
|
|
||||||
Public Class TestPerformance
|
Public Class TestPerformance
|
||||||
Public Shared zeitspannefürtest As Long
|
|
||||||
Public Shared Sub createnUsers(ByRef n As Integer)
|
Public Shared Sub createnUsers(ByRef n As Integer)
|
||||||
Dim ConnectionString = ""
|
Dim ConnectionString = ""
|
||||||
|
|
||||||
@@ -111,54 +109,5 @@ Public Class TestPerformance
|
|||||||
|
|
||||||
End Using
|
End Using
|
||||||
End Sub
|
End Sub
|
||||||
Public Shared Sub DeleteUsers()
|
Public Shared DeleteUsers()
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Shared Async Function TestSaltHashRateMax(z As Integer) As Threading.Tasks.Task(Of Byte())
|
|
||||||
Dim timespan As Long = New Long()
|
|
||||||
Dim timespan2 As Long = New Long()
|
|
||||||
|
|
||||||
Dim Bytearr As List(Of Byte()) = New List(Of Byte())
|
|
||||||
Dim pwarr As List(Of Byte()) = New List(Of Byte())
|
|
||||||
Dim pwselectedindex As Integer = -1
|
|
||||||
For ztemp As Integer = 0 To z
|
|
||||||
Bytearr.Add(VERAG_VARIABLES.GenerateSalt(z))
|
|
||||||
Next
|
|
||||||
For ztemp As Integer = 0 To z
|
|
||||||
Dim timer1 As Stopwatch = New Stopwatch
|
|
||||||
timer1.Start()
|
|
||||||
If timer1.IsRunning = True Then
|
|
||||||
Bytearr.Add(VERAG_VARIABLES.GenerateSalt(z))
|
|
||||||
Dim iteras As Integer = VERAG_VARIABLES.getiterationnumber()
|
|
||||||
Dim intz As Integer = VERAG_VARIABLES.RandomInteger(0, z)
|
|
||||||
Dim Passw As String = "XFV2ctdhB5G*S!r"
|
|
||||||
pwarr.Add(Await VERAG_VARIABLES.HashPassword(Passw, Bytearr.Item(z), iteras, intz))
|
|
||||||
End If
|
|
||||||
timer1.Stop()
|
|
||||||
timespan = timer1.ElapsedMilliseconds
|
|
||||||
Dim timer2 As Stopwatch = New Stopwatch
|
|
||||||
timer2.Start()
|
|
||||||
If timer2.IsRunning = True Then
|
|
||||||
Bytearr.Add(VERAG_VARIABLES.GenerateSalt(z))
|
|
||||||
Dim iteras As Integer = VERAG_VARIABLES.getiterationnumber()
|
|
||||||
Dim intz As Integer = VERAG_VARIABLES.RandomInteger(0, z)
|
|
||||||
Dim Passw As String = "XFV2ctdhB5G*S!r"
|
|
||||||
pwarr.Add(Await VERAG_VARIABLES.HashPassword(Passw, Bytearr.Item(z), iteras, intz))
|
|
||||||
End If
|
|
||||||
timer2.Stop()
|
|
||||||
timespan2 = timer2.ElapsedMilliseconds
|
|
||||||
If timespan2 < timespan Then
|
|
||||||
pwselectedindex = z
|
|
||||||
zeitspannefürtest = timespan2
|
|
||||||
ElseIf timespan < timespan2 Then
|
|
||||||
pwselectedindex = z
|
|
||||||
zeitspannefürtest = timespan
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
If Not pwselectedindex = -1 Then
|
|
||||||
Return Bytearr(pwselectedindex)
|
|
||||||
End If
|
|
||||||
|
|
||||||
End Function
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Customers_Default" Async="true" %>
|
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Customers_Default" %>
|
||||||
|
|
||||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
|
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Customers_Default2" Async="true" %>
|
<%@ Page Title="" Language="VB" MasterPageFile="~/Customers/Customers.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Customers_Default2" %>
|
||||||
|
|
||||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"><%If String.Equals(Page.User.Identity.Name, "Admin") = False Then
|
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"><%If String.Equals(Page.User.Identity.Name, "Admin") = False Then
|
||||||
FormsAuthentication.RedirectToLoginPage()
|
FormsAuthentication.RedirectToLoginPage()
|
||||||
@@ -79,8 +79,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
<tr><td><asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></td></tr>
|
<tr><td><asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></td></tr>
|
||||||
<tr><td><asp:Button ID="Butn_TestHashrate" runat="server" OnClick="Butn_TestHashrate_ClickAsync" BackColor="WhiteSmoke" Text="Test the Hashrate of the Server"/></td></tr>
|
|
||||||
<tr><td><asp:Label ID="lbl_resulttesthashrate" runat="server" ClientIDMode="AutoID">Hier wird das Ergebnis angezeigt!</asp:Label></td></tr>
|
|
||||||
</table>
|
</table>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Partial Class Customers_Default2
|
Partial Class Customers_Default2
|
||||||
Inherits System.Web.UI.Page
|
Inherits System.Web.UI.Page
|
||||||
Protected Async Sub Page_Load(ByVal sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(ByVal sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Page.IsPostBack Then
|
If Page.IsPostBack Then
|
||||||
Page.MaintainScrollPositionOnPostBack = True
|
Page.MaintainScrollPositionOnPostBack = True
|
||||||
@@ -33,12 +33,4 @@ Partial Class Customers_Default2
|
|||||||
txt_Fehlercodezuzahl.Text = finalstr
|
txt_Fehlercodezuzahl.Text = finalstr
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Async Function Butn_TestHashrate_ClickAsync(sender As Object, e As EventArgs) As Threading.Tasks.Task
|
|
||||||
Dim ztemp As Byte() = Await TestPerformance.TestSaltHashRateMax(VERAG_VARIABLES.RandomInteger(Math.Pow(2, 10), Math.Pow(2, 14)))
|
|
||||||
|
|
||||||
lbl_resulttesthashrate.ForeColor = Drawing.Color.GreenYellow
|
|
||||||
lbl_resulttesthashrate.Text = "Successful Test with: " + Convert.ToBase64String(ztemp) + "in der zeit: " + Space(2) + TimeSpan.FromMilliseconds(TestPerformance.zeitspannefürtest).Milliseconds.ToString
|
|
||||||
|
|
||||||
End Function
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<%@ import Namespace="MySql.Data.MySqlClient" %>
|
<%@ import Namespace="MySql.Data.MySqlClient" %>
|
||||||
<script runat="server">
|
<script runat="server">
|
||||||
Overloads Sub Page_Load() Handles Me.Load
|
Sub Page_Load() Handles Me.Load
|
||||||
|
|
||||||
' MsgBox ("test")
|
' MsgBox ("test")
|
||||||
'Dim con As New MySqlConnection
|
'Dim con As New MySqlConnection
|
||||||
'Dim cmd As New MySqlCommand
|
'Dim cmd As New MySqlCommand
|
||||||
|
|||||||
Reference in New Issue
Block a user