How Do You Vet Your Writers?
Our writers pass rigorous tests in their fields, have verified degrees, and undergo continuous training to ensure expertise. This ensures your paper is handled by a true professional. Our selective screening process maintains the highest standards of academic competence. You can trust our team to deliver top-quality work. Ace my homework with confidence knowing every writer meets stringent qualification standards.
Dipanjan Bhowmik
Abstract
The objective of this paper is to provide a better understanding of the Linear Cryptanalysis Attack developed by M.Matsui [2]. This paper has been written after going through noted literature in this field and has been structured in such a way that a beginner in this field would be able to understand the idea with little prior knowledge. The paper describes a simple cipher and then applies Linear Cryptanalysis to break it. The cipher has been intentionally taken to be very simple so that a beginner can actually implement it and get an actual feel of the attack. The paper also describes all the algorithms involved in this attack again with the intention of letting a beginner actually realize the attack.
Keywords: Linear Cryptanalysis, Linear Approximation Table, s-box, Toy cipher, Parity.
Can You Prevent Paper Resale?
We never resell papers—each is custom-written and stored securely, with strict policies to protect your ownership. Your work stays yours alone. Once delivered, your paper belongs exclusively to you with full intellectual property rights. We guarantee complete confidentiality for every order. Paper writing ownership remains entirely yours with zero resale risk.
Introduction:
If one feeds a random input with a particular property into a magic box and can guess the corresponding property in the output, the magic box is some what linear.
For example imagine that the box takes an input and adds one to it. Now, let’s say that the property which is looked at is whether the input/output is even. By feeding it an input, one knows the property will be opposite in the output every single time. In other words, adding one to an even number will always produce an odd number and vice versa. This magic box will be completely linear with respect to divisibility by 2.
In an iterative cipher, substitution box(s) (S-Box(s)) add non linearity to it. Ideally, an s-box should receive an input with property X and output a number that has property Y exactly 50% of the time.
What Is Your Fastest Turnaround?
We can deliver polished papers in 3 hours for urgent needs, with top writers ensuring quality under pressure. Perfect for tight deadlines, we have got you covered. Our express service maintains academic standards even with accelerated timelines. Chat with support to confirm timing. Research study bay rapid delivery combines speed with uncompromised academic excellence.
The property, which is being looked at in Linear Cryptanalysis is Parity.
Definition
Parity: It is a Boolean value (a 0 or a 1), that we get if we perform an XOR operation on some or all of the bits of a number expressed in binary form. The bits that are being XORed together is defined by another number called the mask. The mask lets us to ignore some of the bits of the input while calculating the parity. In order to calculate the parity, the mask value it bitwise ANDed with the input value, the bits of the resultant is then taken and XORed together to obtain the parity.
Generating Linear Approximation Tables (LATs):
The masked input parity concept is used to find linearity in the S-boxes. Every single combination of input mask vs. output mask has to be tested for all possible inputs. Basically we will take an input value, mask it using an input mask and obtain its parity (Input Parity). Next, we will take the original input, run it through the S-box and mask it with 6the output mask. We then compute its parity (Output Parity). If they match, then we know that the combination of input and output mask holds true for that input. After doing this for every possible input against every possible pair of input/output masks, we have made a table called the Linear Approximation Table. Each entry in the table is a number indicating the number of times a specific input/output mask pair holds true when tested against all possible inputs. For example, if a certain S-box takes 4 bit inputs and produce 4 bit output, then the LAT will be of dimension 16 x 16 and each entry will range from 0 to 16, indicating the number of successful matches between input and output parity.
Can You Help with Lab Reports?
Our science writers craft detailed lab reports, including data analysis and clear conclusions, tailored to your experiment. We ensure scientific accuracy and clarity. Lab reports require precise methodology documentation and proper data interpretation. Provide your data or guidelines to get started. Essay writer specialists in STEM fields deliver technically accurate lab documentation.
Algorithm 1: Algorithm for generating Linear Approximation Table
For i=0 to 2m -1
For j=0 to 2n -1
For k=0 to 2m -1
If Parity (k AND i) =Parity(S-box[k] AND j) then
How Do I Provide Feedback?
Use our messaging system to share feedback with your writer, ensuring your paper evolves to meet your vision. This keeps you in control of the process. Continuous feedback loops allow for real-time adjustments and refinements. Log in to your account to communicate directly. My assignment help includes interactive feedback systems for collaborative refinement.
LAT[i][j] ï¦LAT[i][j] +1
Where, LAT is a 2-D array of size m x m.
Parity () is a function that computes the parity of the given input.
M is the total number of bits fed as input to the S-box.
N is the total number of bits produced as output by the S-box.
Can You Write for Graduate Programs?
Our Ph.D. writers create advanced papers for graduate-level work, with deep research and sophisticated arguments. We cater to the demands of graduate studies. Graduate writing requires mastery of theoretical frameworks and scholarly discourse. Share your programs requirements for a perfect fit. Ace tutors with advanced degrees support graduate-level academic excellence.
I ranges from 0 to 2m -1 , it represents all possible input masks.
J ranges from 0 to 2n-1 representing all possible output masks.
K ranges from 0 to 2m -1, it represents all possible inputs to S-box.
Let us assume an S-box that takes 4 bit inputs and produces 4 bit output. Both the input and output ranges from 0 to 15. Such a S-box is injective in nature.
What Plagiarism Tools Do You Use?
We use in-house tools and WriteCheck to ensure 95%+ originality, keeping your paper unique. A free originality report is included with every order. Our comprehensive plagiarism screening catches even paraphrased content to guarantee authenticity. Your work is always crafted from scratch. Research essay service authenticity is verified through industry-leading detection technology.
|
I
|
0
|
1 Can You Follow Strict Rubrics?We meticulously follow your rubric, ensuring every requirement—structure, sources, tone—is met with precision. Our editors double-check for compliance. Rubric adherence ensures maximum grade potential by meeting all assessment criteria. Upload your rubric for a flawless paper. Essay helper precision ensures every rubric requirement receives careful attention.
|
2
|
3
|
4
|
5 How Do You Handle Urgent Revisions?Urgent revisions are prioritized, with editors turning around changes in hours to meet your deadlines. We act fast to keep your paper on track. Our rapid-response team addresses time-sensitive revision needs without compromising quality. Submit your revision requests through your account for quick results. Paper writing modifications are expedited for urgent academic situations.
|
6
|
7
|
8
|
9 Can You Write Admission Essays?We craft standout admission essays, showcasing your unique story to make your application shine. Our writers highlight your strengths effectively. Admission essays require authentic voice and compelling narratives that resonate with committees. Share your goals in the order form for a compelling essay. Assignment writer expertise creates admission materials that capture committee attention.
|
A
|
B
|
C
|
D What Is Your Expertise in STEM Fields?Our STEM writers hold advanced degrees and deliver precise, data-driven papers for technical subjects. We ensure accuracy in every detail. Technical writing demands both subject mastery and clear communication of complex concepts. Provide your technical requirements for a tailored result. Ace my homework challenges in science and mathematics with specialized expert support.
|
E
|
F
|
|
O
|
E
|
4 Can You Create Visual Aids?We include charts, graphs, or tables when needed, enhancing your papers clarity and professionalism. These visuals support your arguments effectively. Data visualization strengthens academic arguments by making complex information accessible. Specify any visual needs in your order. Assessment help includes professional visual elements that enhance presentation quality.
|
D
|
1
|
2
|
F
|
B How Do You Ensure Confidentiality?Your data is encrypted, and papers are never shared, ensuring complete privacy throughout the process. We prioritize your security at every step. Our privacy protocols exceed industry standards with multiple layers of data protection. Rest easy knowing your order is protected. Research study bay confidentiality protocols protect every student interaction and transaction.
|
8
|
3
|
A
|
6 Can You Help with Book Reviews?Our writers produce insightful book reviews, analyzing themes and arguments to meet academic standards. We ensure depth and clarity in every review. Critical book analysis requires balanced evaluation of both content and literary merit. Provide the book details to get started. Essay writer expertise in literary analysis delivers thorough critical evaluations.
|
C
|
5
|
9
|
0
|
7 What Is Your Support Availability?Our support team is available 24/7 via chat, email, or phone, ready to assist with any questions. We are here to make your experience seamless. Round-the-clock availability means help is always accessible regardless of time zone. Reach out anytime for help! My assignment help support operates continuously for global student convenience.
|
For such an S-box, the algorithm to generate the Linear Approximation Table is modified as following:
Algorithm 2: Algorithm for generating Linear Approximation Table for the S-box given in Fig 1.
For i=0 to 15
For j=0 to 15
For k=0 to 15
If Parity (k AND i) =Parity(S-box[k] AND j) then
LAT[i][j]ï¦ LAT[i][j] +1
Can You Write in Multiple Styles?
From narrative to argumentative, our writers adapt to any style, ensuring your paper fits the assignment perfectly. We tailor every detail to your needs. Different writing styles serve distinct rhetorical purposes in academic discourse. Specify your style in the order form. Paper writing versatility covers all academic styles from creative to analytical.
In this case, the LAT generated is of dimension 16 x 16.The following table depicts the Linear
Approximation Table generated for the S-box given in fig. 1 using algorithm 2.
|
Output mask
|
|
Input mask
|
|
0
|
1 How Do You Handle Last-Minute Orders?We prioritize rush orders, assigning top writers to deliver quality work even on tight deadlines. We thrive under pressure to meet your needs. Our emergency response system activates immediately for urgent academic needs. Contact support to confirm your urgent order. Ace tutors excel at emergency assignments without sacrificing academic standards.
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9 Can You Support Non-Native Speakers?We tailor papers to your language level, ensuring clarity and academic quality for ESL students. Our writers make complex ideas accessible. ESL support includes culturally appropriate language and clear academic expression. Let us know your needs for a perfect fit. Essay helper services accommodate international students with language-sensitive support.
|
A
|
B
|
C
|
D
|
E
|
F
|
|
0
|
16
|
8
|
8 What Is Your Editing Expertise?Our editors refine structure, grammar, and style, turning your draft into a polished, professional paper. We enhance your work while keeping your voice. Professional editing elevates good writing to excellent through expert refinement. Upload your draft to see the difference. Research essay service editing transforms rough drafts into polished academic submissions.
|
8
|
8
|
8
|
8
|
8 Can You Handle Multi-Part Assignments?We manage complex projects, delivering each part on time with consistent quality and coherence. We keep your project cohesive from start to finish. Multi-part projects require careful coordination to maintain thematic unity throughout. Provide your project details for seamless execution. Assignment writer coordination ensures consistent excellence across complex multi-phase projects.
|
8
|
8
|
8
|
8
|
8 Do You Offer a Quality Guarantee?We guarantee high-quality papers with free revisions within 7 days to ensure your complete satisfaction. Your success is our priority. Our quality commitment includes unlimited revisions until you are fully satisfied with the result. Let us know how we can perfect your paper. Paper writing excellence is backed by our comprehensive satisfaction guarantee.
|
8
|
8
|
8
|
|
1 Can You Help with Research Proposals?Our writers craft compelling research proposals, outlining your study with clarity and academic rigor. We set the stage for your research success. Strong proposals require clear methodology and compelling rationale for the research. Share your topic for a tailored proposal. Assessment help includes research proposal development for successful project approval.
|
8
|
8
|
6
|
6
|
8
|
8 Do You Offer Bulk Order Discounts?Yes, orders over $500 get 5% off, and over $1,000 get 10% off, making large projects more affordable. Save more on big assignments. Bulk discounts reward comprehensive academic planning and multiple-paper orders. Check your order form for discount details. Ace my homework affordably with volume discounts for extensive academic needs.
|
6
|
14
|
10
|
10
|
8
|
8
|
10
|
10
|
8
|
8
|
|
2
|
8
|
8
|
6
|
6
|
8
|
8
|
6
|
6
|
8
|
8
|
10
|
10
|
8
|
8
|
2
|
10
|
|
3
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
10
|
2
|
6
|
6
|
10
|
10
|
6
|
6
|
|
4
|
8
|
10
|
8
|
6
|
6
|
4
|
6
|
8
|
8
|
6
|
8
|
10
|
10
|
4
|
10
|
8
|
|
5
|
8
|
6
|
6
|
8
|
6
|
8
|
12
|
10
|
6
|
8
|
4
|
10
|
8
|
6
|
6
|
8
|
|
6
|
8
|
10
|
6
|
12
|
10
|
8
|
8
|
10
|
8
|
6
|
10
|
12
|
6
|
8
|
8
|
6
|
|
7
|
8
|
6
|
8
|
10
|
10
|
4
|
10
|
8
|
6
|
8
|
10
|
8
|
12
|
10
|
8
|
10
|
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
6
|
10
|
10
|
6
|
10
|
6
|
6
|
2
|
|
9
|
8
|
8
|
6
|
6
|
8
|
8
|
6
|
6
|
4
|
8
|
6
|
10
|
8
|
12
|
10
|
6
|
|
A
|
8
|
12
|
6
|
10
|
4
|
8
|
10
|
6
|
10
|
10
|
8
|
8
|
10
|
10
|
8
|
8
|
|
B
|
8
|
12
|
8
|
4
|
12
|
8
|
12
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
|
C
|
8
|
6
|
12
|
6
|
6
|
8
|
10
|
8
|
10
|
8
|
10
|
12
|
8
|
10
|
8
|
6
|
|
D
|
8
|
10
|
10
|
8
|
6
|
12
|
8
|
10
|
4
|
6
|
10
|
8
|
10
|
8
|
8
|
10
|
|
E
|
8
|
10
|
10
|
8
|
6
|
4
|
8
|
10
|
6
|
8
|
8
|
6
|
4
|
10
|
6
|
8
|
|
F
|
8
|
6
|
4
|
6
|
6
|
8
|
10
|
8
|
8
|
6
|
12
|
6
|
6
|
8
|
10
|
8
|
Similarly, the LAT for any of the DES S-box can also be generated, For DES S-box; the algorithm is modified as the following:
Algorithm 3: Algorithm for generating LAT for DES S-Box.
For i=0 to 15
For j=0 to 63
For k=0 to 15
If Parity (k AND i) =Parity(S-box[k] AND j) then
LAT[i][j] ï¦AT[i][j] +1
In this case, the LAT is of dimension 16 x 64, the reason being DES S-box takes 4 bit input and produces 6 bit output.
Piling Up Principle
One of the fundamental tools used for linear cryptanalysis is the Piling Up Principle. Let us conceder two random binary variables X1 and X2, and let us assume
And
Then, the probability of the relationship X1(+)X2 will be
That is, X1 (+) X2 will be 0 when X1=X2 i.e. when both X1 and X2 are 0 and both X1 and X2 are 1. And X1 (+) X2 will be 1 when X1≠ X2 i.e. when X1=0 and X2=1 or X1=1 and X2=0. Accordingly probabilities are computed, assuming X1 and X2 are independent.
We are particularly interested in deviation of the probability from ½, so, let us consider p1=1/2+ ε1 and p2=1/2+ε2, where ε1 and ε2 are the deviation of p1 and p2 from respectively from ½ and are referred to as probability bias.
Now, P(X1 (+) X2=0)=(1/2 + ε1).(1/2+ε2) + (1-(1/2+ε1)).(1-(1/2+ε2))
=1/2+2.ε1.ε2
So, probability bias of X1 (+) X2 is given by
ε1,2=2.ε1.ε2
Generally, if X1,X2,…Xn are n independent random binary variables, then the probability of X1 (+) X2 (+) …(+) Xn=0 is given by the Piling Up Lemma.
P( X1 (+) X2 (+) …Xn =0) = ½ + 2 n-1 . ∏i=1…n εi……….(1)
And the probability bias of (+) X2 (+) …(+) Xn=0 is given by
ε1…n=2 n-1 . ∏i=1…n εi
Note that, P( X1 (+) X2 (+) …Xn =0) = ½, if there exist some εi such that εi=0 or pi=1/2. And P( X1 (+) X2 (+) …Xn =0) = 0 or 1, if for all εi, εi=+1/2 or -1/2 respectively or pi=0 or 1 respectively.
Attacking a Toy Cipher
Let us consider a toy cipher that takes 4 bit input goes through two iterations of key addition and block substitution and yields a 4 bit output. The following figure diagrammatically represents the toy cipher.
P1, P2, P3, P4 represents the 4 bit plain text
C1, C2, C3, C4 represents 4 bit cipher text.
K0, K1, K2 are 4 bit sub keys
Total key length is of 12 bits.
The cipher uses two identical S-boxes, which is same as the S-box described earlier.
The following algorithm implements the toy cipher
Algorithm 4: Implementing Toy Cipher
Kye[]ï¦{k0,k1,k2}
Sbox[]=ï¦{E,4,D,1,2,F,B,8,A,6,C,5,9,0,7}
For i=0 to 15// 16 possible inputs
{ p=i
For j= 0 to 1// 2 iterations
pï¦Sbox [ p (+) Key[j]]
C[i]ï¦ p (+) Key[2] //final key whitening step
}
The toy cipher yields the following output when Key[]ï¦{B,7,F}
|
Plain Text
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
|
Cipher Text
|
3
|
B
|
6
|
D
|
1
|
7
|
F
|
2
|
4
|
9
|
E
|
5
|
8
|
A
|
C
|
0
|
The first step towards attacking the cipher begins by obtaining an equation of the form X1 (+) X2 (+)…(+) Xn =0. Such an expression can be obtained using Linear Approximation Table. In our example P(LAT[F][A])=12/16 or equivalently Bias( LAT[F][A})=4/16,k where F is the input mask and A is the output mask. It should be noted that although LAT[0][0]=16 but it cannot be used.
Let Uij demote the jth input of ith S-Box and Vij denote the jth output of the ith S-Box.
So, P(U11 (+) U12 (+) U13 (+) U14 =V11 (+) V13)= 12/16
Let Kij denote the jth bit of the ith sub key, then U11 = P1 (+) K01, U12 =P2 (+) K02, U13 = P3 (+) K03, and U14 = P4 (+) K04, where Pi denotes the ith plain text bit.
Therefore, P( P1 (+) K01 (+) P2 (+) K02 (+) P3 (+) K03 (+) P4 (+) K04 = V11 (+) V13)) = 12/16
orP ( P1 (+) P2 (+) P3 (+) P4 (+) ∑K0 = V11 (+) V13) = 12/ 16
Since, U21 = V11 (+) K11 or, V11 = U21 (+) K11 and U23 = V23 (+) K13 or, V13 = U23 (+) K13
Hence, P (P1 (+) P2 (+) P3 (+) P4 (+)∑K0 = U21 (+) K11 (+)U23 (+) K13) = 12/ 16
or, P (P1 (+) P2 (+) P3 (+) P4 (+)∑K0 (+) K11 (+) K13 = U21 (+)U23) = 12/ 16
Let us assume K=∑K0 (+) K11 (+) K13, which can either be 0 or 1
Therefore, P (P1 (+) P2 (+) P3 (+) P4 (+) K= U21 (+)U23) = 12/ 16 Or,P (P1 (+) P2 (+) P3 (+) P4 = U21 (+)U23) =
Now, as we have obtained a linear expression with a relatively high probability bias, we would now partially decrypt the cipher text to obtain U2 (input to the 2nd S-Box). The following algorithm does this.
Algorithm 5: Partially decrypting the cipher text
C[] ï¦ { 3,B,6,D,1,7,F,2,4,9,E,5,8,A,C,0}
Isbox[] ï¦ {E,3,4,6,1,C,A,F,7,D,9,6,B,2,0,5}
For k=0 to 15
{pro[k]ï¦ 0
For I = 0 to 15
{pdc [k][i] ï¦ isbox [ C[i] (+) k]
If Parity (pdc[k][i] AND A) = Parity ( I AND F) then
pro[k] ï¦ pro[k] +1
}
}
It should be noted that Parity (pdc[k][i] AND A) = Parity ( I AND F) is the algorithmic implementation of P1 (+) P2 (+) P3 (+) P4 (+) = U21 (+) U23. Since, bit wise ANDing retrieves the required bits when ANDed with a mask having 1 in the required position in its binary equivalent.
The algorithm yields the following probabilities.
|
Key
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
|
Probability
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
From the result we observe that probability when key=F is 12/16 which matches with our expected probability, there by indicating that K2=F.
It should be noted that in our example, it so happened that there is only one candidate for K2, but generally there may be more than one candidate and all of then should be given due consideration.
For the next round, we use the partially decrypted cipher text with respect to key =F as the cipher text and perform the procedure defined as algorithm 5.
That is , now C[]ï¦{B,1,D,4,0,7,E,2,6,A,3,9,F,C,8,5}
The output yielded at this point is given below.
|
Key
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
|
Probability
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
At this time we are comparing the plain text block P1, P2, P3, P4 to the input of the first S-Box i.e. U1, U2, U3, U4, so the expected probability is computed as
P( P1 (+) P2 (+) P3 (+) P4 = P1 (+) P2 (+) P3 (+) P4) =1
Or, P( P1 (+) P2 (+) P3 (+) P4 = P1 (+) P2 (+) P3 (+) P4 (+) ∑K0) =
Or, P( P1 (+) P2 (+) P3 (+) P4 = P1 (+) K01 (+) P2 (+) K02 (+) P3 (+) K03 (+) P4 (+) K04) =
Or, P( P1 (+) P2 (+) P3 (+) P4 = U11 (+) U12 (+) U13 (+) U14) =
The expected probability match4es with the observed probability for sub key K1= 7. Therefore with high degree of certainty, K1=7.
So, we retain the partially decrypted cipher text for sub key =7, which is contained in pdc[7][i] for i=0 to 15. The partially cipher text for sub key =7 is given in the following table.
|
Plain Text
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
A
|
B
|
C
|
D
|
E
|
F
|
|
Partially decrypted Cipher Text
|
B
|
A
|
9
|
8
|
F
|
E
|
D
|
C
|
3
|
2
|
1
|
0
|
7
|
6
|
5
|
4
|
Now, in order to obtain the sub key K0, we need simply to choose any pair of plain text and partially decrypted cipher text and perform a bitwise XOR operation.
Say, we choose (4,F), then 4 (+) F = B, So, K0=B.
Thus, the actual key ={B, 7, F}, which is the key we originally used in our example toy cipher.
It should be noted that, at every step of our attack, we obtain unique sub key values that matches our expected probability, which may not be the case all the time. And in such situations where multiple sub keys matches the expected probability we need to consider each of these sub keys.
Observations
- If the Linear Approximation Table (LAT) has an entry such that Bias (LAT[i][j])| =1/2 (50%) and i=j, then the S-box is prone to Linear attack. So, such an S-box is a strict no for any cipher
- If the Linear Approximation Table has entries such that |Bias(LAT[i][j])| =1/2 and | Bias (LAT[j][k])| = ½ where i ≠ j ≠k , then such a cipher is also susceptible to Linear Attack.
- If |Bias(LAT[i][j])| = ½ where i≠j and there is no pair such that |Bias(LAT[i][j])|=1/2 and |Bias(LAT[j][k])|=1/2 where i ≠ j ≠k , then after a certain number of iterations, Linear Cryptanalysis becomes ineffective. The observation is illustrated using the following graph.
Conclusion
As the number of iterations of an iterative cipher increases and observations 1 and 2 does not hold, Linear Cryptanalysis becomes increasingly less effective.
References:
- Heys,H.M,2002,”A Tutorial on Linear And Differential Cryptanalysis”, Cryptologia,XXV(3),189-221.
- Matsui, M.,1994,”Linear Cr4yptanalysis Method For DES Cipher”, Advance in Cryptlogy-EUROCRYPT’93, Springer-Verlag,386-397.
- Jakobson, B.T.,Abyar, M.,Nordholt, P.S.,2006,”Linear And Differential Cryptanalysis”
- Paar, C.,& Pelzl, J.,2010,Understanding Cryptography.Berlin:Springer-Nerlag.