TommyFilhiger: Wer kann mir eine VB-Funktion in PHP "übersetzen" ?

Beitrag lesen

Hey Profis!
Das Verschlüsseln und Entschlüsseln auf VB-Seite krieg ich hin - das Verschlüsselte soll nun aber auf einer PHP-Seite entschlüsselt werden.

Wäre wirklich super - ich kriegs einfach nicht hin...
Per Mail wär' nett - Danke im Voraus!

Public Function Entschluesseln(ByVal Wert As String) As String
     Dim base64 As String
         base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
     Dim key As String
         key = "wsxnAoedc1jief6xQit1nbhu6Jcpo1bvfq5dhgt0novB1rtlA" & _
                 "hjSalkgXiv2ater7ecsn2mlkd7Piez3ypkj8hacd3fghj2eiu" & _
                 "ndmfsdjtppl3hghj8sgfh3lglg8srtm6lokj1awsd6efMv3xb" & _
                 "nzgfnCkij4rm4lodp9kjud4egdn9Nplk9nhgr4tzgh9raid4s" & _
                 "loVpsjsix5ejf5gdmx0apFe5funb0irYm2fsdl7wzwe0hsTn5" & _
                 "qaA7lp"
     Dim decode As String
     Dim CodeZeile As String
     Dim Codiert As String
     Dim A As Integer
     Dim B As Integer
     Dim C As Integer
     Dim D As Integer
     Dim s As Integer
     Dim Erg As Integer
         If Len(Wert) > 32000 Then
             Entschluesseln = ""
             Exit Function
         End If

While Len(Wert) > Len(key)
             DoEvents
             key = key & key
         Wend

' Base64
         decode = ""
         CodeZeile = Wert
         For s = 1 To Len(CodeZeile) Step 4
             DoEvents
             A = InStr(base64, (Mid(CodeZeile, s + 0, 1))) - 1
             B = InStr(base64, (Mid(CodeZeile, s + 1, 1))) - 1
             C = InStr(base64, (Mid(CodeZeile, s + 2, 1))) - 1
             D = InStr(base64, (Mid(CodeZeile, s + 3, 1))) - 1
             If B >= 0 Then decode = decode & Chr((A * 4 + Int(B / 16)) And 255)
             If C >= 0 Then decode = decode & Chr((B * 16 + Int(C / 4)) And 255)
             If D >= 0 Then decode = decode & Chr((C * 64 + D) And 255)
         Next s

' Key zurück
         Codiert = ""
         For s = 1 To Len(decode)
             DoEvents
             Erg = Asc(Mid(decode, s, 1)) Xor Asc(Mid(myKey, s, 1))
             Codiert = Codiert & Chr(Erg)
         Next s

Entschluesseln = Codiert
End Function