Docsity

Elliptic Curve Discrete Logarithm Problem and Attacks, Study notes of Advanced Computer Architecture

Partial preview of the text

Download Elliptic Curve Discrete Logarithm Problem and Attacks and more Study notes Advanced Computer Architecture in PDF only on Docsity!

ECC: Security Considerations

Elliptic Curve Discrete Logarithm Problem (EC-DLP)

Consider an elliptic curve E(Fq ) and points P ∈ E(Fq ) and Q ∈ 〈P〉 of order n. Given

Q = l · P,

l ∈ { 0 , 1 ,... , n − 1 } is called the Elliptic Curve Discrete Logarithm (ECDL) of Q to the base P on E(Fq ) (written l = logP Q); the corresponding Elliptic Curve Discrete Logarithm Problem (EC-DLP) is to find l.

Dan Page

ECC: Security Considerations

Elliptic Curve Computational Diffie-Hellman Problem (EC-CDHP)

Consider an elliptic curve E(Fq ) and a point P ∈ E(Fq ) of order n. Given

A = a · P B = b · P

for a, b ∈ { 0 , 1 ,... , n − 1 }, the Elliptic Curve Computational Diffie-Hellman Problem (EC-CDHP) is to compute

C = a · b · P.

I If one could solve EC-DLP instances in 〈P〉, this implies we can solve

EC-CDHP instances in the same group:

1. compute a and b from A, B and P using EC-DLP oracle, then

2. compute C = a · b · P.

I This means EC-CDHP is no harder than EC-DLP; their equivalence isn’t clear

if since we don’t know how to solve EC-DLP given EC-CDHP.

Dan Page

Generic Groups (1): Shoup

I A generic (or black box) group means

1. there is no information about the representation (just that we can uniquely

represent, and distinguish between, elements), and

2. can only apply a generic group operation (via an oracle).

Theorem (Shoup)

In a generic group of prime order n it takes at least O(

n) group operations to solve a DLP instance.

I Of course we can make E(Fq ) generic by “ignoring” any detail we happen to

know about it already ...

I ... but O(

n) is a lower-bound on how hard an EC-DLP instance is on E(Fq )

iff. E(Fq ) really is a generic group (i.e., we’ve not “ignored” something which

might actually help).

Dan Page

Generic Groups (2): Pohlig-Hellman

I Imagine the prime factorisation of n is

rY − 1

i= 0

p

ei

i.

I An attack due to Pohlig and Hellman shows that an EC-DLP instance is only

as hard as EC-DLP in the prime order (i.e., order pi ) subgroups of 〈P〉.

I The basic idea is to solve the congruences

l ≡ l 0 (mod p

e 0

l ≡ l 1 (mod p

e 1

l ≡ lr − 1 (mod p

er − 1

r − 1 )

which the CRT tells us does have a solution.

Dan Page

Generic Groups (4): Pohlig-Hellman

I WTF !?

I Imagine we are computing z 0 and z 1 given pi , ei and the point P 0 ...

Q 0 =

n

pi ·^ Q

n

pi ·^ li^ ·^ P

= li · (

n

pi ·^ P)

= z 0 · (

n

pi ·^ P)

= z 0 · P 0

Q 1 =

n p^2 i

· (Q − z 0 · P)

n p^2 i

· (li − z 0 ) · P

= (li − z 0 ) · (

n p^2 i

· P)

= (z 0 + z 1 · pi − z 0 ) · (

n p^2 i

· P)

= z 1 · (

n

pi ·^ P)

= z 1 · P 0

I ... so basically since z 0 = log

P 0 Q^0 and^ z^1 =^ logP 0 Q^1 , both^ z^0 and^ z^1 can be

computed by solving an EC-DLP instance in the subgroup 〈P 0 〉 of size pi!

I Moral: we demand the order of E(Fq ) has a large prime factor, and work

exclusively in that subgroup from now on.

Dan Page

Generic Groups (5): Pohlig-Hellman

Example

Consider E(F 10589 ) for a 1 = 0, a 2 = 0, a 3 = 0, a 4 = 6895, a 6 = 300 where

|E(F 10589 )| = 10404 = 22 · 32 · 172.

If P = ( 6425 , 2453 ) and Q = ( 6206 , 2039 ), then running the algorithm gives i j P 0 Qj zj 1 (n/ 2 ) · P = ( 0 , 1 ) 1 0 (n/ 21 ) · (Q) = O 0 1 1 (n/ 22 ) · (Q − 0 · 21 · P) = O 0 2 (n/ 3 ) · P = ( 7325 , 2410 ) 2 0 (n/ 31 ) · (Q) = ( 7325 , 8179 ) 2 2 1 (n/ 32 ) · (Q − 2 · 31 · P) = ( 7325 , 8179 ) 2 3 (n/ 17 ) · P = ( 204 , 9562 ) 3 0 (n/ 171 ) · (Q) = ( 7681 , 10469 ) 15 3 1 (n/ 172 ) · (Q − 15 · 171 · P) = ( 7681 , 120 ) 2 before using the CRT to solve l ≡ 0 · 20 + 0 · 21 ≡ 7 (mod 4) l ≡ 2 · 30 + 2 · 31 ≡ 8 (mod 9) l ≡ 15 · 170 + 2 · 171 ≡ 49 (mod 289) which yields l = 9008.

Dan Page

Generic Attacks (2): Trial Multiplication

I One can improve “trial multiplication” using a time-space trade-off due to

Shanks; this is often called the Baby Steps, Giant Steps (BSGS) method.

I Let m = d

ne (n can be upper bound on rather than exact group order); the

basic idea is to write

l = i · m + j

for 0 ≤ i, j < m which means

Q = (i · m + j) · P

i.e.,

Q − (i · m) · P = j · P

I Now we can pre-compute the RHS, and step though LHS until one makes the

equation hold:

1. Make a list of baby steps: pre-compute j · P for 0 ≤ j < m.

2. Take giant steps: compute

Q − (i · m) · P

for i ∈ { 0 , 1 ,.. .} until there is a collision, then compute l = i · m + j.

I Time: O(

n) good, space: O(

n) bad.

Dan Page

Generic Attacks (3): Random Walks

I Imagine you have a finite set S with n elements; define an

F : S → S,

called the iterating function.

I If F is a random (or at least random-ish) function, we can use it to perform a

random walk through S starting at some element X 0 , i.e.,

〈X 0 , X 1 = F (X 0 ), X 2 = F (F (X 0 )), X 3 = F (F (F (X 0 ))),.. .〉

or Xi = F

i

(X 0 ) for i > 0.

I Since S is finite, the random walk will eventually cycle: there must be an i 6 = j

st. Xi = Xj after which we walk through the same elements again.

Dan Page

Generic Attacks (5): Random Walks, Pollard “rho”

I The Pollard “rho” algorithm reduces the memory requirement of BSGS; the

basic idea is to find distinct pairs (c 0 , d 0 ) and (c 1 , d 1 ), where ci and di are

integers modulo n, such that

c 0 · P + d 0 · Q = c 1 · P + d 1 · Q

i.e.,

(c 0 − c 1 ) · P + (d 1 − d 0 ) · Q = l · Q,

and thereby compute

l = (c 0 − c 1 )/(d 1 − d 0 ) (mod n).

I We’ll find this collision using cycle detection, so a crucial component is the

iterating function

F : 〈P〉 → 〈P〉.

I Given X ∈ 〈P〉 and 0 ≤ c, d < n such that X = c · P + d · Q, we want

1. F (X ) = X ′^ = c′^ · P + d′^ · Q to be computationally efficient, and

2. F to behave like a random function.

Dan Page

Generic Attacks (6): Random Walks, Pollard “rho”

I In theory, any sane F should work; here is an example:

I Let {S 0 , S 1 ,... , Sm− 1 } be a partitioning of 〈P〉 into m sets (each of a similar size)

and

H : 〈P〉 → { 0 , 1 ,... , m − 1 }

be a partitioning function; if H(X ) = j then X maps to set Sj.

I If we select 0 ≤ ai , bi < n at random for 0 ≤ i < m, then we can define

F (X ) = X + aj · P + bj · Q

where j = H(X ).

I This is attractive because

1. If we select m as a power-of-two, computing H can be as easy as taking the log 2 m

least-significant bits from the x-coordinate of an input point.

2. If X = c · P + d · Q, then

F (X ) = X ′^ = c′^ · P + d′^ · Q

where

c′^ = c + aj (mod n)

d′^ = d + bj (mod n).

Dan Page

Generic Attacks (8): Random Walks, Pollard “rho”

Algorithm (POLLARD-RHO)

Input : A base point P ∈ E(Fq ) of order n, and Q = l · P for some unknown l Output : The integer 0 ≤ l < n or ⊥ if the algorithm fails

Select m, the number of partitions Select a partitioning function H : E(Fq ) → { 0 , 1 ,... m − 1 } for i = 0 upto m − 1 step 1 do ai

$ ← { 0 , 1 ,... n − 1 }, bi

$ ← { 0 , 1 ,... n − 1 }, Ri ← ai · P + bi · Q end

c 0 ← {^ $ 0 , 1 ,... n − 1 }, d 0 ← {^ $ 0 , 1 ,... n − 1 }, X 0 ← c 0 · P + d 0 · Q c 1 ← c 0 , d 1 ← d 0 , X 1 ← X 0 repeat j ← H(X 0 ), c 0 ← c 0 + aj (mod n), d 0 ← d 0 + bj (mod n), X 0 ← X 0 + Rj for k = 0 upto 1 step 1 do j ← H(X 1 ), c 1 ← c 1 + aj (mod n), d 1 ← d 1 + bj (mod n), X 1 ← X 1 + Rj end until X 0 = X 1 if d 0 = d 1 then return ⊥ else return (c 0 − c 1 )/(d 1 − d 0 ) (mod n)

I We expect a collision after

p

πn/2 steps, i.e., the tail and cycle lengths are

roughly of length

p

πn/ ...

I ... time: O(

n) good, space: O( 1 ) good.

Dan Page

Generic Attacks (9): Random Walks, Pollard “rho”

Example

Consider E(F 181 ) for a 1 = 0, a 2 = 0, a 3 = 0, a 4 = 45, a 6 = 106 where |E(F 181 )| = 194. If P = ( 52 , 8 ) and Q = ( 139 , 87 ), imagine we pre-compute a 0 = 165 b 0 = 141 R 0 = ( 87 , 8 ) a 1 = 21 b 1 = 98 R 1 = ( 10 , 164 ) a 2 = 6 b 2 = 35 R 2 = ( 67 , 85 ) a 3 = 73 b 3 = 40 R 3 = ( 49 , 89 ) and set m = 4. Then, running the algorithm gives j c 0 d 0 X 0 j c 1 d 1 X 1 122 158 ( 61 , 163 ) 122 158 ( 61 , 163 ) 2 143 62 ( 83 , 132 ) 2 143 62 ( 83 , 132 ) 4 22 102 ( 78 , 50 ) 4 22 102 ( 78 , 50 ) 3 28 137 ( 91 , 123 ) 4 101 177 ( 8 , 39 ) 3 28 137 ( 91 , 123 ) 1 72 124 ( 70 , 148 ) 3 78 159 ( 123 , 6 ) 4 101 177 ( 8 , 39 ) 4 151 5 ( 84 , 75 ) 1 122 146 ( 6 , 174 ) 1 72 124 ( 70 , 148 ) 3 128 181 ( 147 , 97 ) 4 7 27 ( 106 , 176 ) 3 78 159 ( 123 , 6 ) 3 13 62 ( 114 , 107 ) 3 19 97 ( 62 , 133 ) 4 151 5 ( 84 , 75 ) 3 25 132 ( 79 , 175 ) 4 98 172 ( 58 , 30 ) 1 122 146 ( 6 , 174 ) 3 104 13 ( 71 , 152 ) 4 177 53 ( 6 , 174 ) before finding that l = ( 122 − 177 )/( 53 − 146 ) (mod 194) = 59.

Dan Page

Generic Attacks (11): Random Walks, van Oorschot-Wiener

I Basically, the following describes what is going on:

Xt

Xt+ (^1) Θ

Time C 0 C 1 C 2 C 3

I Note that:

I Each of the clients executes Pollard rho; the parallelisation permits their sequences

to collide with each other, not just “internally” ...

I ... there is a collision between points computed by C 2 and C 3 , but a “lag” before the

server notices.

Dan Page

Generic Attacks (12): Random Walks, van Oorschot-Wiener

Algorithm (PARALLEL-POLLARD-RHO)

Input : A base point P ∈ E(Fq ) of order n, and Q = l · P for some unknown l Output : The integer 0 ≤ l < n or ⊥ if the algorithm fails

Select m, the number of partitions Select a partitioning function H : E(Fq ) → { 0 , 1 ,... m − 1 } Select a distinguishing function D : E(Fq ) → { true , false } for i = 0 upto m − 1 step 1 do

ai

$ ← { 0 , 1 ,... n − 1 }, bi

$ ← { 0 , 1 ,... n − 1 }, Ri ← ai · P + bi · Q end foreach client do c ← {$ 0 , 1 ,... n − 1 }, d ← {$ 0 , 1 ,... n − 1 }, X ← c · P + d · Q repeat j ← H(X ) c ← c + aj (mod n), d ← d + bj (mod n), X ← X + Rj if D(X ) = true then send (c, d, X ) to the sever until server receives some distinguished point twice end Let the two distinguished point tuples be (c 0 , d 0 , X 0 ) and (c 1 , d 1 , X 1 ). if d 0 = d 1 then return ⊥ else return (c 0 − c 1 )/(d 1 − d 0 ) (mod n)

I Now we expect a collision after

πn/ 2

|C| steps; some 1/Θ^ steps later this is

detected via a distinguished point ...

I ... time: O(

n

|C| +^

Θ )^ good, space:^ O(Θ)

n good.

Dan Page