Hardness of RSA: Based on factorization factor (prime number)
Hardness of ECC: Based on discrete logarithm
Motivation for Public Key Algorithm
Problems with Secret Keys (Symmetric Key)
Key Management Issues:
Use lots of keys for n users
Distributing so many keys securely is difficult
Secure storage for the keys
User having n keys cannot memorize them all
Question: Can we have a system with significantly fewer keys?
Answer: Yes!
The 1976 Breakthrough
1976 — Diffie and Hellman introduced Key pairs:⟨Kprivate,Kpublic⟩
Key Management Complexity
Conventional (Symmetric) System
For conventional (symmetric) system, there must be a common key between any pair of users
Thus, a lot of keys must be generated and maintained
There must be 2n(n−1) keys for n users (for possible communication channels)
Analogy: Think of it like a group chat where everyone needs a separate secret language with everyone else. In a group of 10 people, you'd need 45 different secret languages! That's 10×9÷2 = 45 pairs.
Additional keys that must be generated if 1 user is added: increases quadratically
Public Key Cryptography Solution
The Two-Key Idea
Idea: have 2 keys
One key is inverse of the other key
The two keys can be interchanged
D(KPRIV,E(KPUB,P))=D(KPUB,E(KPRIV,P))
Each user owns one private key and shares the corresponding public key with n-1 remaining users
Only 2n keys for n users
Reduce fromO(n2)toO(n)
Analogy: Instead of needing a unique secret language with everyone, you now have one "encoding language" (private) and one "decoding language" (public). Everyone can use your public decoder to talk to you, but only you can encode messages with your private encoder.
Public-Key Cryptosystem
Bob's public key ring contains public keys from Joy, Mike, Ted, and Alice
Encryption process:
Plaintext input → Encryption algorithm (e.g., RSA) using Alice's public key
Transmitted ciphertext sent over network
Decryption algorithm (reverse of encryption algorithm) using Alice's private key
Plaintext output
Key Exchange
To share symmetric key/session key
Key k is generated
Alice needs to share k to Bob (using PKE)
Enc_RSA(k, Bob’s Public Key) = CTk
Dec_RSA(CTk, Bob's Private Key) = k
This is the secure way to share key!
Practical Data Encryption (Hybrid Encryption)
Key sizes (practical)
AES: 128 / 256 bits (symmetric key)
RSA: 2048 bits (1024 is deprecated)
Data Encryption (Alice → Bob)
Key Generation
Alice generates a random symmetric key: kAES←SecureRandom()
Data Encryption (AES)
Alice encrypts the message ( M ) using AES: CTM=EncAES(kAES,M)
Key Encryption (RSA)
Alice encrypts the AES key using Bob’s public key: CTK=EncRSA(PKBob,kAES)
Transmission
Alice sends: (CTK,CTM)
Data Decryption (Bob)
Key Decryption (RSA)
Bob recovers the AES key using his private key: kAES=DecRSA(SKBob,CTK)
Data Decryption (AES)
Bob decrypts the message: M=DecAES(kAES,CTM)
But this way, Bob cannot verify really that the message come from Alice → Digital signature (Later!)
Key Insight (important)
AES encrypts the data
RSA encrypts the AES key
This is called Hybrid Encryption
RSA is slow → encrypt only the key
AES is fast → encrypt the actual data
Public Key Algorithm Requirements
Three Critical Requirements:
Computational Ease: It must be computationally easy to encipher or decipher a message given the appropriate key
Key Derivation Hardness: It must be computationally infeasible to derive KPRIV from KPUB
Chosen Plaintext Security: It must be computationally infeasible to determine KPRIV from a chosen plaintext
Mathematical Foundation
Public Key Cryptosystem Basis
Based on modular arithmetic:
Modular addition
Modular multiplication
Modular exponentiation
They are also based on the fact about prime numbers
Prime Numbers
Definition and Examples
An integer n>1 is called a prime number if its positive divisors are only 1 and n
Ciphertext block size is also smaller than modulus
Slower to compute than AES → mostly used to encrypt a secret key
RSA Key Selection
Key Generation Process
To generate a key pair (one public key and its corresponding private key):
Select large primes, p and q which are almost same size (≈n)
Compute n=pq and ϕ(n)=(p−1)(q−1) (Theorem 3, 5)
Keep p and q with yourself! (เก็บไว้ในใจ)
Mathematical Foundation
Before going to Step 4, understand this:
Suppose x∈Zpq∗, we know that:
x(p−1)(q−1)=1modpq
(Theorem 4)
Choose e that is relatively prime to (p−1)(q−1) and 1<e<(p−1)(q−1)
We know from Theorem 6 that:
∃d,k∈Z; s.t. de−k(p−1)(q−1)=1
Therefore:
de=1+k(p−1)(q−1)
Suppose we have xe where x∈Zpq∗, we can retrieve x from xe by powering it with d then modulo by pq:
xde=x1+k(p−1)(q−1)modpq≡xmodpq
Keep e then find d which is de=1modpq=1modn
Securely delete p and q since we don't need to use them anymore
Send pair of e and n: ⟨e,n⟩ as a public key for encryption
Keep ⟨d,n⟩ as private key for decryption
RSA Key Generation Algorithm
Summary of Key Generation Steps
Generate two large random primes, p and q, of approximately equal size such that their product n=pq is of the required bit length, e.g. 1024 bits
Computen=pq and (phi) ϕ=(p−1)(q−1)
Choose an integere, 1<e<ϕ, such that gcd(e,ϕ)=1
Compute the secret exponentd, 1<d<ϕ, such that ed≡1(modϕ)
→ d=e−1modϕ
The public key is(n,e)and the private key(d,p,q). Keep all the values d, p, q and ϕ secret.
We prefer sometimes to write the private key as (n,d) because you need the value of n when using d. Other times we might write the key pair as ((N,e),d).
Terminology
n is known as the modulus
e is known as the public exponent or encryption exponent or just the exponent
d is known as the secret exponent or decryption exponent
How Hard is RSA?
Security Analysis
We know that RSA uses product of two primes to generate n (suppose p and q)
Since we have to randomly choose e as the encrypt exponent and send ⟨e,n⟩ as the encryption key.
Let the attacker knows ⟨e,n⟩ and he also knows that there is d which gcd(d,e)=1 used for decryption.
However:
It is very hard for attacker to guess what d is used without knowingp and q
(since there are many possible integers which gcd(X,e)=1; d∈X)
Analogy: It's like knowing someone mixed red and blue paint to get purple, but you don't know the exact amounts. Even though you know the result (purple/n) and one method (red/e), figuring out the exact recipe (blue/d) without knowing the original amounts (p and q) is incredibly difficult when the numbers are huge.
Brute force key search (infeasible given size of numbers)
Mathematical attacks (based on difficulty of computing ϕ(n), by factoring modulus n)
Timing attacks (on running of decryption)
Chosen ciphertext attacks (given properties of RSA)
Shor's algorithm on quantum computing can break any cryptographic algorithms which use integer factorization as a hard problem to secure their Pri-key and Pub-key. RSA is included!
Problem: Asymmetric schemes like RSA and Elgamal require exponentiations in integer rings and fields with parameters of more than 1000 bits.
High computational effort on CPUs with 32-bit or 64-bit arithmetic
Large parameter sizes critical for storage on small and embedded devices
The Motivation
Motivation: Smaller field sizes providing equivalent security are desirable
The Solution
Solution: Elliptic Curve Cryptography uses a group of points (instead of integers) for cryptographic schemes with coefficient sizes of 160-256 bits, reducing significantly the computational effort.
Analogy: Instead of working with giant numbers (like RSA's 1024+ bits), ECC works with points on a curve using much smaller numbers (160-256 bits). It's like using a complex 3D map (ECC) instead of a really, really long street address (RSA) - both get you to the destination securely, but one is more compact.
Computations on Elliptic Curves
Weierstraß Equation
Elliptic curves are polynomials that define points based on the (simplified) Weierstraß (VY-er-shtrass) equation: y2=x3+ax+b
for parameters a,b that specify the exact shape of the curve
Curve Characteristics
On the real numbers and with parameters a,b∈R, an elliptic curve looks like the diagram shown (a smooth curve with symmetry about the x-axis)
Elliptic curves can not just be defined over the real numbers R but over many other types of finite fields
Example:y2=x3−3x+3 over R
Finite Field
Definition
A finite field, also known as a Galois field, is a mathematical field that contains a finite number of elements
A field is a set equipped with two operations, addition and multiplication, that satisfy the basic field properties:
Associativity
Commutativity
Distributivity
Existence of identity elements
Inverses
Common Examples
The most common examples of finite fields are given by the integers mod p when p is a prime number.
Computations on Elliptic Curves (continued)
In Cryptography
In cryptography, we are interested in elliptic curves modulo a primep:
Definition: Elliptic Curves over prime fields
The elliptic curve over Zp, p>3 is the set of all pairs (x,y)∈Zp which fulfill y2=x3+ax+bmodp
together with an imaginary point of infinity θ, where a,b∈Zp and the condition 4a3+27b2=0modp Note thatZp={0,1,...,p−1}is a set of integers with modulo p arithmetic
Computations on Elliptic Curves (continued)
Special Considerations
Some special considerations are required to convert elliptic curves into a group of points
In any group, a special element is required to allow for the identity operation, i.e., given P∈E: P+θ=P=θ+P
This identity point (which is not on the curve) is additionally added to the group definition
This (infinite) identity point is denoted byθ
Symmetric = fold paper along horizontal axis
Symmetry Properties
Elliptic Curve are symmetric along the x-axis
Up to two solutionsyand−yexist for each quadratic residuexof the elliptic curve
For each pointP=(x,y), the inverse or negative point is defined as−P=(x,−y)
Analogy: Think of the elliptic curve like a butterfly - it's perfectly symmetric about the x-axis. If you have a point P above the x-axis, its "mirror image" -P is directly below it at the same x-coordinate. The point at infinity θ is like a meeting point where parallel lines meet - an abstract concept that makes the math work.
Computations on Elliptic Curves (continued)
Point Addition Operation
Generating agroup of pointson elliptic curves based on point addition operationP+Q=R, i.e.,(xP,yP)+(xQ,yQ)=(xR,yR)
Geometric Interpretation of Point Addition Operation
Draw straight line through P and Q; if P=Q use tangent line instead
Mirror third intersection point of drawn line with the elliptic curve along the x-axis
Elliptic Curve Point Addition and Doubling Formulas
x3=s2−x1−x2modp and y3=s(x1−x3)−y1modp
where
\frac{y_2 - y_1}{x_2 - x_1} \bmod p & \text{; if } P \neq Q \text{ (point addition)} \\
\frac{3x_1^2 + a}{2y_1} \bmod p & \text{; if } P = Q \text{ (point doubling) } = P + P
\end{cases}$$
https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/ อ่านหน่อย!
___
## Visual Example of Point Addition
Image description from slide 32: Shows geometric representation of point addition P + Q = R on an elliptic curve, where a line L(x) passes through points P, Q, and R
![[Pasted image 20260127134424.png|center|300]]
---
## Example $8^*G$
Image description from slide 33: Visual demonstration of computing 8G through repeated doubling and addition operations on an elliptic curve
![[Pasted image 20260127134527.png|center|300]]
---
## Computations on Elliptic Curves (continued)
### Example Problem
**Example:** Given $E: y^2 = x^3 + 2x + 2 \bmod 17$ and point $P = (5, 1)$
**Goal:** Compute $2P = P + P = (5, 1) + (5, 1) = (x_3, y_3)$
**Solution:**
$$s = \frac{3x_1^2 + a}{2y_1} = (2 \cdot 1)^{-1}(3 \cdot 5^2 + 2) = 2^{-1} \cdot 9 \equiv 9 \cdot 9 \equiv 13 \bmod 17$$
$$x_3 = s^2 - x_1 - x_2 = 13^2 - 5 - 5 = 159 \equiv 6 \bmod 17$$
$$y_3 = s(x_1 - x_3) - y_1 = 13(5 - 6) - 1 = -14 \equiv 3 \bmod 17$$
**Finally:** $2P = (5, 1) + (5, 1) = (6, 3)$
---
## Computations on Elliptic Curves (continued)
### Complete Point Generation Example
**The points on an elliptic curve and the point at infinity** $\theta$ **form cyclic subgroups**
Given starting point $P = (5, 1)$:
| Computation | Result |
|------------|--------|
| $2P = (5,1)+(5,1)$ | $(6,3)$ |
| $3P = 2P+P$ | $(10,6)$ |
| $4P$ | $(3,1)$ |
| $5P$ | $(9,16)$ |
| $6P$ | $(16,13)$ |
| $7P$ | $(0,6)$ |
| $8P$ | $(13,7)$ |
| $9P$ | $(7,6)$ |
| $10P$ | $(7,11)$ |
| Computation | Result |
|------------|--------|
| $11P$ | $(13,10)$ |
| $12P$ | $(0,11)$ |
| $13P$ | $(16,4)$ |
| $14P$ | $(9,1)$ |
| $15P$ | $(3,16)$ |
| $16P$ | $(10,11)$ |
| $17P$ | $(6,14)$ |
| $18P$ | $(5,16)$ |
| $19P$ | $\theta$ |
**This elliptic curve has order** $\#E = |E| = 19$ **since it contains 19 points in its cyclic group.**
> **Analogy:** It's like a clock with 19 hours instead of 12. Starting from point P, you keep "adding hours" (adding P to itself) until you complete the full cycle and return to the starting position (the point at infinity θ).
___
## Number of Points on an Elliptic Curve
### The Question
**How many points can be on an arbitrary elliptic curve?**
- Consider previous example: $E: y^2 = x^3 + 2x + 2 \bmod 17$ has 19 points
- However, determining the point count on elliptic curves in general is hard
### Hasse's Theorem
**But Hasse's theorem bounds the number of points to a restricted interval**
**Definition: Hasse's Theorem:**
Given an elliptic curve module $p$, the number of points on the curve is denoted by $\#E$ and is bounded by
$$\boxed{p + 1 - 2\sqrt{p} \leq \#E \leq p + 1 + 2\sqrt{p}}$$
### Interpretation
- **Interpretation:** ==The number of points is "close to" the prime $p$==
- **Example:** To generate a curve with about $2^{160}$ points, a prime with a length of about 160 bits is required
___
## Elliptic Curve Discrete Logarithm Problem
### Foundation of Security
**Cryptosystems rely on the hardness of the Elliptic Curve Discrete Logarithm Problem (ECDLP)**
**Definition: Elliptic Curve Discrete Logarithm Problem (ECDLP)**
Given a primitive element $P$ and another element $T$ on an elliptic curve $E$. The ECDL problem is finding the integer $d$, where $1 \leq d \leq \#E$ such that
$$\boxed{\underbrace{P + P + ... + P}_{d \text{ times}} = dP = T}$$
### Cryptographic Implications
- **Cryptosystems are based on the idea that** $d$ **is large and kept secret** and attackers cannot compute it easily
- **If** $d$ **is known**, an efficient method to compute the point multiplication $dP$ is required to create a reasonable cryptosystem
- Known **Square-and-Multiply Method** can be adapted to Elliptic Curves
- The method for efficient point multiplication on elliptic curves: **Double-and-Add Algorithm**
> **Analogy:** It's like knowing someone got to the 1000th floor by taking an elevator (the result T), and you know which floor they started on (P), but you don't know which button they pressed (d). Finding d without trying all possibilities is extremely hard when the numbers are large.
___
## Double-and-Add Algorithm for Point Multiplication
### Overview
The **Double-and-Add Algorithm** is a method used for **scalar multiplication** on an elliptic curve.
Given an elliptic curve $E$, a point $P$ on the curve, and a scalar $d$, the algorithm efficiently computes $T = dP$ by iterating through the bits of $d$.
### Algorithm
**Input:**
- Elliptic curve $E$
- Point $P$ on $E$
- Scalar $d$ represented as binary $(d_n, d_{n-1}, ..., d_0)$
**Output:**
- $T = dP$, the scalar multiple of $P$
### Steps:
1. **Initialize** $T = 0$ (the identity element of the elliptic curve)
2. **Loop through bits of** $d$**, starting from the most significant bit (MSB) to the least significant bit (LSB):**
- **Double** $T$ (i.e., compute $T = 2T$)
- **If the bit** $d_i = 1$**, add** $P$ **to** $T$ (i.e., compute $T = T + P$)
3. **Return** $T$
___
## Example of Double-and-Add Algorithm
### Example:
Suppose $d = 13$ and is represented as **(1101)** in binary.
1. **Start with** $T = 0$
2. **Read bits from left to right (MSB first):** $1 \rightarrow 1 \rightarrow 0 \rightarrow 1$
- **Step 1 (bit = 1)** → $T = 0$, double 0 (remains 0), add $P$: $T = P$
- **Step 2 (bit = 1)** → double $P$ $(2P)$, add $P$: $T = 3P$
- **Step 3 (bit = 0)** → double $3P$: $T = 6P$
- **Step 4 (bit = 1)** → double $6P$ $(12P)$, add $P$: $T = 13P$
Thus, the result is $T = 13P$.
---
## Complexity Analysis
### Performance Analysis
- The **number of doublings** is $O(\log d)$ (since $d$ has $\log_2 d$ bits)
- The **number of additions** depends on the number of **1s** in the binary representation of $d$
- The worst-case complexity is $O(\log d)$ for both **doubling** and **addition**
___
## Why is Double-and-Add Efficient?
### Efficiency Reasons
- It **reduces the number of elliptic curve operations**
- Instead of computing $dP$ with repeated additions, it **leverages the binary representation** of $d$ to speed up computations
- Used in cryptographic applications such as **ECDSA**, **ECDH**, and **Elliptic Curve Cryptography (ECC)**
---
## Private Key, Public Key and the Generator Point in ECC
### Key Concepts in ECC
In the **ECC**, when we multiply a fixed EC point **G** (the **generator** point) by certain **integer k** (**k** can be considered as **private key**), we obtain an EC point **P** (its corresponding **public key**).
Consequently, in ECC we have:
- **Elliptic curve (EC)** over finite field $\mathbb{F}_p$
- **G == generator point** (fixed constant, a base point on the EC)
- **k == private key** (integer)
- **P == public key** (point)
### Key Generation
It is **very fast** to calculate $P = k * G$, using the well-known ECC multiplication algorithms in time $log_2(k)$, e.g. the "double-and-add algorithm". For 256-bit curves, it will take just a few hundreds simple EC operations.
>จะ calculate public key ก็แค่เอา private คือ * point ใด point นึงใน curve (CHECK!!)
### Private Key Format
The **private keys** in the ECC are integers (in the range of the curve's field size, typically **256-bit** integers).
Example of 256-bit ECC private key (hex encoded, 32 bytes, 64 hex digits) is:
```
0x51897b64e85c3f714bba707e867914295a1377a7463a9dae8ea6a8b914246319
```
### Key Generation Process
The **key generation** in the ECC cryptography is as simple as securely generating a **random integer** in certain range, so it is extremely fast. Any number within the range is valid ECC private key.
___
## The Elliptic Curve Diffie-Hellman Key Exchange (ECDH)
### Setup
**Given a prime** $p$**, a suitable elliptic curve** $E$ **and a point** $P=(x_P, y_P)$
**The Elliptic Curve Diffie-Hellman Key Exchange is defined by the following protocol:**
### Protocol
**Alice:**
- Choose $k_{PrA} = a \in \{2, 3, ..., \#E-1\}$
- Compute $k_{PubA} = A = aP = (x_A, y_A)$
- Send $A$ →
- Receive ← $B$
- Compute $aB = T_{ab}$
**Bob:**
- Choose $k_{PrB} = b \in \{2, 3, ..., \#E-1\}$
- Compute $k_{PubB} = B = bP = (x_B, y_B)$
- Receive $A$
- Send $B$ →
- Compute $bA = T_{ab}$
### Shared Secret
**Joint secret between Alice and Bob:** $T_{AB} = (x_{AB}, y_{AB})$
**Proof for correctness:**
- Alice computes $aB = a(bP) = abP$
- Bob computes $bA = b(aP) = abP$ since group is associative
>The ECC secret key can be used as a session key for AES encryption.
**One of the coordinates of the point** $T_{AB}$ **(usually the x-coordinate) can be used as session key (often after applying a hash function)**
> **Analogy:** Alice and Bob each have a secret number (a and b). They each multiply a public starting point P by their secret number and share the results. Then they each take what the other shared and multiply by their own secret. Both end up at the same final point - that's their shared secret! It's like two people starting from the same location, taking different paths, but meeting at the same destination.
### ECDH for Symmetric Encryption
**The ECDH is often used to derive session keys for (symmetric) encryption**
**One of the coordinates of the point** $T_{AB}$ **(usually the x-coordinate) is taken as session key**
### Complete Protocol with Encryption
**Alice:**
- Choose $k_{PrA} = a \in \{2, 3, ..., \#E-1\}$
- Compute $k_{PubA} = A = aP = (x_A, y_A)$
- Send $A$ →
- Receive ← $B$
- Compute $aB = T_{ab} = (x_T, y_T)$
- Define key $k_{AES} = x_T$
- Given a message $m$:
- Encrypt $c = AES_{k_{AES}}(m)$
- Send $c$ →
**Bob:**
- Choose $k_{PrB} = b \in \{2, 3, ..., \#E-1\}$
- Compute $k_{PubB} = B = bP = (x_B, y_B)$
- Receive $A$
- Send $B$ →
- Compute $bA = T_{ab} = (x_T, y_T)$
- Define key $k_{AES} = x_T$
- Received ciphertext $c$:
- Decrypt $m = AES^{-1}_{k_{AES}}(c)$
**Stages:**
- **ECDH** (top section)
- **Symmetric encryption/decryption** (bottom section)
---
## ECDH Demo
**Interactive Demo:**
http://www-cs-students.stanford.edu/~tjw/jsbn/ecdh.html
___
## Security Aspects
### Why Smaller Parameters?
**Why are parameters significantly smaller for elliptic curves (160-256 bit) than for RSA (1024-3076 bit)?**
- **Attacks on groups of elliptic curves are weaker** than available factoring algorithms or integer DL attacks
- **Best known attacks** on elliptic curves (chosen according to cryptographic criterions) are the **Baby-Step Giant-Step** and **Pollard-Rho method**
- **Complexity of these methods:** on average, roughly $\sqrt{p}$ steps are required before the ECDLP can be successfully solved
### Implications to Practical Parameter Sizes
**Implications to practical parameter sizes for elliptic curves:**
- An elliptic curve using a prime $p$ with **160 bit** (and roughly $2^{160}$ points) provides a security of $2^{80}$ steps that required by an attacker (on average)
- An elliptic curve using a prime $p$ with **256 bit** (roughly $2^{256}$ points) provides a security of $2^{128}$ steps on average
> **Analogy:** Breaking RSA is like factoring a huge number into two prime factors - hard but getting easier with better algorithms. Breaking ECC is like finding a specific point on a curve by trial and error - the best known method still requires checking roughly the square root of all possibilities, which keeps the problem hard even with smaller numbers.
---
## ECC vs RSA Security Comparison
Image description from slide 48: Shows that 256-bit ECC encryption provides the same security as 3072-bit RSA encryption, illustrated with lock icons
![[Pasted image 20260127140516.png|center|500]]
---
## Key Size Ratio and Cost Ratio for ECC and RSA
### Comparison Table
| ECC Key Size (bits) | RSA Key Size (bits) | Key Size Ratio | Cost Ratio |
|---------------------|---------------------|----------------|------------|
| 160 | 1024 | 1:7 | 1:3 |
| 224 | 2048 | 1:10 | 1:6 |
| 256 | 3072 | 1:12 | 1:10 |
| 384 | 7680 | 1:20 | 1:32 |
| 521 | 15360 | 1:30 | 1:64 |
The table values prove that **ECC can provide same security level of RSA with shorter key length**. The advantage of ECC over RSA is very obvious.
**Reference:** https://www.researchgate.net/publication/305913586
___
## Implementations in Hardware and Software
### Four-Layer Structure
**Elliptic curve computations usually regarded as consisting of four layers:**
![[Pasted image 20260127140535.png|center|250]]
```
┌─────────────────────────────────┐
│ Protocol (ECDSA) │
├─────────────────────────────────┤
│ Point Multiplication (k·P) │
├─────────────────────────────────┤
│ Group Operation P+Q, 2·P │
├─────────────────────────────────┤
│ Modular Arithmetic (+,-,×,÷) │
└─────────────────────────────────┘
```
### Optimization Focus
- **Basic modular arithmetic operations** are computationally most expensive
- **Group operation** implements point doubling and point addition
- **Point multiplication** can be implemented using the Double-and-Add method
- **Upper layer protocols** like ECDH and ECDSA
**Most efforts should go in optimizations of the modular arithmetic operations, such as:**
- Modular addition and subtraction
- Modular multiplication
- Modular inversion
### Software Implementations
![[Pasted image 20260127140642.png|center|200]]
- **Optimized 256-bit ECC implementation** on 3GHz 64-bit CPU requires about **2 ms** per point multiplication
- **Less powerful microprocessors** (e.g., on SmartCards or cell phones) even take significantly longer (**>10 ms**)
### Hardware Implementations
- **High-performance implementations** with 256-bit special primes can compute a point multiplication in a **few hundred microseconds** on reconfigurable hardware
- **Dedicated chips** for ECC can compute a point multiplication even in a **few ten microseconds**
> **Analogy:** Software implementations are like doing complex math by hand - even with a calculator (CPU), it takes time. Hardware implementations are like having a special-purpose machine built just for that calculation - much faster because it's optimized for that specific task.
___
## Lessons Learned
### Key Takeaways
- **Elliptic Curve Cryptography (ECC)** is based on the discrete logarithm problem. It requires, for instance, arithmetic modulo a prime.
- **ECC can be used** for key exchange, for digital signatures and for encryption.
- **ECC provides the same level of security** as RSA or discrete logarithm systems over $Z_p$ with considerably shorter operands (approximately **160–256 bit vs. 1024–3072 bit**), which results in shorter ciphertexts and signatures.
- **In many cases ECC has performance advantages** over other public-key algorithms.
- **ECC is slowly gaining popularity** in applications, compared to other public-key schemes, i.e., many new applications, especially on embedded platforms, make use of elliptic curve cryptography.
---
## Summary: RSA vs ECC
### RSA (Rivest-Shamir-Adleman)
**Security Basis:** Integer factorization (hard to factor large numbers)
**Key Sizes:** 1024-3072 bits for adequate security
**Speed:** Slower than ECC for equivalent security
**Use Cases:**
- Widely deployed and trusted
- Digital signatures
- Key exchange
- Encryption
### ECC (Elliptic Curve Cryptography)
**Security Basis:** Elliptic Curve Discrete Logarithm Problem (ECDLP)
**Key Sizes:** 160-256 bits for equivalent security to RSA
**Speed:** Faster with smaller keys
**Use Cases:**
- Mobile devices and embedded systems
- Modern applications requiring efficiency
- Digital signatures (ECDSA)
- Key exchange (ECDH)
### Quick Comparison
| Feature | RSA | ECC |
|---------|-----|-----|
| Security Level | 128-bit | 128-bit |
| Key Size | 3072 bits | 256 bits |
| Relative Speed | 1× | 10× faster |
| Bandwidth | High | Low |
| Best For | Established systems | Resource-constrained devices |