Results 1 to 2 of 2

Thread: Xor ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

    Xor ?

    Can anyone show me how to use XOR in VB ? to encrypt some Chars ??

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width