Mohon bantuan untuk konversi encrypt VB dan decrpyt VB ke PHP (program encrypt VB dan decrpyt VB terlampir), hasil encrypt dan decrypt PHP harus sama dengan VB, nanti akan kirim hasil ecrypt VB sebagai contoh
Public Function EncryptText(strText As String, ByVal strPwd As String)
Dim I As Integer, E As Integer
Dim strBuff As String
#If Not CASE_SENSITIVE_PASSWORD Then
'Convert password to upper case
'if not case-sensitive
strPwd = UCase$(strPwd)
#End If
If Len(strPwd) Then
For I = 1 To Len(strText)
E = Asc(Mid$(strText, I, 1))
E = E + Asc(Mid$(strPwd, (I Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr$(E And &HFF)
Next I
Else
strBuff = strText
End If
EncryptText = strBuff
End Function
=========================================
Public Function DecryptText(strText As String, ByVal strPwd As String)
Dim I As Integer, D As Integer
Dim strBuff As String
#If Not CASE_SENSITIVE_PASSWORD Then
'Convert password to upper case
'if not case-sensitive
strPwd = UCase$(strPwd)
#End If
If Len(strPwd) Then
For I = 1 To Len(strText)
D = Asc(Mid$(strText, I, 1))
D = D - Asc(Mid$(strPwd, (I Mod Len(strPwd)) + 1, 1))
strBuff = strBuff & Chr$(D And &HFF)
Next I
Else
strBuff = strText
End If
DecryptText = strBuff
End Function