Can somebody help me convert this VB function to Perl (PHP, Ruby or Python will do also)?
Public Function CFUSION_ENCRYPT(ByVal Password As String, ByVal Key As String) As String
Dim NewValue As String
Dim TempValue As String
NewValue = ""
For i = 1 To Len(Password)
TempValue = Asc(Mid(Key, i, 1)) Xor Asc(Mid(Password, i, 1))
NewValue = NewValue & Format(Hex(TempValue), "00")
Next
CFUSION_ENCRYPT = NewValue
End Function
Thank you very much!
In PHP:
Please test if the result is really the same