Week - 10
Lecture 46:
Cryptoanalysis
Cryptology
-
Two parts:
- Cryptography (design)
- Cryptanalysis (attack)
Attack Models
1. Ciphertext-Only Attack (COA)
-
Attacker knows:
-
Goal:
- Recover:
2. Known-Plaintext Attack (KPA)
-
Attacker knows:
-
From previous communications
3. Chosen-Plaintext Attack (CPA)
-
Attacker can choose:
-
Gets corresponding:
-
Goal:
- Break encryption
- Predict new plaintext
4. Chosen-Ciphertext Attack (CCA)
-
Attacker chooses:
-
Gets:
-
Strongest attack model
Attacker Goal
- Find:
OR
- Given:
Find:
Generic Attacks
1. Exhaustive Search (Brute Force)
-
Try all keys:
-
Until correct one found
2. Table Lookup Attack
- Precompute table:
-
Store mappings
-
On intercept:
✔ Very fast at runtime
One-Way Function
Function:
Properties
-
Easy to compute:
-
Hard to invert:
In Cryptography
-
Encryption:
-
Hard to recover:
Table-Based Attack Idea
- Precompute:
for many keys
-
Store results
-
Match with intercepted:
Trade-off
- Time ↓ (fast lookup)
- Memory ↑ (large table)
Key Insight
-
Strong systems must resist:
- CPA
- CCA
✔ Security defined against strongest attacker
Final Note
-
Cryptanalysis evaluates:
- Strength of system
- Weakness under attack models
Lecture 47:
Time- Memory Trade- off Attack
Time–Memory Trade-Off (TMTO)
Goal
-
Invert one-way function:
-
Find:
Problem
-
Brute force:
- Time:
- Memory:
-
Table lookup:
- Time:
- Memory:
Idea
- Balance:
✔ Reduce both partially
Hellman Method
Precomputation Phase
-
Choose chains of length:
-
Start with random:
-
Generate chain:
Storage
-
Store only:
-
Not full chain
✔ Saves memory
Table Size
-
Number of chains:
-
Total covered space:
Online Phase (Attack)
Given:
Step 1: Check Endpoints
- Compare:
Step 2: If no match
-
Compute:
-
Up to:
Step 3: If match found
- Recompute chain from start
- Locate exact:
Maximum Work
Trade-off Relation
Let:
- (N) = key space
Then:
Balanced Case
Success Probability
-
Depends on:
-
More chains → higher success
Key Insight
- Do heavy work offline
- Fast lookup online
Limitation
- Chains may merge → collisions
- Reduces coverage
Improvement
- Use multiple tables
- Different reduction functions
Summary
-
TMTO reduces:
- Time from (O(N))
- Memory from (O(N))
✔ Achieves practical balance for attacks
Lecture 48:
Differential Cryptoanalysis
Differential Cryptanalysis
Basic Idea
- Study how input difference affects output difference
Definitions
-
Input pair:
-
Input difference:
-
Output:
-
Output difference:
Differential
-
Pair:
-
If:
✔ Useful for attack
Attack Strategy
-
Choose many plaintext pairs:
-
Encrypt → get:
Last Round Attack
- Guess subkey:
For each guess
- Partially decrypt:
Check condition
Count matches
- Maintain counter for each:
✔ Correct key → highest count
Key Space Example
- For DES:
Finding Good Differentials
- Use S-box analysis
Difference Distribution Table (DDT)
For each:
-
Compute all:
-
Evaluate:
-
Count frequency
Goal
- Find:
Example (4-bit S-box)
-
Choose:
-
For all inputs:
- Compute output differences
- Build frequency table
✔ Highest frequency → best differential
Multi-Round Extension
- Combine round-wise differentials
- Multiply probabilities
Key Insight
-
Exploits non-random behavior of cipher
-
Works well on:
- SPN
- Feistel structures
Summary
- Input difference → predictable output difference
- Use statistics to recover key
✔ Powerful non-generic attack on block ciphers
Lecture 49:
More on Differential Cryptoanalysis
Differential Attack (r-round)
Step 1: Find Differential
- Find high-probability:
Step 2: Initialize
-
For all subkeys:
-
Set counter:
Step 3: Chosen Plaintexts
-
Select:
-
Encrypt:
Step 4: Partial Decryption
-
For each guess:
-
Compute:
Step 5: Check
-
If:
-
Then:
Step 6: Repeat
- Until one key has significantly high count
✔ That is likely correct subkey
Impossible Differential Attack
- Instead of high probability:
Idea
- If a key produces:
→ Reject that key
✔ Eliminate wrong keys
Higher-Order Differential
- Use multiple differences
Example:
- Second-order:
✔ Captures complex patterns
Differential Composition
Given:
Combined
Attack Using Composition
Step 1
Choose:
Step 2
Get:
Construct:
Step 3
Decrypt:
Step 4
Check:
Step 5
Repeat → count valid patterns
Key Insight
-
Break cipher by:
- Tracking differences
- Using probability bias
Applications
-
Effective on:
- DES (reduced rounds)
- SPN ciphers
Summary
-
Uses:
-
Types:
- Standard differential
- Impossible differential
- Higher-order differential
✔ Powerful statistical cryptanalysis technique
Lecture 50:
Linear Cryptoanalysis
Attack Model
-
Uses:
- Known plaintext pairs:
-
Goal:
Idea
- Approximate cipher using linear relations
Linear Approximation
For bits:
- Holds with probability:
Bias
Define:
- If:
✔ Useful relation
Boolean Function
-
Input:
-
Output:
-
Linear form:
Combining Approximations (Piling-Up Lemma)
Let biases:
Combined Bias
Combined Probability
Special Case (2 variables)
Key Observation
- If any:
Then:
❌ No useful information
Attack Steps
Step 1: Find Linear Approximation
- For S-box / round function
Step 2: Collect Data
- Gather many:
Step 3: Evaluate Expression
- Compute LHS for all pairs
Step 4: Count Bias
- Count how often:
Step 5: Guess Key Bits
- Try key candidates
- Select one with highest bias
✔ Likely correct key
Application
-
Applied to:
- DES (Eurocrypt 1993)
-
Needs:
- Large number of plaintext-ciphertext pairs
Key Insight
- Cipher ≠ perfectly random
- Linear patterns exist
Summary
-
Uses:
-
Exploits:
✔ Powerful statistical attack on block ciphers