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

Member Avatar for GreenDay2001

Learn just basics of PHP and you'll be able to convert it. No one would be eager to help you unless you show effort. If you tried, post your effort here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.