ArticleslgStudy

computer science

Correlation attack

Correlation attack is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Correlation attack rather than just read about it. In short: Correlation attacks are a class of cryptographic known-plaintext attacks for breaking stream ciphers whose keystreams are generated by combining the output of several linear-feedback shift registers (LFSRs) using a Boolean function. Correlation attacks exploit a statistical weakness that arises from the specific Boolean function chosen for the keystream.

Key takeaways

  • Correlation attack belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Correlation attack to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Correlation attack from memory before moving on to harder problems.

Reference excerpt

Correlation attacks are a class of cryptographic known-plaintext attacks for breaking stream ciphers whose keystreams are generated by combining the output of several linear-feedback shift registers (LFSRs) using a Boolean function. Correlation attacks exploit a statistical weakness that arises from the specific Boolean function chosen for the keystream. While some Boolean functions are vulnerable to correlation attacks, stream ciphers generated using such functions are not inherently insecure.

Explanation Correlation attacks become possible when a significant correlation exists between the output state of an individual LFSR in the keystream generator and the output of the Boolean function that combines the output states of all the LFSRs. These attacks are employed in combination with partial knowledge of the keystream, which is derived from partial knowledge of the plaintext. The two are then compared using an XOR logic gate. This vulnerability allows an attacker to brute-force the key for the individual LFSR and the rest of the system separately. For instance, in a keystream generator where four 8-bit LFSRs are combined to produce the keystream, and if one of the registers is correlated to the Boolean function output, it becomes possible to brute force it first, followed by the remaining three LFSRs. As a result, the total attack complexity becomes 28 + 224. Compared to the cost of launching a brute-force attack on the entire system, with complexity 232, this represents an attack effort saving factor of just under 256. If a second register is correlated with the function, the process may be repeated and decrease the attack complexity down to 28 + 28 + 216 for an effort saving factor of just under 65028.

Example

Geffe generator One example is the Geffe generator, which consists of three LFSRs: LFSR-1, LFSR-2, and LFSR-3. Let these registers be denoted as: x1, x2, and x3, respectively. Then, the Boolean function combining the three registers to provide the generator output is given by F(x1,x2,x3)=(x1∧x2)⊕(¬x1∧x3) (i.e. (x1 AND x2) XOR (NOT x1 AND x3)). There are 23 = 8 possible values for the outputs of the three registers, and the value of this combining function for each of them is shown in the table below:

Consider the output of the third register, x3. The table above shows that of the 8 possible outputs of x3, 6 are equal to the corresponding value of the generator output, F(x1,x2,x3). In 75% of all possible cases, x3=F(x1,x2,x3). Thus LFSR-3 is 'correlated' with the generator. This is a weakness that may be exploited as follows: An interception can be made on the cipher text c1,c2,c3,…,cn of a plain text p1,p2,p3,… which has been encrypted by a stream cipher using a Geffe generator as its keystream generator, i.e. ci=pi⊕F(x1i,x2i,x3i) for i=1,2,3,…,n, where x1i is the output of LFSR-1 at time i, etc. It's also possible that part of the plain text, e.g. p1,p2,p3,…,p32, the first 32 bits of the plaintext (corresponding to 4 ASCII characters of text). This is not entirely improbable considering plain text is a valid XML file, for instance, the first 4 ASCII characters must be "<xml". Similarly, many file formats or network protocols have very standard headers or footers. Given the intercepted c1,c2,c3,…,c32 and our known/guessed p1,p2,p3,…,p32, we may easily find F(x1i,x2i,x3i) for i=1,2,3,…,32 by XOR-ing the two together. This makes the 32 consecutive bits of the generator output easy to determine. This enables a brute-force search of the space of possible keys (initial values) for LFSR-3 (assuming we know the tapped bits of LFSR-3, an assumption which is in line with Kerckhoffs' principle). For any given key in the key space, we may quickly generate the first 32 bits of LFSR-3's output and compare these to our recovered 32 bits of the entire generator's output. Because we have established earlier that there is a 75% correlation between the output of LFSR-3 and the generator, we know we have correctly guessed the key for LFSR-3 if approximately 24 of the first 32 bits of LFSR-3 output will match up with the corresponding bits of generator output. If we have guessed incorrectly, we should expect roughly half, or 16, of the first 32 bits of these two sequences to match. Thus we may recover the key for LFSR-3 independently of the keys of LFSR-1 and LFSR-2. At this stage, we have reduced the problem of brute forcing a system of 3 LFSRs to the problem of brute forcing a single LFSR and then a system of 2 LFSRs. The amount of effort saved here depends on the length of the LFSRs. For realistic values, it is a very substantial saving and can make brute-force attacks very practical. Observe in the table above that x2 also agrees with the generator output 6 times out of 8, again a correlation of 75% correlation between x2 and the generator output. We may begin a brute force attack against LFSR-2 independently of the keys of LFSR-1 and LFSR-3, leaving only LFSR-1 unbroken. Thus, we are able to break the Geffe generator with as much effort as required to brute force 3 entirely independent LFSRs. This means the Geffe generator is a very weak generator and should never be used to generate stream cipher keystreams. Note from the table above that x1 agrees with the generator output 4 times out of 8—a 50% correlation. We cannot use this to brute force LFSR-1 independently of the others: the correct key will yield output that agrees with the generator output 50% of the time, but on average so will an incorrect key. This represents the ideal situation from a security perspective—the combining function F(x1,x2,x3) should be chosen so the correlation between each variable and the combining function's output is as close as possible to 50%. In practice, it may be difficult to find a function that achieves this without sacrificing other design criteria, e.g., period length, so a compromise may be necessary.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Correlation attack

Start with the simplest possible case. Write down what Correlation attack claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Correlation attack before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Correlation attack ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Correlation attack

In research
Correlation attack appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Correlation attack in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Correlation attack is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cryptographic attacks, Stream ciphers, so understanding it makes those chapters shorter.
In everyday life
Look for Correlation attack outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Correlation attack” →

How to study Correlation attack in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Correlation attack means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Correlation attack out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Correlation attack in simple terms?

Correlation attacks are a class of cryptographic known-plaintext attacks for breaking stream ciphers whose keystreams are generated by combining the output of several linear-feedback shift registers (LFSRs) using a Boolean function. Correlation attacks exploit a statistical weakness that arises fro…

Why does Correlation attack matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Correlation attack?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Correlation attack.

Tags

  • Cryptographic attacks
  • Stream ciphers

Keep exploring