Änderu ngen Chnagepw algorithmus und Vb.net sammlung Algorithmus Anpassungen sowie GUI anpassungen An Login und Welcome.aspx .css
This commit is contained in:
@@ -27,10 +27,10 @@ Public Class VERAG_VARIABLES
|
|||||||
Return saltBytes
|
Return saltBytes
|
||||||
'Convert.ToBase64String(saltBytes)
|
'Convert.ToBase64String(saltBytes)
|
||||||
End Function
|
End Function
|
||||||
Public Shared Async Function HashPassword(ByVal password As String, ByVal salt As Byte(), ByVal nIterations As Integer, ByVal nHash As Integer) As Threading.Tasks.Task(Of Byte())
|
Public Shared Async Function HashPassword(password As String, salt As Byte(), nIterations As Integer, nHash As Integer) As Threading.Tasks.Task(Of Byte())
|
||||||
'Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(password))
|
'Dim Argon As Argon2id = New Argon2id(Encoding.UTF8.GetBytes(password))
|
||||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||||
Dim Argon As Argon2d = New Argon2d(Encoding.UTF8.GetBytes(password))
|
Dim Argon As Argon2d = New Argon2d(Encoding.UTF8.GetBytes(VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(password)))
|
||||||
Argon.Salt = salt
|
Argon.Salt = salt
|
||||||
Argon.DegreeOfParallelism = 24
|
Argon.DegreeOfParallelism = 24
|
||||||
Argon.Iterations = nIterations
|
Argon.Iterations = nIterations
|
||||||
@@ -44,7 +44,7 @@ Public Class VERAG_VARIABLES
|
|||||||
Else
|
Else
|
||||||
Dim Argon As Argon2d = New Argon2d(Encoding.UTF8.GetBytes(password))
|
Dim Argon As Argon2d = New Argon2d(Encoding.UTF8.GetBytes(password))
|
||||||
Argon.Salt = salt
|
Argon.Salt = salt
|
||||||
Argon.DegreeOfParallelism = 36
|
Argon.DegreeOfParallelism = 48
|
||||||
Argon.Iterations = nIterations
|
Argon.Iterations = nIterations
|
||||||
Argon.MemorySize = (nIterations / 0.385) + 1 * 250
|
Argon.MemorySize = (nIterations / 0.385) + 1 * 250
|
||||||
Return Await Argon.GetBytesAsync(nHash)
|
Return Await Argon.GetBytesAsync(nHash)
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ h1 {
|
|||||||
height: 62px;
|
height: 62px;
|
||||||
}
|
}
|
||||||
.modal-content{
|
.modal-content{
|
||||||
width:400px;
|
width:488px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 322.98px) {
|
@media (max-width: 322.98px) {
|
||||||
|
|||||||
@@ -562,25 +562,14 @@ Partial Class login_Change_PW
|
|||||||
Dim token As Byte()
|
Dim token As Byte()
|
||||||
|
|
||||||
Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl)
|
Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl)
|
||||||
Dim tok As String = STrings
|
Dim tok As String = STrings
|
||||||
token = Await VERAG_VARIABLES.HashPassword(tok, salt, intzahliterats, intzahl)
|
|
||||||
|
|
||||||
Return Convert.ToBase64String(token)
|
|
||||||
|
|
||||||
Return VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(Convert.ToBase64String(token))
|
|
||||||
|
|
||||||
Else
|
|
||||||
Dim token As Byte()
|
|
||||||
Dim intzahliterats = RandomInteger(Math.Pow(2, 10), Math.Pow(2, 12))
|
|
||||||
Dim intzahl = RandomInteger(Math.Pow(2, 5), Math.Pow(2, 7))
|
|
||||||
|
|
||||||
Dim salt As Byte() = VERAG_VARIABLES.GenerateSalt(intzahl)
|
|
||||||
Dim tok As String = STrings
|
|
||||||
token = Await VERAG_VARIABLES.HashPassword(tok, salt, intzahliterats, intzahl)
|
token = Await VERAG_VARIABLES.HashPassword(tok, salt, intzahliterats, intzahl)
|
||||||
|
|
||||||
Return Convert.ToBase64String(token)
|
Return Convert.ToBase64String(token)
|
||||||
|
|
||||||
Return VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(Convert.ToBase64String(token))
|
Return VERAG_PROG_ALLGEMEIN.cCryptography3.Encrypt(Convert.ToBase64String(token))
|
||||||
|
Else
|
||||||
|
Return String.Empty
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Shared Function RandomInteger(ByVal min As Integer, ByVal _
|
Shared Function RandomInteger(ByVal min As Integer, ByVal _
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ Partial Class login_FLEX
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Protected Async Sub ValidateUser(sender As Object, e As EventArgs)
|
Protected Async Sub ValidateUser(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
' cDBFunctions.GetNewOpenConnection()
|
' cDBFunctions.GetNewOpenConnection()
|
||||||
Dim ConnectionString = ""
|
Dim ConnectionString = ""
|
||||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||||
@@ -179,7 +178,7 @@ Partial Class login_FLEX
|
|||||||
passw = String.Empty
|
passw = String.Empty
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
VERAG_VARIABLES.seterrorcount(9)
|
VERAG_VARIABLES.seterrorcount(9)
|
||||||
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the database!"
|
Login1.FailureText = VERAG_VARIABLES.geterrornumb + "Password is not in the database!"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user