Week - 12
Lecture 56:
Functional Encryption (Introduction)
Homomorphic Encryption
Idea
- Compute on encrypted data
✔ No need to decrypt
Use Case
-
Alice stores encrypted data on cloud
-
Bob wants:
-
Cloud computes directly on ciphertext
Types
1. Additive Homomorphic
2. Multiplicative Homomorphic
3. Fully Homomorphic (FHE)
- Supports:
✔ Arbitrary computation
Examples
ElGamal
- Multiplicative:
RSA
- Also multiplicative:
✔ Not suitable for addition
Limitation
- Most schemes support only one operation
- FHE → very expensive
Cloud Computing Scenario
-
Alice:
-
Cloud computes:
-
Bob decrypts → gets result
✔ Data privacy preserved
Functional Encryption (FE)
Idea
-
Instead of full message:
- Learn only:
Key Concept
-
Secret key tied to function:
-
Decryption reveals:
✔ Nothing else about (m)
Example
-
Spam filter:
- Output:
-
Without revealing full message
Attribute-Based Logic (Extension)
- Conditions like:
Collusion Problem
- Multiple users combine attributes
❌ May break policy
✔ Secure schemes prevent this
Applications
- Cloud computation
- Access control
- Data analytics
- Auditing systems
Key Insight
- Homomorphic → compute on encrypted data
- Functional → reveal only function output
Summary
-
Homomorphic:
-
Functional:
✔ Advanced cryptography for privacy-preserving systems
Lecture 57:
Discrete Logarithm Problem (DLP)
Discrete Logarithm Problem (DLP)
Definition
-
Given cyclic group (G = \langle \alpha \rangle) of order (n)
-
Compute (a) such that:
Important Case
-
Group:
-
(p) prime
-
(\alpha) = generator
✔ Problem is computationally hard
Brute Force Method
- Try all possible values:
- Check:
⏱ Time complexity:
Table Lookup Method
- Precompute:
- Store in table
- Search for match with (\beta)
⏱ Time: fast lookup 💾 Space: large
Baby-Step Giant-Step (Shanks Algorithm)
Idea
Let:
Step 1 (Baby Steps)
Compute:
Step 2 (Giant Steps)
Compute:
Step 3
Find match:
Then:
Complexity
✔ Much faster than brute force
Example Result
Pohlig–Hellman Algorithm
Idea
- If:
- Reduce problem into smaller subproblems
Goal
Find:
Representation
Write:
Step (for each digit)
Compute:
Let:
Now find (a_0) using brute force:
Repeat
- Find (a_1, a_2, \dots)
Final Step
Use Chinese Remainder Theorem:
Key Insight
- Difficulty depends on factorization of (n)
✔ If (n) has small factors → easy ✔ If (n) has large prime factor → hard
Summary
-
DLP:
-
Methods:
- Brute force → slow
- BSGS → ()
- Pohlig–Hellman → efficient if (n) factorable
✔ Foundation of:
- Diffie–Hellman
- ElGamal
- ECC
Lecture 58:
Implementation Attacks
Side-Channel Attacks (Implementation Level)
Core Idea
- Attack does not break algorithm mathematically
- Instead, it uses physical leakage from implementation
Examples of leakage:
- Time taken
- Power consumption
- Electromagnetic signals
- Fault behavior
Types (FIPS Perspective)
- Timing Attack
- Power Analysis Attack
- Electromagnetic (EM) Attack
- Fault Injection Attack
Timing Attack
- Observe execution time of operations
Example:
- Modular exponentiation (a^b \mod n)
If using square-and-multiply:
- Different bits → different operations
- Time variation leaks key bits
Idea
- If bit = 1 → multiply + square
- If bit = 0 → only square
➡ Time difference ⇒ recover secret exponent
Countermeasures
- Constant-time implementation
- Avoid data-dependent branches
- Random delays (less reliable defense)
Power Analysis Attack
Observation
-
Power consumption varies per instruction
-
Example:
- XOR → low power
- Multiplication → higher power
Types
1. Simple Power Analysis (SPA)
- Directly observe power trace
- Identify operations visually
2. Differential Power Analysis (DPA)
- Statistical attack using many traces
DPA Method
-
Collect many traces:
-
Guess key bits
-
Partition traces into two sets:
- Based on predicted intermediate value
- Compute averages:
- Difference:
➡ Significant bias ⇒ correct key guess
Insight
- Noise reduces with averaging
- Signal (key-dependent) becomes visible
Application Example (DES)
- Target: S-box output
- Guess subkey bits
- Use power traces to validate guess
Fault Attacks
Idea
- Inject faults during computation
- Compare correct vs faulty outputs
Example:
- Flip bit during encryption
- Analyze difference
Why Smart Cards are Vulnerable
-
Physical access possible
-
Measurable:
- Power
- Timing
- EM signals
Countermeasures
Against Timing Attacks
- Constant-time exponentiation
Against Power Attacks
-
Noise addition
-
Masking:
-
Randomized computation
Against Fault Attacks
- Redundant computation
- Consistency checks
Randomization Defense
- Multiply intermediate values with random numbers
Example:
➡ hides correlation
Key Insight
- Security ≠ only math
- Implementation leaks secrets
Summary
-
Side-channel attacks exploit:
- Time
- Power
- Physical behavior
-
DPA:
-
Defense:
- Constant-time
- Masking
- Randomization
- Fault detection
✔ Real-world cryptography must secure implementation + algorithm
Lecture 59:
The Secure Sockets Layer (SSL)
Goal
-
Provide security above TCP layer
-
Used for:
- Web security (HTTPS)
- Secure client–server communication
Layered Structure
Application Layer
↑
SSL/TLS Protocol
↑
TCP
↑
IP
Two Main Components
1. Record Layer
-
Provides:
- Confidentiality
- Integrity
- Authentication
Record Layer Process
- Fragment data
- (Optional) Compression
- Add MAC
- Encrypt
- Add Header
Record Format
- Header fields:
-
Version:
- Major (e.g. 3 for SSLv3)
- Minor (e.g. 0)
MAC Computation
- Ensures integrity
2. Higher-Level Protocols
(a) Handshake Protocol
-
Establishes:
- Keys
- Algorithms
- Authentication
Steps
-
Client Hello
- Version
- Random number
- Session ID
- Cipher suites
-
Server Hello
- Selected cipher suite
- Random number
-
Certificate Exchange
- Server sends certificate (X.509)
-
Key Exchange
- Shared secret established
-
Finished Messages
- Verify handshake integrity
(b) Change Cipher Spec
-
Signals:
- Switch to encrypted communication
(c) Alert Protocol
-
Handles:
- Errors
- Warnings
Cipher Suite
Defines:
- Key exchange (RSA, DH)
- Encryption algorithm (AES, etc.)
- Hash/MAC (SHA, etc.)
Security Features
Confidentiality
Integrity
Authentication
- Using certificates (X.509)
Certificates
- Issued by Certificate Authority (CA)
- Bind identity to public key
Key Insight
-
SSL works on top of TCP
-
Provides:
- Secure channel
- End-to-end protection
Summary
-
Record Layer:
- Fragment → MAC → Encrypt
-
Handshake:
- Key exchange + authentication
-
Security:
- Confidentiality
- Integrity
- Authentication
✔ Foundation of HTTPS and secure web communication
Lecture 60:
Pretty Good Privacy (PGP)
Core Idea
-
Provides secure email communication
-
Combines:
- Symmetric cryptography
- Public-key cryptography
- Hash functions
Key Features (5 Services)
1. Authentication (Digital Signature)
- Ensures sender identity
Steps:
-
Compute hash:
-
Sign using private key:
-
Send:
✔ Provides:
- Integrity
- Authentication
- Non-repudiation
2. Confidentiality
- Uses hybrid encryption
Steps:
-
Generate session key:
-
Encrypt message:
-
Encrypt session key:
-
Send:
✔ Efficient + secure
3. Compression
- Applied before encryption
✔ Benefits:
- Reduces size
- Improves encryption speed
- Adds security (less redundancy)
4. Segmentation
- Large messages are split:
✔ Needed due to:
- Email size limits
5. Email Compatibility (Radix-64 Encoding)
- Converts binary → ASCII
✔ Ensures:
- Safe transmission over email systems
Complete PGP Flow
Sender Side
-
Message:
-
Hash + Sign:
-
Append:
-
Compress:
-
Encrypt (symmetric):
-
Encrypt session key:
-
Encode (Radix-64)
Receiver Side
- Decode
- Decrypt session key
- Decrypt message
- Decompress
- Verify signature
Algorithms Used
-
Symmetric:
- AES / IDEA / 3DES
-
Public Key:
- RSA
-
Hash:
- SHA family
Additional Components
Key ID
- Identifies which public key to use
Timestamp
- Indicates message creation time
Why PGP is Popular
- Free & widely available
- Flexible algorithm choices
- Strong security
- Independent of specific algorithms
Key Insight
- Uses hybrid cryptography:
Summary
-
Services:
- Authentication
- Confidentiality
- Compression
- Segmentation
- Encoding
-
Core encryption:
✔ Widely used for secure email systems