Skip to main content

Week - 11

TITLE

Lecture 51:
Cryptoanalysis and Stream Cipher

Stream Cipher (LFSR Model)

  • Keystream:

    zt=f(st)z_t = f(s_t)
  • Encryption:

    ct=ptztc_t = p_t \oplus z_t
  • Decryption:

    pt=ctztp_t = c_t \oplus z_t

LFSR Structure

  • State:

    sts_t
  • Linear recurrence:

    st+1=aistis_{t+1} = \sum a_i s_{t-i}

✔ Defined by feedback polynomial


Problem

  • LFSR is linear ❌ Easily breakable

Solution

  • Add non-linear function: zt=f(st)z_t = f(s_t)

✔ Improves security


Algebraic Attack


Idea

  • From:

    zt=ctptz_t = c_t \oplus p_t
  • If plaintext known:

    zt knownz_t \text{ known}

  • Also: zt=f(st)z_t = f(s_t)

Build Equations

  • For multiple time steps: f(st)=ztf(s_t) = z_t

✔ System of equations


Goal

  • Solve for: strecover keys_t \Rightarrow \text{recover key}

Problem

  • Equations are non-linear

Linearization

  • Replace products:
xixj=yijx_i x_j = y_{ij}

Example

x1x2y12x_1 x_2 \rightarrow y_{12} x1x3y13x_1 x_3 \rightarrow y_{13}

Result

  • Convert system into: linear equations in yij\text{linear equations in } y_{ij}

✔ Easier to solve


Re-linearization

  • Use identities like:
x1x2x3x4x_1 x_2 x_3 x_4
  • Rewrite as combinations:
(x1x2)(x3x4)(x_1 x_2)(x_3 x_4)
  • Substitute: y12,;y34y_{12},; y_{34}

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

TITLE

Lecture 52:
Modern Stream Ciphers

Modern Stream Cipher Structure


Basic Working

  • Keystream:

    ztz_t
  • Encryption:

    ct=ptztc_t = p_t \oplus z_t

Initialization

  • Key + IV → initial state:

    s0s_0
  • Run cipher for some rounds (warm-up)

✔ Removes initial bias


LFSR + Non-linearity

  • Linear part:

    LFSR\text{LFSR}
  • Non-linear part:

    NLFSR / Boolean functions\text{NLFSR / Boolean functions}

✔ Combined for security


General Model

  • State:

    sts_t
  • Output:

    zt=h(st)z_t = h(s_t)
  • Update:

    st+1=g(st)s_{t+1} = g(s_t)

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:

    GF(28)GF(2^8)
  • Uses polynomial-based arithmetic


Grain Cipher (Example)


Components

  • LFSR (linear)
  • NLFSR (non-linear)

Output

zt=h(x1,x2,...,xn)z_t = h(x_1, x_2, ..., x_n)

Initialization

  • Run: 256 cycles256 \text{ cycles}

✔ Before generating keystream


Functions

  • Feedback:

    g()g(\cdot)
  • Output:

    h()h(\cdot)

✔ Both include non-linearity


Important Concepts

1. Internal State

sts_t
  • Determines entire keystream

2. Key Recovery Target

  • Attacker tries to find: s0 or keys_0 \text{ or key}

3. Security

  • Depends on:

    • Non-linearity
    • State size
    • Initialization

Attacks

  • Algebraic attacks
  • Correlation attacks
  • Known keystream attacks

Weakness

  • Poor design → recover: sts_t

→ 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

TITLE

Lecture 53:
Shamir secret sharing

Secret Sharing (Threshold Scheme)


Goal

  • Split secret:

    SS
  • Into shares so that:

    • Any:

      t userst \text{ users}

      → can recover

    • Less than (t) → cannot learn anything


Polynomial Construction

  • Choose random polynomial:

    f(x)=S+a1x+a2x2++at1xt1f(x) = S + a_1 x + a_2 x^2 + \cdots + a_{t-1} x^{t-1}
  • Degree:

    t1t-1

Share Distribution

  • For each user (i):
Sharei=(i,;f(i))\text{Share}_i = (i,; f(i))

Reconstruction (Lagrange Interpolation)

  • Using any (t) shares:
S=f(0)S = f(0)

Formula

f(0)=i=1tyiλif(0) = \sum_{i=1}^{t} y_i \cdot \lambda_i

where

λi=jixjxjxi\lambda_i = \prod_{j \ne i} \frac{x_j}{x_j - x_i}

Key Property

  • Polynomial of degree (t-1) → uniquely determined by (t) points

✔ Security guarantee


Security Insight

  • With fewer than (t) shares:
Infinite possible polynomials\text{Infinite possible polynomials}

❌ Secret cannot be guessed


Visual Intuition

  • 1 share → many curves possible
  • (t) shares → single curve

✔ Secret fixed


Application: Group Key Recovery

  • Secret key:

    K=f(0)K = f(0)
  • Each user has:

    f(i)f(i)
  • Any (t) users:

    • Combine shares
    • Recover: KK

Broadcast Scenario

  • Authority (GM) generates:

    f(x)f(x)
  • Sends shares to users

  • Broadcasts helper function:

    h(x)=f(x)+r(x)h(x) = f(x) + r(x)

User Computation

  • Each user knows:

    f(i)f(i)
  • Using broadcast:

    h(i)h(i)
  • Can compute:

    r(i)r(i)

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

TITLE

Lecture 54:
Identity based Encryption (IBE)

Identity-Based Encryption (IBE)


Idea

  • Public key = user identity ID0,1ID \in {0,1}^*

✔ No certificates needed


Setup

  • Choose groups:

    G,;GTG,; G_T
  • Generator:

    gGg \in G
  • Master secret:

    α\alpha
  • Public key:

    gαg^\alpha

Hash Functions

  • Map identity:

    H1(ID)GH_1(ID) \in G
  • Key derivation:

    H2:GT0,1H_2: G_T \rightarrow {0,1}^\ell

Bilinear Pairing

e:G×GGTe: G \times G \rightarrow G_T

Properties

  1. Bilinearity:

    e(ua,;vb)=e(u,v)abe(u^a,; v^b) = e(u,v)^{ab}
  2. Non-degenerate:

    e(g,g)1e(g,g) \ne 1
  3. Efficient


Private Key Generation

  • For user with identity (ID):
dID=H1(ID)αd_{ID} = H_1(ID)^\alpha

Encryption

  • Message:

    mm
  • Choose random:

    rr

Compute

U=grU = g^r V=mH2(e(H1(ID),;gα)r)V = m \oplus H_2\big(e(H_1(ID),; g^\alpha)^r\big)

Ciphertext

C=(U,;V)C = (U,; V)

Decryption

  • Using private key: dIDd_{ID}

Compute

e(dID,;U)=e(H1(ID)α,;gr)e(d_{ID},; U) = e(H_1(ID)^\alpha,; g^r) =e(H1(ID),;g)αr= e(H_1(ID),; g)^{\alpha r}

Recover Message

m=VH2(e(dID,;U))m = V \oplus H_2\big(e(d_{ID},; U)\big)

Correctness

  • Encryption uses:

    e(H1(ID),;gα)re(H_1(ID),; g^\alpha)^r
  • Decryption computes same:

    e(H1(ID),;g)αre(H_1(ID),; g)^{\alpha r}

✔ 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

TITLE

Lecture 55:
Attribute based Encryption (ABE)

Attribute-Based Encryption (ABE)


Idea

  • Instead of identity → use attributes
Attributes=MSc,;Math,;Student,;...\text{Attributes} = {\text{MSc},; \text{Math},; \text{Student},; ...}

✔ 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:
Policy =(MScMath)\text{Policy } = (\text{MSc} \land \text{Math})
  • 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:

    G,;GTG,; G_T
  • Generator:

    gg
  • Pairing:

    e:G×GGTe: G \times G \rightarrow G_T

Encryption

  • Message:

    mm
  • Random:

    rr

Compute

C1=grC_1 = g^r C2=mH2(e(H1(attributes),;gα)r)C_2 = m \oplus H_2\big(e(H_1(\text{attributes}),; g^\alpha)^r\big)

Ciphertext

C=(C1,;C2,;policy)C = (C_1,; C_2,; \text{policy})

Key Generation

  • For user with attributes:

    Attru\text{Attr}_u
  • Generate secret key components


Decryption

  • If attributes satisfy policy:

Compute pairing

e(d,;C1)e(d,; C_1)

Recover

m=C2H2(pairing result)m = C_2 \oplus H_2(\text{pairing result})

Key Insight

  • Uses bilinear property:
e(ga,;gb)=e(g,g)abe(g^a,; g^b) = e(g,g)^{ab}

✔ 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: SS 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