' The second value to XOR comes from the code key.
intXORValue2 = Asc(Mid$(strCodeKey, _
((lonDataPtr Mod Len(strCodeKey)) + 1), 1))
' The two values are XORed together to create a
' decrypted character.
strDataOut = strDataOut + Chr(intXORValue1 Xor _
intXORValue2)
Next lonDataPtr
' The XOREncryption function returns the encrypted (or
' decrypted) data.
XOREncryption = strDataOut
End Function
To try out the XOREncryption routine, you can add it to a form that has three TextBox controls (Text1, Text2, and Text3) and a CommandButton control. In the CommandButton's Click event, add the following code: