Some checks failed
Sync from Gitea (main→main, keep workflow) / mirror (push) Has been cancelled
4.4 KiB
4.4 KiB
CSE4303 Introduction to Computer Security (Lecture 13)
Asymmetric Encryption
Public-key building block: Trapdoor function (TDF)
Definition of trapdoor function
A trapdoor function X\to Y is a triple of efficient algorithms (G,F,F^{-1}) such that:
G(\circ)is randomized algorithm outputs a key pair(pk,sk).F(pk,\circ)is a deterministic algorithm that takes as input a public keypkand a messagemand outputs a ciphertextc.F^{-1}(sk,\circ)is a deterministic algorithm that takes as input a secret keyskand a ciphertextcand outputs a messagem.
more precisely: \forall(pk,sk) outputs by G, \forall x\in X: F^{-1}(sk,F(pk,x))=x.
RSA cryptosystem
Setup
n = pq, withpandqprimeserelatively prime to\varphi(n) = (p-1)(q-1)dinverse ofein\mathbb{Z}_{\varphi(n)}
Keys
- **Public key:*-
K_E = (n, e) - **Private key:*-
K_D = d
Encryption
- Plaintext
M \in \mathbb{Z}_n C = M^e \bmod n
Decryption
M = C^d \bmod n
Example
Setup
p = 7,\ q = 17n = 7\cdot 17 = 119\varphi(n) = 6\cdot 16 = 96e = 5d = 77
Keys
- **public key:*-
(119, 5) - **private key:*-
77
Encryption
M = 19C = 19^5 \bmod 119 = 66
Decryption
M = 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
pandq) - Primality testing (to check that candidates
pandqare prime) - Computation of the GCD (to verify that
eand\varphi(n)are relatively prime) - Computation of the multiplicative inverse (to compute
dfrome)
- Generation of random numbers with a given number of bits (to generate candidates
RSA: basis of security
For all efficient algorithms A:
\Pr\!\left[ A(N,e,y) = y^{1/e} \right] < \text{negligible},
where p,q \leftarrow $n$-bit primes, N \leftarrow pq, and y \leftarrow \mathbb{Z}_N.
Diffie-Hellman key exchange
Based on hardness of “discrete log problem”:
Given p, g, y=g^x \pmod p, what is x?
- Eavesdropper sees:
p,g,A=g^a \pmod p, andB=g^b \pmod p. - How hard is it to compute
g^{ab} \pmod p? - More generally: define
DH_g(g^a, g^b) = g^{ab} \pmod p.
Elliptic Curve Cryptography (ECC)
- Parameters: curve, modulus, initial point
- Curve:
y^2 = x^3 + ax^2 + bx + c - Modulus: large prime number
- Initial point: large
(x, y)
- Curve:
- Operations: addition, point doubling, dot (see tutorial)
- Repeated addition
\simmultiplication - Point doubling
\simmultiplying by2 - Repeated point doubling
\simmultiplying by powers of2
- Repeated addition
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
y^2 = x^3 + 7 \pmod{31}with initial point(x, y).- Question: Suppose we see a new point
(x_2, y_2)and we know(x_2, y_2) = n \cdot (x, y). What isn? - I.e., how many times must we add
(x, y)to itself to get(x_2, y_2)? - Public key:
(x_2, y_2)and parameters of the ECC system - Private key:
n - Encryption: embed message as points on the EC, run EC ops on them
- Question: Suppose we see a new point
Public-key encryption from TDFs
Security Theorem:
- If
(G, F, F^{-1})is a secure trapdoor function (TDF), (E_s, D_s)provides authenticated encryption,- and
H : X \to Kis modeled as a random oracle (RO),
then (G, E, D) is CCA$_{\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
- Symmetric: faster, but key distribution hard
- Asymmetric: slower, but key distribution/management easier
- Application: secure web sessions (e.g. online shopping visit)
- Use symmetric-key-encrypted sessions
- Exchange symmetric keys with asymmetric scheme
- Authenticate public keys (using PKI or web of trust)