From f25f943f5bf8633c9077aa159f71441f889386ef Mon Sep 17 00:00:00 2001 From: ja Date: Thu, 2 Dec 2021 16:47:14 +0100 Subject: [PATCH] =?UTF-8?q?=C3=84nderung=20des=20ortes=20der=20Generierung?= =?UTF-8?q?=20der=20Random=20Zufallszahlen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- login/Change_PW.aspx.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/login/Change_PW.aspx.vb b/login/Change_PW.aspx.vb index 594a10a..ee6132e 100644 --- a/login/Change_PW.aspx.vb +++ b/login/Change_PW.aspx.vb @@ -523,12 +523,13 @@ Partial Class login_Change_PW End If End Sub Function gensaltPassw(username As String, password As String, email As String, isnewSession As Boolean) As String + Dim intzahl = RandomInteger(Math.Pow(2, 8), Math.Pow(2, 12)) If isnewSession = False Then Dim token As String If String.IsNullOrEmpty(username) = False AndAlso String.IsNullOrEmpty(email) = False Then If String.IsNullOrEmpty(password) = False Then Try - Dim intzahl = RandomInteger(Math.Pow(2, 8), Math.Pow(2, 11)) + Dim salt As String = VERAG_VARIABLES.GenerateSalt(intzahl) Dim tok As String = password token = VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(VERAG_VARIABLES.HashPassword(tok, salt, 1491, intzahl)) @@ -536,7 +537,7 @@ Partial Class login_Change_PW tok = String.Empty Return token Catch Ex As Exception - Dim intzahl2 = RandomInteger(Math.Pow(2, 7), Math.Pow(2, 12)) + 'Dim Msg, Style, Title As String 'Msg = "Token Generation failed" & vbCrLf & "A new E-mail has been sent to the intern e-mail given." 'Style = vbRetry + vbExclamation + vbDefaultButton1 @@ -544,9 +545,9 @@ Partial Class login_Change_PW 'MsgBox(Msg, Style, Title) 'If MsgBox(Msg, Style, Title).Retry Then 'genToken(username, password, email) - Dim salt As String = VERAG_VARIABLES.GenerateSalt(intzahl2) + Dim salt As String = VERAG_VARIABLES.GenerateSalt(intzahl) Dim tok As String = password - token = VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(VERAG_VARIABLES.HashPassword(tok, salt, 901, intzahl2)) + token = VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(VERAG_VARIABLES.HashPassword(tok, salt, 901, intzahl)) salt = String.Empty tok = String.Empty Return token