|
-
May 28th, 2000, 10:47 AM
#1
What does Xor do, I think it has something to do with encryption, but i am not sure.
thanks for any replies.
-
May 28th, 2000, 11:53 AM
#2
Guru
Bitwise math. Argh!
This is bitwise exclusion.
For example, 23 Xor 50...
To calculate this, you convert both numbers to binary.
23 = 010111b
50 = 110010b
The Xor rules are: 0 Xor 0 = 0, 1 Xor 0 = 1, 0 Xor 1 = 1, 1 Xor 1 = 0.
010111
110010
======Xor
100101
100101 is 37. Try the calculator, do a 23 Xor 50, and you'll get 37. It's useful with logical, too:
True Xor True = False
True Xor False = True
False Xor True = True
False Xor False = False
-
May 28th, 2000, 12:24 PM
#3
thank you.
how is it used in encryption?
-
May 28th, 2000, 04:36 PM
#4
transcendental analytic
Dennis! You can look at my encryption samples at my page, I have my string xoring against any key.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 28th, 2000, 09:12 PM
#5
-
May 28th, 2000, 11:56 PM
#6
Frenzied Member
Xor Encryption
I use VB6 under Windows 98, 2nd edition.
Xor can be used for encryption using a string or binary value (Key) known to both the sender and the receiver of a message. Xor has the following properties.
(Readable message)Xor(Key) = Unreadable garbage.
(Unreadable garbage)Xor(Key) = Original message.
The original message is first broken into chunks, each the same length as the Key (Pad last chunk with spaces, if necessary). Xor using Key versus each chunk. Send resulting garbage. Receiver breaks garbage into chunks. Xor using Key versus each chunk, resulting in original message.
The code I have seen converts string data into binary or hex data prior to Xor operations, and then sends the garbage as a binary file. There might be some reason for the conversion, but I am not sure. Perhaps some languages do not allow Xor versus string data (does VB allow it?). Perhaps weird side effects can occur with a string containing binary garbage (garbage bytes could look like control data).
I hope the above gives you a clue.
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
May 29th, 2000, 12:34 AM
#7
The reason the string is converted first, is while vb uses unicode for strings. Each character is 2 bytes, and if you use the western characterset, 1 byte is empty (0). This way the key can be found easily.
-
May 29th, 2000, 02:12 AM
#8
transcendental analytic
Guv, don't be afraid of Binary or Hex data, it's usually a form you never get in touch with in vb as it automatically converts it to either dec or string. Also to use Xor with strings, does not apply in vb, you need to convert the strings to byte array first with strconv, as i meantioned theres a fast and good example on my homepage
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|