Can anyone show me how to use XOR in VB ? to encrypt some Chars ??
Printable View
Can anyone show me how to use XOR in VB ? to encrypt some Chars ??
Well if you create a byte array from the chars (for example CharsBytes()) and then create an password byte array (PassBytes()) you can do something like this I guess....
Code:Dim index As Integer
Dim i As Integer
Dim max As Integer = PassBytes.Length
For index = 0 to CharsBytes.Length - 1
CharsBytes(index) = CharsBytes(index) Xor PassBytes(i)
i = (i + 1) Mod max
Next