[JoGu]

Cryptology

XOR

a7Hzq .#5r<
kÜ\as TâÆK$
ûj(Ö2 ñw%h:
Úk{4R f~`z8
¤˜Æ+Ô „&¢Dø

Description

XOR is a shift cipher on l-bit blocks. These constitute our alphabet. The key is a fixed block. It is XORed bitwise with each plaintextblock.

See also: Mathematical description


Example

Block length l = 8, key = 10010110.

First row: plaintext,
second row: characters in hexadecimal representation in the ASCII character set,
third row: characters in binary representation,
fourth row: the key repeated as often as needed,
fifth row: the ciphertext in binary,
sixth row: the ciphertext in hexadecimal.

   D    |   u    |        |   b    |   i    |   s    |   t    |        |   d    |   o    |   o    |   f    
   44   |   75   |   20   |   62   |   69   |   73   |   74   |   20   |   64   |   6F   |   6F   |   66   
01000100|01110101|00100000|01100010|01101001|01110011|01110100|00100000|01100100|01101111|01101111|01100110
10010110|10010110|10010110|10010110|10010110|10010110|10010110|10010110|10010110|10010110|10010110|10010110
-------- -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- --------
11010010|11100011|10110110|11110100|11111111|11100101|11100010|10110110|11110010|11111001|11111001|11110000
   D2       E3       B6       F4       FF       E5       E2       B6       F2       F9       F9       F0   
If we translate this back into readable characters (the ISO-9960-1 character set, the default setting of this web page), we get the ciphertext

Ò ã ¶ ô œ å â ¶ ò ù ù ð

that heavily impresses a layman. Professional cryptologists however immediately note that all characters are from the upper half of the 256 byte character set. Therefore they suspect that this is the result from an ASCII text XORed with a key that has 1 as its highest bit. Furthermore they note the conspicuous repetition of the character ¶ = 10110110 that could fit the plaintext blank 00100000. Taking the difference they get the key 10010110, and the cryptogram is solved (in English: You are stupid).


In history the first noteworthy use of XOR ciphers was in the twenties of 20th century in the context of tele typewriter messages. In 1918 Gilbert VERNAM (1890-1960) filed the method as US patent. He used a periodically repeated key in form of a long punched paper tape with the ends glued together. Immediately thereafter Joseph MAUBORGNE (1881-1971), Major General and later the Army's Chief Signal Officer, noted that the use of a nonperiodic key is crucial for the security of the method.

Despite its weakness even the original VERNAM cipher constitutes an essential advancement of cryptography for another reason: It is the first automatic encryption procedure in history. The operator enters plaintext, the cryptographic device automatically spits out the ciphertext without troublesome and error-prone intermediate manual operations. If used online via teleprinter the receiver's device even outputs the plaintext directly.


Author: Klaus Pommerening, 29. September 1999-Sep-29; last change: 2013-Nov-29.