Week - 11
Lecture 51:
Cryptoanalysis and Stream Cipher
Stream Cipher (LFSR Model)
-
Keystream:
-
Encryption:
-
Decryption:
LFSR Structure
-
State:
-
Linear recurrence:
✔ Defined by feedback polynomial
Problem
- LFSR is linear ❌ Easily breakable
Solution
- Add non-linear function:
✔ Improves security
Algebraic Attack
Idea
-
From:
-
If plaintext known:
- Also:
Build Equations
- For multiple time steps:
✔ System of equations
Goal
- Solve for:
Problem
- Equations are non-linear
Linearization
- Replace products:
Example
Result
- Convert system into:
✔ Easier to solve
Re-linearization
- Use identities like:
- Rewrite as combinations:
- Substitute:
Key Insight
- Non-linear → transformed into linear system
- Solve using linear algebra
Limitation
- Number of variables increases rapidly
- Needs enough equations
Final Summary
-
LFSR → linear → weak
-
Add non-linearity → stronger
-
Algebraic attack:
- Build equations
- Linearize
- Solve system
✔ Recovers internal state / key
Lecture 52:
Modern Stream Ciphers
Modern Stream Cipher Structure
Basic Working
-
Keystream:
-
Encryption:
Initialization
-
Key + IV → initial state:
-
Run cipher for some rounds (warm-up)
✔ Removes initial bias
LFSR + Non-linearity
-
Linear part:
-
Non-linear part:
✔ Combined for security
General Model
-
State:
-
Output:
-
Update:
Key Idea
-
LFSR → fast but linear
-
Add:
- Non-linear function (g)
- Non-linear output (h)
✔ Prevents algebraic attacks
Example Structure (Typical)
- LFSR generates bits
- NLFSR mixes bits
- Output function combines both
SNOW-like Design
-
Uses:
- LFSR (linear state update)
- FSM (non-linear mixing)
-
Operates in:
-
Uses polynomial-based arithmetic
Grain Cipher (Example)
Components
- LFSR (linear)
- NLFSR (non-linear)
Output
Initialization
- Run:
✔ Before generating keystream
Functions
-
Feedback:
-
Output:
✔ Both include non-linearity
Important Concepts
1. Internal State
- Determines entire keystream
2. Key Recovery Target
- Attacker tries to find:
3. Security
-
Depends on:
- Non-linearity
- State size
- Initialization
Attacks
- Algebraic attacks
- Correlation attacks
- Known keystream attacks
Weakness
- Poor design → recover:
→ Full keystream known
Example Cipher
- Helix (stream cipher design)
Summary
-
Modern stream ciphers:
- LFSR + NLFSR
- Non-linear output
- Initialization phase
✔ Designed to resist linear & algebraic attacks
Lecture 53:
Shamir secret sharing
Secret Sharing (Threshold Scheme)
Goal
-
Split secret:
-
Into shares so that:
-
Any:
→ can recover
-
Less than (t) → cannot learn anything
-
Polynomial Construction
-
Choose random polynomial:
-
Degree:
Share Distribution
- For each user (i):
Reconstruction (Lagrange Interpolation)
- Using any (t) shares:
Formula
where
Key Property
- Polynomial of degree (t-1) → uniquely determined by (t) points
✔ Security guarantee
Security Insight
- With fewer than (t) shares:
❌ Secret cannot be guessed
Visual Intuition
- 1 share → many curves possible
- (t) shares → single curve
✔ Secret fixed
Application: Group Key Recovery
-
Secret key:
-
Each user has:
-
Any (t) users:
- Combine shares
- Recover:
Broadcast Scenario
-
Authority (GM) generates:
-
Sends shares to users
-
Broadcasts helper function:
User Computation
-
Each user knows:
-
Using broadcast:
-
Can compute:
Key Insight
-
Only authorized group (≥ t users):
- Can reconstruct secret
Advantages
- Fault tolerance
- No single point of failure
- Secure distributed key management
Summary
- Secret → polynomial
- Shares → points on curve
- Reconstruction → interpolation
✔ Foundation of secure group cryptography
Lecture 54:
Identity based Encryption (IBE)
Identity-Based Encryption (IBE)
Idea
- Public key = user identity
✔ No certificates needed
Setup
-
Choose groups:
-
Generator:
-
Master secret:
-
Public key:
Hash Functions
-
Map identity:
-
Key derivation:
Bilinear Pairing
Properties
-
Bilinearity:
-
Non-degenerate:
-
Efficient
Private Key Generation
- For user with identity (ID):
Encryption
-
Message:
-
Choose random:
Compute
Ciphertext
Decryption
- Using private key:
Compute
Recover Message
Correctness
-
Encryption uses:
-
Decryption computes same:
✔ Values match
Key Insight
- Identity → public key
- Trusted authority generates private keys
Advantages
- No certificates
- Simple key management
Limitation
-
Key escrow problem:
- Authority knows all private keys
Summary
-
Uses:
- Pairing (e)
- Hash to group
- XOR masking
✔ Foundation: Boneh–Franklin IBE scheme
Lecture 55:
Attribute based Encryption (ABE)
Attribute-Based Encryption (ABE)
Idea
- Instead of identity → use attributes
✔ Access based on properties, not identity
Motivation
-
Traditional (IBE):
- One-to-one communication
-
ABE:
- One-to-many communication
✔ Encrypt once → many authorized users can decrypt
Access Policy
- Ciphertext defined by policy:
- Only users with matching attributes can decrypt
Types of ABE
1. Key-Policy ABE (KP-ABE)
- Ciphertext → attributes
- Key → policy
2. Ciphertext-Policy ABE (CP-ABE)
- Ciphertext → policy
- Key → attributes
✔ More practical
Setup
-
Groups:
-
Generator:
-
Pairing:
Encryption
-
Message:
-
Random:
Compute
Ciphertext
Key Generation
-
For user with attributes:
-
Generate secret key components
Decryption
- If attributes satisfy policy:
Compute pairing
Recover
Key Insight
- Uses bilinear property:
✔ Enables policy-based access
Example
-
Policy:
- “MSc Math Students”
-
Users:
- MSc Math → ✔ decrypt
- BSc Math → ❌ cannot
- MSc Physics → ❌ cannot
Applications
- Secure file sharing
- Cloud access control
- Broadcast encryption
Broadcast Scenario
- Encrypt once
- Only authorized subset: can decrypt
Advantages
- Fine-grained access control
- No need for multiple encryptions
Limitation
- Complex key management
- Computation overhead
Summary
-
Identity → replaced by attributes
-
Policy-based encryption
-
Built using:
- Pairings
- Hash functions
✔ Powerful for real-world access control systems