PHP Code:
Public Shared Function Encrypt(ByVal input As String) As String
Dim expressionStack_6_0 As Integer = 1
If (expressionStack_6_0 = 0) Then
End If
Dim s As String = "lkirwf897+22#bbtrm8814z5qq=498j5"
Dim str2 As String = "741952hheeyy66#cs!9hjv887mxx7@8y"
Dim managed As New RijndaelManaged With { _
.Padding = PaddingMode.Zeros, _
.Mode = CipherMode.CBC, _
.KeySize = &H100, _
.BlockSize = &H100 _
}
Dim bytes As Byte() = Encoding.ASCII.GetBytes(s)
Dim rgbIV As Byte() = Encoding.ASCII.GetBytes(str2)
Dim transform As ICryptoTransform = managed.CreateEncryptor(bytes, rgbIV)
Dim stream2 As New MemoryStream
Dim stream As New CryptoStream(stream2, transform, CryptoStreamMode.Write)
Dim buffer As Byte() = Encoding.ASCII.GetBytes(input)
stream.Write(buffer, 0, buffer.Length)
stream.FlushFinalBlock
Return Convert.ToBase64String(stream2.ToArray)
End Function
Laut google handelt es sich um AES (Rijndael) 256 Bit.
Allerdings werden hier 2 encryption Keys verwendet, das verstehe ich nicht & besonderns diese Zeile, in der aus beiden irgendwie einer gemacht wird:
"managed.CreateEncryptor(bytes, rgbIV)"
Kann mir jemand der sich mit VB.NET auskennt, erklären was da genau gemacht wird?