Skip to Content
CSE4303Introduction to Computer Security (Lecture 13)

CSE4303 Introduction to Computer Security (Lecture 13)

Asymmetric Encryption

Public-key building block: Trapdoor function (TDF)

Definition of trapdoor function

A trapdoor function XYX\to Y is a triple of efficient algorithms (G,F,F1)(G,F,F^{-1}) such that:

  • G()G(\circ) is randomized algorithm outputs a key pair (pk,sk)(pk,sk).
  • F(pk,)F(pk,\circ) is a deterministic algorithm that takes as input a public key pkpk and a message mm and outputs a ciphertext cc.
  • F1(sk,)F^{-1}(sk,\circ) is a deterministic algorithm that takes as input a secret key sksk and a ciphertext cc and outputs a message mm.

more precisely: (pk,sk)\forall(pk,sk) outputs by GG, xX:F1(sk,F(pk,x))=x\forall x\in X: F^{-1}(sk,F(pk,x))=x.

RSA cryptosystem

RSA cryptosystem 

Setup

  • n=pqn = pq, with pp and qq primes
  • ee relatively prime to φ(n)=(p1)(q1)\varphi(n) = (p-1)(q-1)
  • dd inverse of ee in Zφ(n)\mathbb{Z}_{\varphi(n)}

Keys

  • **Public key:*- KE=(n,e)K_E = (n, e)
  • **Private key:*- KD=dK_D = d

Encryption

  • Plaintext MZnM \in \mathbb{Z}_n
  • C=MemodnC = M^e \bmod n

Decryption

  • M=CdmodnM = C^d \bmod n

Example

Setup

  • p=7, q=17p = 7,\ q = 17
  • n=717=119n = 7\cdot 17 = 119
  • φ(n)=616=96\varphi(n) = 6\cdot 16 = 96
  • e=5e = 5
  • d=77d = 77

Keys

  • **public key:*- (119,5)(119, 5)
  • **private key:*- 7777

Encryption

  • M=19M = 19
  • C=195mod119=66C = 19^5 \bmod 119 = 66

Decryption

  • M=6677mod119=19M = 66^{77} \bmod 119 = 19

RSA cryptosystem: challenge

  • The implementation of the RSA cryptosystem requires various algorithms.

  • Overall

    • Representation of integers of arbitrarily large size and arithmetic operations on them
  • Encryption

    • Modular power
  • Decryption

    • Modular power
  • Setup

    • Generation of random numbers with a given number of bits (to generate candidates pp and qq)
    • Primality testing (to check that candidates pp and qq are prime)
    • Computation of the GCD (to verify that ee and φ(n)\varphi(n) are relatively prime)
    • Computation of the multiplicative inverse (to compute dd from ee)

RSA: basis of security

For all efficient algorithms AA:

Pr ⁣[A(N,e,y)=y1/e]<negligible,\Pr\!\left[ A(N,e,y) = y^{1/e} \right] < \text{negligible},

where p,qp,q \leftarrow nn-bit primes, NpqN \leftarrow pq, and yZNy \leftarrow \mathbb{Z}_N.

Diffie-Hellman key exchange

Based on hardness of “discrete log problem”:

Given pp, gg, y=gx(modp)y=g^x \pmod p, what is xx?

  • Eavesdropper sees: pp, gg, A=ga(modp)A=g^a \pmod p, and B=gb(modp)B=g^b \pmod p.
  • How hard is it to compute gab(modp)g^{ab} \pmod p?
  • More generally: define DHg(ga,gb)=gab(modp)DH_g(g^a, g^b) = g^{ab} \pmod p.

Elliptic Curve Cryptography (ECC)

  • Parameters: curve, modulus, initial point
    • Curve: y2=x3+ax2+bx+cy^2 = x^3 + ax^2 + bx + c
    • Modulus: large prime number
    • Initial point: large (x,y)(x, y)
  • Operations: addition, point doubling, dot (see tutorial)
    • Repeated addition \sim multiplication
    • Point doubling \sim multiplying by 22
    • Repeated point doubling \sim multiplying by powers of 22

Hard problem: analogue of discrete-log problem using elliptic curves in particular geometric space

  • See ArsTechnica tutorial, or many videos online
  • Reversing the dot and point-doubling operators in the finite field defined by the curve and modulus
  • Example: Let the finite field be defined by y2=x3+7(mod31)y^2 = x^3 + 7 \pmod{31} with initial point (x,y)(x, y).
    • Question: Suppose we see a new point (x2,y2)(x_2, y_2) and we know (x2,y2)=n(x,y)(x_2, y_2) = n \cdot (x, y). What is nn?
    • I.e., how many times must we add (x,y)(x, y) to itself to get (x2,y2)(x_2, y_2)?
    • Public key: (x2,y2)(x_2, y_2) and parameters of the ECC system
    • Private key: nn
    • Encryption: embed message as points on the EC, run EC ops on them

Public-key encryption from TDFs

Security Theorem:

  • If (G,F,F1)(G, F, F^{-1}) is a secure trapdoor function (TDF),
  • (Es,Ds)(E_s, D_s) provides authenticated encryption,
  • and H:XKH : X \to K is modeled as a random oracle (RO),

then (G,E,D)(G, E, D) is CCARO_{\text{RO}} secure.

  • That is, it is CCA-secure in the random oracle model.
  • An additional extension is required to obtain full CCA security in the standard model, and such constructions are known.

Summary

Wrapup: symmetric vs. asymmetric systems

  1. Symmetric: faster, but key distribution hard
  2. Asymmetric: slower, but key distribution/management easier
  3. Application: secure web sessions (e.g. online shopping visit)
    1. Use symmetric-key-encrypted sessions
    2. Exchange symmetric keys with asymmetric scheme
    3. Authenticate public keys (using PKI or web of trust)
Last updated on