I need help convert from vb6 to php, this script for encrypt or decrypt some text and protected with password.
Please i really need this, thank you.
Private Sub Command3_Click()
Dim S1, S2 As String
S1 = RndCrypt(Text1.Text, "yourpassword")
Text2.Text = S1
End Sub
Function RndCrypt(ByVal Str As String, ByVal Password As String) As String
Dim SK As Long, K As Long
Rnd -1
Randomize Len(Password)
For K = 1 To Len(Password)
SK = SK + (((K Mod 160) Xor Asc(Mid$(Password, K, 1))) Xor Fix(160 * Rnd))
Next K
Rnd -1
Randomize SK
For K = 1 To Len(Str)
Mid$(Str, K, 1) = Chr(Fix(160 * Rnd) Xor Asc(Mid$(Str, K, 1)))
Next K
RndCrypt = Str
End Function