Automatic analysis, binary Exclusive-OR (Menu Analysis \ Symmetric Encryption (classic) \ Ciphertext-Only)

A ciphertext-only attack is available for encryption with the Exclusive-OR in the form of an analysis with whose aid the key and hence the plaintext can be worked out for relatively long encrypted documents.

There are two stages in the analysis:

First of all the key length used is worked out,

and then the key itself.

The key length is calculated using autocorrelation. Since in most documents not every character occurs equally often, the probability of two identical characters occurring is relatively large if they are separated by a multiple of the key length. Therefore in an autocorrelation analysis a typical comb formation is generated, in which the individual teeth are separated by exactly the length of the key. If automatic detection of the key length produces an incorrect result, it is possible to determine the key length manually.

Once the key length has been worked out, the actual key used is calculated. This is done by performing a frequency analysis (see Histogram) for every character of the key. Here CrypTool assumes that the character which occurs most frequently is the binary zero. If it is known that a different character occurs more frequently, then this can be entered in the Automatic Analysis (Addition, Exclusive-OR) dialog. It is also possible to correct this entry after the analysis by means of the binary Exclusive-OR of the corresponding character.

In the Options for automatic analysis dialog it is possible to specify which and how many intermediate results should be displayed in separate windows. If the user clicks on Cancel instead of OK when viewing one of these intermediate results, no more of these windows or subordinate windows will appear. (For a more detailed explanation see Automatic analysis, Vigenère encryption algorithm).

It is entirely possible for one or more parts of the key to not be calculated correctly.

In the Examples chapter there is an example of an attack on the encryption algorithm.

Conditions which the document must satisfy for a successful attack

The key will always be found if the character which occurs most frequently in the unencrypted document is known. It makes no difference here how long the document is. But often the character which occurs most frequently in a text is not known. See the example on encryption using the binary Exclusive-OR for further information on this point.