Go Back

Public Key Cryptography

Topics

1. Public key encryption scheme

A public key encryption scheme consists of:

2. RSA Scheme

The scheme first introduced by Ron Rivest, Adi Shamir, and Leonard Adleman in 1978, "A Method for Obtaining Digital Signatures and Public-Key Cryptosystems", Communications of the ACM 21 (2):pp. 120-126, 1978.

Key Generation

  1. Choose random primes p and q with log₂p ≈ log₂q ≈ ℓ/2
  2. Compute n = pq and φ(n) = (p-1)(q-1)
  3. Choose e where 1 < e < φ(n) and gcd(e, φ(n)) = 1
  4. Compute d = e⁻¹ mod φ(n)

Encryption/Decryption

Correctness of RSA

Assuming gcd(m,n)=1.

Implementation Challenges

3. Elliptic Curve Cryptography

Ground Concept: Diffie-Hellman Key Exchange

Diffie-Hellman key exchange works in every group.
Key exchange between Alice and Bob:
  1. Pick a group G and an element P in G whose order is large prime q.
  2. Alice: Pick a random x in Z/qZ and send xP to Bob.
  3. Bob: Pick a random y in Z/qZ and send yP to Alice.
  4. Now they both use xyP=y(xP)=x(yP) as their shared key.

Discrete log problem

The Diffie-Hellman key exchange mechanism is thought to be secured (against traditional computers) due to discrete log problem: Given P and aP, find a.

Diffie-Hellman Assumptions

  1. Computational Diffie-Hellman assumption (CDH)
  2. For a,b in Z/pZ and given P, aP and bP, it is computationally infeasible to determine abP.

  3. Decisional Diffie-Hellman assumption (DDH)
  4. For a,b in Z/pZ and given P, aP and bP and either abP or cP for a random c in Z/pZ, it is computationally infeasible to determine whether you were given abP or cP.

  5. Discrete Logarithm assumption (DLOG)
  6. For a in Z/pZ and given P, aP, it is computationally infeasible to determine a.

Key Components

Common Curves

Elgamal Public Key Encryption in Elliptic Curve

4. Security Considerations

Basic comparison between Diffie-Hellman and RSA

RSA Security

ECC Security

Security Levels Comparison

Security (bits) AES Key RSA Key ECC Key
128 128 3072 256
256 256 15360 512

Post-Quantum Considerations