打印

XOR Encryption(异或加密详解)

XOR Encryption(异或加密详解)

文章作者:killerbyte_darkbyte@hotmail.com

Needs:
- A Brain
-Knowledge about binary shit
-The Willing To Learn (!IMPORTANT!)
-ASCII Table (http://www.cplusplus.com/doc/papers/ascii.html)


In this tutorial I am going to tell you about the XOR Encryption. The encryption has two parts, the message and the key. When you send a message, you can put the key beneath the encrypted message. But if someone gets a hold on the encrypted message with the key, and understands that it uses the XOR, he can also decrypt it and read the real message. So when you have learned how to encrypt and decrypt the message you can do it at the best way. Keep the key between you and the receiver so only you and the receiver can decrypt the message. The XOR-crypt works like this:

You got these 2 lines of numbers. One of them is the encrypted text, and the other one is the key. It doesn’t matter which line is what because when you decrypt it, it will be the same.

Encrypted Text: 110110001100101111000100010000011100000000100011
Key:             100100001010101010100111001010101010010101010001

You must read the code up and down, and up and down etc. So you will see that it is 1 and 1, 1 and 0, 0 and 0 etc. Now you have to remember this:

1 & 1 = 0
0 & 0 = 0
1 & 0 = 1
0 & 1 = 1

That means when the 2 numbers are equal, it is 0, and when they are not equal it will be a 1.
Now we are going to do that for every pair of numbers:

Encrypted Text: 110110001100101111000100010000011100000000100011
Key:             100100001010101010100111001010101010010101010001
               
Normal Text:     010010000110000101100011011010110110010101110010

Of course these numbers don’t look like a normal text to you so now we have to split the code into pieces of 8 bits, a bit is one character so that’s a 1 or a 0. Now split them up and you will have this:

01001000 01100001 01100011 01101011 01100101 01110010






Now we have to split each string of 8 bits to 2 strings with 4 bits;

01001000


0100     1000

Now we have to convert them into hexadecimal numbers; 0100 = 4 and 1000 = 8.
Why: you count from the right to the left, every bit has a worth, but that worth only counts if the bit is “1”. The worth of the first (most right) bit is 1, and the second right bit ( the second bit) has the worth 2. Every bit to the right, means the worth is doubled.

Binary:   0   1   0   0
Worth :   8   4   2   1

So the string 0100 has the worth 4 because 0+4+0+0 = 4, and that means the string 1000 has the worth 8 because 1+0+0+0 = 8. The 4 & 8 are the coordinates at the ASCII-Table. And now do every string of 8 bits. Split them into 2 string of 4 bits and convert them like I did.
Look in the table at 4 (vertical) and 8 (horizontal) and you will see that it leads to the “H”.
That means the “H” is the first character of the text/password, whatever it may be. When you look into the table you also see (when looking horizontal) A,B,C etc, after the 9, so when you covert the 4 bit string to, let’s say, 11, you have to look at “B”, in the table.

A = 10 / B = 11 / C = 12 / D = 13 / E = 14 / F = 15

Now you can do the rest and when you place all those found characters behind each other you will see that the real text is: “Hacker”.

And you can encrypt them yourself, because when you have the key and the normal text you can make the encoded text yourself, and send the encoded text. Because your key won’t always be as big as the text you want to encrypt, the best way is to repeat the same key like this:

t h e p a s s w o r d i s h e l l o
t h e k e y t   h e k e y t h e k e y

You know how to make the text into hexadecimal because you can find that character inside the ASCII-Table, and make a 8 bit string from there, and you can do the same with the key.
And since your receiver knows the key, he can make it into hexadecimals and put the key beneath the encrypted text to he can decrypt it.

So now you will have a very good encryption but remember, it can always be broken by someone

TOP

英语太垃圾了。。。。
这看不懂哟。。。。。

TOP


一样..

有些可以看的懂..

但是网吧还是不能搞..

老板赶人呢..

TOP

英语的啊  就是要看原文啊 哈哈

TOP