Hey. I came across an article where an example of XOR is given, but the example given by him is not clear:

Suppose we have a plaintext - " denik.od " We will invent a gamut for it: " 12345678 " (the gamma should be equal to the length of the text, because we want to encrypt all the text). We will consider a concrete example on the first 2 bytes of " de " (we will present them in binary):

We have d 1 e 2 This is the same, only in the binary system 1100100 0110001 1100101 0110010

How does the author, d in the binary system 1100100, and the number 1 in binary 0110001? Explain, please, if not difficult, maybe I misunderstand something.

  • To be honest, the “article” terrified me, but Schneier probably had a heart attack at the hospital: - / Buy at least in Zhenelkov’s book shop - karmadro4
  • In general, the method is quite simple. I heard a glimpse of him and decided to think. sat down, multiplied the symbol by the symbol (and back), made the first sketch. in the end, I have a fairly fast encryption program. but in total, I wrote it for about half a year - from a spear method, to a full debugging. and by the way, the gamma doesn't have to be the same length - just walk it around a few times - sudo97
  • one
    @ Ilya Mikhnevich, the gamma should be long and random . Then decipher (say) is difficult (very). If you use it in a circle (in the simplest case, you can use the password itself), then it is much easier to decrypt (long text). - avp
  • 2
    Cipher Vernam - northerner
  • Thank you all for the comments, but I do not use this method for the purpose of self-study to know. Why so many disadvantages, I did not write the article, I just needed infa, for which thank you all. For Verman separate thanks, I will know. - Sever

1 answer 1

In fact, everything is simple. Here, characters are taken from the ASCII character table. And the number represented in binary form is nothing else than the number (code) of the character in the ASCII table. Thus, the symbol "d" has a serial number in table 100 (1100100 in binary), respectively, the symbol "e" (CEP: comes after the letter "d" in the English alphabet) has a serial number 101 (1100101 in binary). The same is true of numbers:

 1 - 49 - 110001 2 - 50 - 110010 
  • Oh, thank you very much, completely out of my head ASCII. Thank you. - Sever