25 lines
660 B
Plaintext
25 lines
660 B
Plaintext
Public Shared Function xEncryptionD(ByVal CodeKey As String, ByVal DataIn As String) As String
|
|||
|
|
|
||
|
|
Dim lonDataPtr As Long
|
||
|
|
|
||
|
|
Dim strDataOut As String = ""
|
||
|
|
|
||
|
|
Dim intXOrValue1 As Integer
|
||
|
|
|
||
|
|
Dim intXOrValue2 As Integer
|
||
|
|
|
||
|
|
Dim H As String = "&H"
|
||
|
|
|
||
|
|
For lonDataPtr = 1 To (Len(DataIn) / 2)
|
||
|
|
|
||
|
|
intXOrValue1 = Val(H & (Mid$(DataIn, (2 * lonDataPtr) - 1, 2)))
|
||
|
|
|
||
|
|
intXOrValue2 = Asc(Mid$(CodeKey, ((lonDataPtr Mod Len(CodeKey)) + 1), 1))
|
||
|
|
|
||
|
|
strDataOut = strDataOut + Chr(intXOrValue1 Xor intXOrValue2)
|
||
|
|
|
||
|
|
Next lonDataPtr
|
||
|
|
|
||
|
|
xEncryptionD = strDataOut
|
||
|
|
|
||
|
|
End Function
|