Hashfunktion und Saltgenerierung funktionieren wieder wie angenommen.
This commit is contained in:
12
App_Code/LinkFactory.vb
Normal file
12
App_Code/LinkFactory.vb
Normal file
@@ -0,0 +1,12 @@
|
||||
Imports System.Threading.Tasks
|
||||
Imports Microsoft.VisualBasic
|
||||
|
||||
Public Class LinkFactory
|
||||
Public Shared Async Function createLink(link As String, par1 As String, par2 As String, par3 As String) As Threading.Tasks.Task(Of String)
|
||||
Dim factorymain As StringBuilder = New StringBuilder(link)
|
||||
factorymain.AppendFormat("?P1={1}&P2={2}", par1, par2, par3)
|
||||
Dim result As String = factorymain.ToString
|
||||
Await Task.Delay(2)
|
||||
Return result
|
||||
End Function
|
||||
End Class
|
||||
@@ -117,7 +117,6 @@ Public Class TestPerformance
|
||||
Public Shared finalzeit As Long
|
||||
|
||||
Public Shared Function TestHashrateServer(zahlint As Integer) As Byte()
|
||||
Dim arrkeys As New List(Of Byte())
|
||||
Dim arrzahl As New List(Of Integer)
|
||||
Dim arrzahl_iterats As New List(Of Integer)
|
||||
Dim hashbytes As New List(Of Byte())
|
||||
@@ -125,12 +124,13 @@ Public Class TestPerformance
|
||||
Dim arrzeitp2 As New List(Of Long)
|
||||
Dim arrzeitp3 As New List(Of Long)
|
||||
Dim finalarr As New List(Of Byte())
|
||||
Dim hashsalts As New List(Of Byte())
|
||||
Dim sw1 As Stopwatch = New Stopwatch
|
||||
Dim sw2 As Stopwatch = New Stopwatch
|
||||
Dim finalhash As Byte()
|
||||
For zahl As Integer = 0 To zahlint
|
||||
sw1.Start()
|
||||
arrkeys.Add(VERAG_VARIABLES.GenerateSalt(zahlint))
|
||||
hashsalts.Add(VERAG_VARIABLES.GenerateSalt(arrzahl(zahl)))
|
||||
arrzahl_iterats.Add(VERAG_VARIABLES.getiterationnumber)
|
||||
arrzahl.Add(zahlint)
|
||||
sw1.Stop()
|
||||
@@ -140,7 +140,7 @@ Public Class TestPerformance
|
||||
Dim pw As String = "qV64nS4"
|
||||
For zahl As Integer = 0 To zahlint
|
||||
sw2.Start()
|
||||
hashbytes.Add(VERAG_VARIABLES.HashPassword(pw, arrkeys(zahl), arrzahl_iterats(zahl), arrzahl(zahl)))
|
||||
hashbytes.Add(VERAG_VARIABLES.HashPassword(pw, hashsalts(zahl), arrzahl_iterats(zahl), arrzahl(zahl)))
|
||||
sw2.Stop()
|
||||
arrzeitp2.Add(sw2.ElapsedMilliseconds)
|
||||
sw2.Reset()
|
||||
|
||||
@@ -4,7 +4,7 @@ Imports Konscious.Security.Cryptography
|
||||
Public Class VERAG_VARIABLES
|
||||
Public Shared errornumb As Integer = 0
|
||||
Shared Function getiterationnumber() As Integer
|
||||
Return RandomInteger(Math.Pow(2, 4), Math.Pow(2, 11))
|
||||
Return RandomInteger(Math.Pow(2, 4), Math.Pow(2, 10))
|
||||
End Function
|
||||
|
||||
Shared Sub initerrorcount()
|
||||
@@ -31,25 +31,25 @@ Public Class VERAG_VARIABLES
|
||||
'Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(password))
|
||||
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
Dim Argon As Argon2d = New Argon2d(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.DegreeOfParallelism = 24
|
||||
Argon.Iterations = nIterations
|
||||
Argon.MemorySize = (((nIterations * 1.18 - (nIterations * 1.23) / 4 * 2) / 1.05) + 1 * 270)
|
||||
Argon.Iterations = nIterations * 2
|
||||
Argon.MemorySize = (((nIterations * 2.98 - (nIterations * 1.23) / 4 * 1.5) / 1.05) + 1 * 290)
|
||||
|
||||
Return Argon.GetBytes(nHash)
|
||||
Else
|
||||
Dim Argon As Argon2d = New Argon2d(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
|
||||
Argon.Salt = salt
|
||||
Argon.DegreeOfParallelism = 36
|
||||
Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
|
||||
Argon.Salt = GenerateSalt(nHash)
|
||||
Argon.DegreeOfParallelism = 48
|
||||
Argon.Iterations = nIterations * 3
|
||||
Argon.MemorySize = (((nIterations * 1.385 - (nIterations * 0.56) / 1.95 * 2.28) / 5.18) + 1.024 * 316)
|
||||
Argon.MemorySize = (((nIterations * 2.485 - (nIterations * 0.56) / 1.85 * 2.28) / 5.18) + 1.024 * 416)
|
||||
Return Argon.GetBytes(nHash)
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function Verifyhash(ByVal passw As String, ByVal 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
|
||||
Dim newHash As Byte() = HashPassword(passw, salt, nIterations, nHash)
|
||||
Return hash.SequenceEqual(newHash)
|
||||
End Function
|
||||
|
||||
Binary file not shown.
@@ -167,9 +167,9 @@
|
||||
GueltBs = arrtemp[j];
|
||||
j++;
|
||||
KartNr = arrtemp[j];
|
||||
Pagemethods.filltable2(SDLNr, Bez, GueltBs, KartNr, onerror);
|
||||
Pagemethods.filltable2(table,SDLNr, Bez, GueltBs, KartNr);
|
||||
}
|
||||
addNewRow()
|
||||
addNewRow();
|
||||
}
|
||||
function onFailure(error) {
|
||||
alert(error);
|
||||
@@ -186,10 +186,18 @@
|
||||
for (let i = rowCount - 1; i > 0; i--) {
|
||||
table_M.deleteRow(i);
|
||||
}
|
||||
let arrtemp = tempstrarr_M.split(",")
|
||||
for (let j = 0; j < arrtemp.length; j++) {
|
||||
alert(arrtemp[j])
|
||||
}
|
||||
let arrtemp_M = tempstrarr_M.split(",");
|
||||
for (let j = 0; j < arrtemp_M.length; j++) {
|
||||
SDLNr = arrtemp_M[j];
|
||||
j++;
|
||||
Bez = arrtemp_M[j];
|
||||
j++;
|
||||
GueltBs = arrtemp_M[j];
|
||||
j++;
|
||||
KartNr = arrtemp_M[j];
|
||||
Pagemethods.filltable_M(table_M,SDLNr, Bez, GueltBs, KartNr, onerror);
|
||||
}
|
||||
addNewRow_M();
|
||||
}
|
||||
|
||||
function buildtable_M(n, SDL,Bez, Dtguelt, KartNr) {
|
||||
@@ -300,12 +308,32 @@
|
||||
CardNr: KartNr,
|
||||
};
|
||||
}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function doPostBack(id, strtemp) {
|
||||
function doPostBack(id,strtemp) {
|
||||
|
||||
const obj = JSON.parse(strtemp);
|
||||
|
||||
for (let i = 0; i <= obj.length; i++) {
|
||||
let SDL = obj[i].result;
|
||||
let Bez = obj[i++].result;
|
||||
let Datguenstig = obj[i++].result;
|
||||
let KartNr = obj[i++].result;
|
||||
|
||||
Pagemethods.filltable2(<%=tbl_mainpage%>, SDL, Bez, Datguenstig, KartNr)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
function doPostBack_M(id, strtemp) {
|
||||
let obj = JSON.parse(strtemp)
|
||||
alert(obj.result)
|
||||
for (let i = 0; i <= obj.length; i++) {
|
||||
let SDL = obj[i].result;
|
||||
let Bez = obj[i++].result;
|
||||
let Datguenstig = obj[i++].result;
|
||||
let KartNr = obj[i++].result;
|
||||
|
||||
Pagemethods.filltable2_M(<%=tbl_mainpage_M%>, SDL, Bez, Datguenstig, KartNr)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
@@ -198,11 +198,11 @@ Partial Class LKWS
|
||||
|
||||
Protected Sub btn_Suchen_Click(sender As Object, e As EventArgs)
|
||||
Dim txt_LkwNr As TextBox = txt_lkw
|
||||
'list = VERAG_PROG_ALLGEMEIN.cSDL.GET_LIST_WEB(401940, "COOPER8")
|
||||
|
||||
list = VERAG_PROG_ALLGEMEIN.cSDL_LKW.GET_LIST_WEB(401940)
|
||||
Dim tblhrow As TableHeaderRow = New TableHeaderRow()
|
||||
Dim cnt As Integer = 0
|
||||
|
||||
Dim list3 As List(Of String) = New List(Of String)
|
||||
tblhrow.Cells.Add(tbhc_KFZKennz)
|
||||
tblhrow.Cells.Add(tbhc_Nat)
|
||||
tblhrow.Cells.Add(tblhc_Verk)
|
||||
@@ -220,6 +220,7 @@ Partial Class LKWS
|
||||
Dim tc_Vermerk As TableCell = New TableCell()
|
||||
tc_KfzKennz.Text = l2.KfzKennzeichen.ToString
|
||||
tr2.Cells.Add(tc_KfzKennz)
|
||||
Dim list5 = VERAG_PROG_ALLGEMEIN.cSDL.GET_LIST_WEB_LKW(401940, l2.KfzKennzeichen)
|
||||
tc_Nationalitaet.Text = String.Empty
|
||||
tr2.Cells.Add(tc_Nationalitaet)
|
||||
Dim cbVerk_Such As CheckBox = New CheckBox()
|
||||
@@ -246,11 +247,21 @@ Partial Class LKWS
|
||||
tc_Vermerk.Text = l2.Vermerk.ToString
|
||||
End If
|
||||
tr2.Cells.Add(tc_Vermerk)
|
||||
initcells(tblhrow, tbhc_KFZKennz, tbhc_Nat, tblhc_Verk, tblhc_Kz, tblhc_Verm, tr2, tc_KfzKennz, tc_Nationalitaet, tc_Verk, tc_KZ_An, tc_Vermerk, cnt)
|
||||
|
||||
tbl_sidemenue.Rows.Add(tr2)
|
||||
cnt += 1
|
||||
Next
|
||||
For Each l5 In list5
|
||||
Dim strstrtemp As String = String.Empty
|
||||
If IsNothing(l5.Schadstoffklasse.ToString) = True Then
|
||||
strstrtemp = "Keine Angabe!"
|
||||
Else
|
||||
strstrtemp = l5.Schadstoffklasse.ToString
|
||||
End If
|
||||
list3.Add(l5.SDLNr.ToString + "," + strstrtemp + "," + l5.GültigBis.ToString + "," + l5.KartenNr)
|
||||
Next
|
||||
initcells(tblhrow, tbhc_KFZKennz, tbhc_Nat, tblhc_Verk, tblhc_Kz, tblhc_Verm, tr2, tc_KfzKennz, tc_Nationalitaet, tc_Verk, tc_KZ_An, tc_Vermerk, cnt)
|
||||
tr2.Attributes.Add("onclick", "Javascript:doPostBack('""" & tr2.Cells.Item(0).Text & """,""" & ConvertToJSON(list3) & """')")
|
||||
tbl_sidemenue.Rows.Add(tr2)
|
||||
cnt += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Protected Sub btn_Suchen_M_Click(sender As Object, e As EventArgs)
|
||||
@@ -412,14 +423,14 @@ Partial Class LKWS
|
||||
End If
|
||||
tbl_mainpage_M.Rows.Clear()
|
||||
list3.Add(strstrtemp)
|
||||
tr1_M.Attributes.Add("OnClick", "Javascript:TableRow_Click_M(""" & strtemp2 & """,""" & l3.KfzKennzeichen & """,""" & ConvertToJSON(list3) & """);")
|
||||
tr1_M.Attributes.Add("OnClick", "Javascript:doPostBack_M('""" & tr1_M.Cells.Item(0).Text & """,""" & ConvertToJSON(list3) & """')")
|
||||
tbl_2.Rows.Add(tr1_M)
|
||||
cnt += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
<WebMethod>
|
||||
Public Sub filltable2(SDLNr As String, Bezeichnung As String, GueltigBis As String, KartNr As String)
|
||||
Public Sub filltable2(Tbl As Table, SDLNr As String, Bezeichnung As String, GueltigBis As String, KartNr As String)
|
||||
Dim tc_SDLNr As TableCell = New TableCell
|
||||
Dim tc_Bezeichnung As TableCell = New TableCell
|
||||
Dim tc_GueltigBis As TableCell = New TableCell
|
||||
@@ -433,6 +444,23 @@ Partial Class LKWS
|
||||
tr.Cells.Add(tc_Bezeichnung)
|
||||
tr.Cells.Add(tc_GueltigBis)
|
||||
tr.Cells.Add(tc_KartNr)
|
||||
tbl_2.Rows.Add(tr)
|
||||
Tbl.Rows.Add(tr)
|
||||
End Sub
|
||||
<WebMethod>
|
||||
Public Sub filltable_M(Tbl As Table, SDLNr As String, Bezeichnung As String, GueltigBis As String, KartNr As String)
|
||||
Dim tc_SDLNr As TableCell = New TableCell
|
||||
Dim tc_Bezeichnung As TableCell = New TableCell
|
||||
Dim tc_GueltigBis As TableCell = New TableCell
|
||||
Dim tc_KartNr As TableCell = New TableCell
|
||||
Dim tr_M As TableRow = New TableRow
|
||||
tc_SDLNr.Text = SDLNr
|
||||
tc_Bezeichnung.Text = Bezeichnung
|
||||
tc_GueltigBis.Text = GueltigBis
|
||||
tc_KartNr.Text = KartNr
|
||||
tr_M.Cells.Add(tc_SDLNr)
|
||||
tr_M.Cells.Add(tc_Bezeichnung)
|
||||
tr_M.Cells.Add(tc_GueltigBis)
|
||||
tr_M.Cells.Add(tc_KartNr)
|
||||
Tbl.Rows.Add(tr_M)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -6,7 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "VERAG_Homepage", "http://localhost:56551", "{11EF0CDA-BC19-40FB-91C4-25C81F3A27AC}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
UseIISExpress = "true"
|
||||
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.7.1"
|
||||
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.7.2"
|
||||
ProjectReferences = "{a3b497bd-842c-4a2b-b398-ed1976849df1}|VERAG_PROG_ALLGEMEIN.dll;"
|
||||
Debug.AspNetCompiler.VirtualPath = "/localhost_56551"
|
||||
Debug.AspNetCompiler.PhysicalPath = "..\VERAG_Homepage\"
|
||||
|
||||
12
Web.config
12
Web.config
@@ -43,7 +43,7 @@
|
||||
<trustLevel name="Full" policyFile="internal"/>
|
||||
</securityPolicy>-->
|
||||
<customErrors mode="Off" />
|
||||
<compilation strict="false" explicit="true" targetFramework="4.7.1" debug="true">
|
||||
<compilation strict="false" explicit="true" targetFramework="4.7.2" debug="true">
|
||||
<!-- <assemblies>
|
||||
<add assembly="MySql.Data, Version=5.5, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
|
||||
</assemblies>
|
||||
@@ -58,7 +58,6 @@
|
||||
<add assembly="MySql.Web, Version=6.9.7.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />
|
||||
<add assembly="MySql.Data.Entity, Version=6.9.7.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />
|
||||
<add assembly="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30AD4FE6B2A6AEED" /> -->
|
||||
<add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
|
||||
<add assembly="System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
|
||||
@@ -71,10 +70,11 @@
|
||||
<add assembly="System.ServiceProcess, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
|
||||
<add assembly="WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add assembly="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=3.6.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add assembly="System.Diagnostics.Tracing, Version=4.1.2.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
|
||||
<add assembly="System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
|
||||
<add assembly="System.Diagnostics.Tracing, Version=4.2.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
|
||||
<add assembly="System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<membership defaultProvider="MySqlMembershipProvider">
|
||||
@@ -178,6 +178,10 @@
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<appSettings>
|
||||
|
||||
@@ -240,10 +240,10 @@ Partial Class login_Change_PW
|
||||
ConnectionString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
|
||||
End If
|
||||
Dim isPasswhash As Byte() = gensaltPassw(usrname, tempstr, salt, intzahliterats, intzahl, Email, Session.IsNewSession)
|
||||
Dim isPasswDBhash As Byte() = gensaltPassw(UsernameDB, pwDB, salt, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
|
||||
Dim isPasswhash As Byte() = gensaltPassw(usrname, tempstr, intzahliterats, intzahl, Email, Session.IsNewSession)
|
||||
Dim isPasswDBhash As Byte() = gensaltPassw(UsernameDB, pwDB, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
|
||||
If regexval_txt_Pw.IsValid = True Then
|
||||
If VERAG_VARIABLES.Verifyhash(txt_Pw.Text, salt, isPasswhash, intzahliterats, intzahl) = True And VERAG_VARIABLES.Verifyhash(txt_Pw_WH.Text, salt, VERAG_VARIABLES.HashPassword(txt_Pw.Text, salt, intzahliterats, intzahl), intzahliterats, intzahl) = True Then
|
||||
If VERAG_VARIABLES.Verifyhash(txt_Pw.Text, salt, isPasswDBhash, intzahliterats, intzahl) = True And VERAG_VARIABLES.Verifyhash(txt_Pw_WH.Text, salt, VERAG_VARIABLES.HashPassword(txt_Pw.Text, salt, intzahliterats, intzahl), intzahliterats, intzahl) = True Then
|
||||
Using con As New SqlConnection(ConnectionString)
|
||||
Using cmd As New SqlCommand("UPDATE [VERAG_HOMEPAGE].[dbo].[Users] SET [Password]=@Password WHERE [Username]=@Username AND [UserId]=@UserId")
|
||||
' cmd.CommandType = CommandType.StoredProcedure
|
||||
@@ -459,8 +459,8 @@ Partial Class login_Change_PW
|
||||
End If
|
||||
|
||||
Using con As New SqlConnection(ConnectionString)
|
||||
Dim isPasswhash As Byte() = gensaltPassw(usrname, tempstr, salt, intzahliterats, intzahl, Email, Session.IsNewSession)
|
||||
Dim isPasswDBhash As Byte() = gensaltPassw(usrnmDB, pwDB, salt, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
|
||||
Dim isPasswhash As Byte() = gensaltPassw(usrname, tempstr, intzahliterats, intzahl, Email, Session.IsNewSession)
|
||||
Dim isPasswDBhash As Byte() = gensaltPassw(usrnmDB, pwDB, intzahliterats, intzahl, EmailDB, Session.IsNewSession)
|
||||
If regexval_txt_Pw.IsValid = True Then
|
||||
If VERAG_VARIABLES.Verifyhash(tempstr, salt, isPasswhash, intzahliterats, intzahl) = True AndAlso VERAG_VARIABLES.Verifyhash(pwDB, salt, isPasswDBhash, intzahliterats, intzahl) = True Then
|
||||
Using cmd As New SqlCommand("UPDATE [VERAG_HOMEPAGE].[dbo].[Users] SET Password=@Password WHERE Username=@Username AND UserId=@UserId")
|
||||
@@ -528,7 +528,7 @@ Partial Class login_Change_PW
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Function gensaltPassw(username As String, password As String, salt As Byte(), intzahliterats As Integer, intzahl As Integer, email As String, isnewSession As Boolean) As Byte()
|
||||
Function gensaltPassw(username As String, password As String, intzahliterats As Integer, intzahl As Integer, email As String, isnewSession As Boolean) As Byte()
|
||||
If isnewSession = False Then
|
||||
Dim token As Byte()
|
||||
'Dim tok As Byte = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||
@@ -538,7 +538,7 @@ Partial Class login_Change_PW
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function gennewsaltToken(username As String, password As String, email As String, salt As Byte(), CustomerID As String, intzahlits As Integer, intzahl As Integer, isnewSession As Boolean, theUserID As String) As String
|
||||
Function gennewsaltToken(username As String, password As String, email As String, CustomerID As String, intzahlits As Integer, intzahl As Integer, isnewSession As Boolean, theUserID As String) As String
|
||||
If isnewSession = False Then
|
||||
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
||||
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
||||
|
||||
@@ -7,16 +7,18 @@ Imports System.Data
|
||||
Imports System.Threading
|
||||
Imports System.Threading.Tasks
|
||||
Imports System.Security.Cryptography
|
||||
|
||||
Imports System.Numerics
|
||||
Partial Class ForgotPW
|
||||
Inherits System.Web.UI.Page
|
||||
Dim ConnectionString As String = String.Empty
|
||||
Dim salt As Byte()
|
||||
Dim zahlrand As Integer
|
||||
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
|
||||
If Page.IsPostBack = True Then
|
||||
Page.MaintainScrollPositionOnPostBack = True
|
||||
VERAG_VARIABLES.initerrorcount()
|
||||
salt = VERAG_VARIABLES.GenerateSalt(RandomInteger(Math.Pow(2, 3), Math.Pow(2, 10)))
|
||||
zahlrand = RandomInteger(Math.Pow(2, 3), Math.Pow(2, 7))
|
||||
salt = VERAG_VARIABLES.GenerateSalt(zahlrand)
|
||||
Else
|
||||
Page.MaintainScrollPositionOnPostBack = False
|
||||
VERAG_VARIABLES.initerrorcount()
|
||||
@@ -215,7 +217,7 @@ Partial Class ForgotPW
|
||||
tokenname = Session.Item("TokenforEmail")
|
||||
End If
|
||||
Dim intzahl As Integer = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 10))
|
||||
Dim hashdata As Byte() = VERAG_VARIABLES.HashPassword(tokenname, salt, VERAG_VARIABLES.getiterationnumber, intzahl)
|
||||
Dim hashdata As Byte() = VERAG_VARIABLES.HashPassword(tokenname, VERAG_VARIABLES.GenerateSalt(intzahl), VERAG_VARIABLES.getiterationnumber, intzahl)
|
||||
Session.Add("TokenHashtokenized", VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(Convert.ToBase64String(hashdata)))
|
||||
If SendEmail(username, password, email, tokenname, customerID, isusrnmright, isCustomeridright, isemailright, Session.IsNewSession, UserID) = True Then
|
||||
'password = RandomString(New Random, 10)
|
||||
@@ -609,7 +611,7 @@ Partial Class ForgotPW
|
||||
Async Function Findtokenhashsalt(username As String, password As String, email As String, customerID As String, isusernameright As Boolean, isuserIDright As Boolean, isuserEmailright As Boolean, isnewsess As Boolean, UserID As String) As Task(Of String)
|
||||
Dim t As Task(Of String)
|
||||
t = Task.Run(Async Function() As Task(Of String)
|
||||
Return gensaltToken(username, password, email, customerID, isusernameright, isuserIDright, isuserEmailright, isnewsess, UserID)
|
||||
Return gensaltToken(username, password, email, customerID, isusernameright, isuserIDright, isuserEmailright, isnewsess, UserID, VERAG_VARIABLES.RandomInteger(Math.Pow(2, 4), Math.Pow(2, 7)))
|
||||
End Function)
|
||||
Return Await t
|
||||
End Function
|
||||
@@ -758,22 +760,20 @@ Partial Class ForgotPW
|
||||
Return min + (max - min) * (one_byte(0) / 255)
|
||||
End Function
|
||||
|
||||
Function gensaltToken(username As String, password As String, email As String, CustomerID As String, isusrnmright As Boolean, iscstmIDright As Boolean, isemailright As Boolean, isnewSession As Boolean, theUserID As String) As String
|
||||
Function gensaltToken(username As String, password As String, email As String, CustomerID As String, isusrnmright As Boolean, iscstmIDright As Boolean, isemailright As Boolean, isnewSession As Boolean, theUserID As String, intz As Integer) As String
|
||||
If isnewSession = False Then
|
||||
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
||||
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
||||
Dim token As Byte()
|
||||
|
||||
Dim intzahl = RandomInteger(Math.Pow(2, 7), Math.Pow(2, 14))
|
||||
Dim intzahl2 = RandomInteger(Math.Pow(2, 7), Math.Pow(2, 10))
|
||||
Dim intzahliterats = RandomInteger(Math.Pow(2, 5), Math.Pow(2, 10))
|
||||
Dim intzahl = RandomInteger(Math.Pow(2, 4), Math.Pow(2, 7))
|
||||
Dim intzahl2 = RandomInteger(Math.Pow(2, 4), Math.Pow(2, 10))
|
||||
Dim intzahliterats = RandomInteger(Math.Pow(2, 5), Math.Pow(2, 11))
|
||||
Dim Rand As Random = New Random
|
||||
If isusrnmright = True And iscstmIDright = True And isemailright = True AndAlso String.IsNullOrEmpty(theUserID) = False Then
|
||||
|
||||
Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl)
|
||||
'Dim tok As Byte = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||
Dim tok As String = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||
token = VERAG_VARIABLES.HashPassword(tok, salt, intzahliterats, intzahl)
|
||||
token = VERAG_VARIABLES.HashPassword(tok, VERAG_VARIABLES.GenerateSalt(intz), intzahliterats, intzahl)
|
||||
|
||||
Return Convert.ToBase64String(token)
|
||||
Else
|
||||
@@ -843,8 +843,7 @@ Partial Class ForgotPW
|
||||
Dim tokentest As String = genToken(username, Passw, email, CustomerID, True, True, True, False, TheusrID)
|
||||
Dim hashtoken As Byte()
|
||||
Dim iterationnumb As Integer = VERAG_VARIABLES.getiterationnumber
|
||||
Dim nzahl As Integer = RandomInteger(Math.Pow(2, 7), Math.Pow(2, 10))
|
||||
'Dim salttoken As String = gensaltToken(username, Passw, email, CustomerID, True, True, True, False, TheusrID)
|
||||
Dim intzahl1 As Integer = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 10))
|
||||
'MsgBox(salttoken)
|
||||
If Session.Item("TokenforEmail") = Nothing Then
|
||||
tokentest = genToken(username, Passw, email, CustomerID, True, True, True, False, TheusrID)
|
||||
@@ -853,8 +852,9 @@ Partial Class ForgotPW
|
||||
Else
|
||||
tokentest = Session.Item("TokenforEmail")
|
||||
End If
|
||||
hashtoken = VERAG_VARIABLES.HashPassword(tokentest, salt, iterationnumb, nzahl)
|
||||
If VERAG_VARIABLES.Verifyhash(tokentest, salt, hashtoken, iterationnumb, nzahl) = True Then
|
||||
salt = VERAG_VARIABLES.GenerateSalt(intzahl1)
|
||||
hashtoken = VERAG_VARIABLES.HashPassword(tokentest, salt, iterationnumb, intzahl1)
|
||||
If VERAG_VARIABLES.Verifyhash(tokentest, salt, hashtoken, iterationnumb, intzahl1) = True Then
|
||||
If SendEmail(username, Passw, email, tokentest, CustomerID, True, True, True, False, TheusrID) = True Then
|
||||
'password = RandomString(New Random, 10)
|
||||
If getDateoftoken(tokentest) = True Then
|
||||
|
||||
@@ -215,7 +215,7 @@ Partial Class login_FLEX
|
||||
Session.Add("CustomerID", Customer_ID)
|
||||
Session.Add("PW", passw)
|
||||
End Sub
|
||||
Function gensaltToken(username As String, password As String, CustomerID As String, salt As Byte(), intzahliterats As Integer, intzahl As Integer, isnewSession As Boolean) As String
|
||||
Function gensaltToken(username As String, password As String, CustomerID As String, intzahliterats As Integer, intzahl As Integer, isnewSession As Boolean) As String
|
||||
If isnewSession = False Then
|
||||
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
||||
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<packages>
|
||||
<package id="bootstrap" version="5.1.2" targetFramework="net471" />
|
||||
<package id="BouncyCastle" version="1.8.9" targetFramework="net471" />
|
||||
<package id="CompareNETObjects" version="4.74.0" targetFramework="net471" />
|
||||
<package id="CompareNETObjects" version="4.74.0" targetFramework="net471" requireReinstallation="true" />
|
||||
<package id="DotNetZip" version="1.16.0" targetFramework="net471" />
|
||||
<package id="Google.Protobuf" version="3.19.1" targetFramework="net471" />
|
||||
<package id="jQuery" version="3.6.0" targetFramework="net471" />
|
||||
@@ -18,7 +18,7 @@
|
||||
<package id="Microsoft.CodeAnalysis.CSharp" version="4.0.1" targetFramework="net471" />
|
||||
<package id="Microsoft.CodeAnalysis.CSharp.Scripting" version="4.0.1" targetFramework="net471" />
|
||||
<package id="Microsoft.CodeAnalysis.Scripting.Common" version="4.0.1" targetFramework="net471" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="3.6.0" targetFramework="net47" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="3.6.0" targetFramework="net47" requireReinstallation="true" />
|
||||
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net471" />
|
||||
<package id="Microsoft.CST.DevSkim" version="0.6.5" targetFramework="net471" />
|
||||
<package id="Microsoft.CST.OAT" version="1.1.15" targetFramework="net471" />
|
||||
@@ -55,7 +55,7 @@
|
||||
<package id="System.Net.Http" version="4.3.0" targetFramework="net471" />
|
||||
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net471" />
|
||||
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net471" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net47" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||
<package id="System.ObjectModel" version="4.3.0" targetFramework="net471" />
|
||||
<package id="System.Reflection" version="4.3.0" targetFramework="net471" />
|
||||
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net471" />
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
<iisExpressSettings sslPort="44300" windowsAuthentication="disabled" anonymousAuthentication="enabled" useClassicPipelineMode="false"/>
|
||||
|
||||
<Globals>
|
||||
<UserProperties json1_1json__JsonSchema="https://appsemble.app/api.json"/>
|
||||
|
||||
|
||||
<UserProperties libman_1json__JsonSchema="" json1_1json__JsonSchema="https://appsemble.app/api.json"/>
|
||||
</Globals>
|
||||
</VisualWebDeveloper>
|
||||
Reference in New Issue
Block a user