Full search
It is the simplest attack in the implementation. It is only necessary to be able to do the operation R = [k] P.
Algorithm
- {\ displaystyle k: = 1}
- {\ displaystyle R: = [k] P}
- if {\ displaystyle R = Q} , then {\ displaystyle k} - decision
- else {\ displaystyle k: = k + 1} ; go to [2].
Algorithm complexity: Ο (N).
Polyg - Hellman Algorithm
Description
Let G be a subgroup of E (F p ), {\ displaystyle N = | G | = \ prod _ {i = 1} ^ {t} {p_ {i}} ^ {e ^ {i}}} (i.e. it is assumed that the number N can be factorized) {\ displaystyle P, Q \ in G} and {\ displaystyle \ exists k: Q = [k] P} .
We will solve the problem of finding k modulo {\ displaystyle {p_ {i}} ^ {e_ {i}}} , then, using the Chinese remainder theorem , we find a solution k modulo N.
From group theory it is known that there is an isomorphism of groups:
- {\ displaystyle \ phi: G \ rightarrow C _ {{p_ {1}} ^ {e_ {1}}} \ otimes ... \ otimes C _ {{p_ {t}} ^ {e_ {t}}}}
Where {\ displaystyle C _ {{p_ {i}} ^ {e_ {i}}}} Is a cyclic subgroup G, {\ displaystyle | C _ {{p_ {i}} ^ {e_ {i}}} | = {p_ {i}} ^ {e_ {i}}}
Then projection {\ displaystyle \ phi} on {\ displaystyle C_ {p ^ {e}}} :
- {\ displaystyle \ phi _ {p} = {\ begin {cases} G \ rightarrow C_ {p ^ {e}} \\ R \ longmapsto [{\ frac {N} {p ^ {e}}}] R \ end {cases}}}
Consequently, {\ displaystyle {\ phi _ {p}} (Q) = [k] {\ phi _ {p}} (P)} at {\ displaystyle C_ {p ^ {e}}} .
We show how to solve the problem in {\ displaystyle C_ {p ^ {e}}} reducing it to an ECDLP solution in {\ displaystyle C_ {p}} .
Let be {\ displaystyle P, Q \ in C_ {p ^ {e}}} and {\ displaystyle \ exists k: Q = [k] P} .
Number {\ displaystyle k} defined modulo {\ displaystyle p ^ {e}} . Then we can write k in the following form:
- {\ displaystyle k = k_ {0} + {k_ {1}} p + ... + {k_ {e-1}} p ^ {e-1}}
Find the values {\ displaystyle k_ {0}, k_ {1}, ...} by induction. Suppose known {\ displaystyle k '} - value {\ displaystyle k \ mod \ p ^ {t}} , i.e
- {\ displaystyle k '= k_ {0} + ... + k_ {t-1} p ^ {t-1}}
Now we want to define {\ displaystyle k_ {t}} and thus calculate {\ displaystyle k \ mod \ p ^ {t + 1}} :
- {\ displaystyle k = k '+ p ^ {t} k' '}
Then {\ displaystyle Q = [k '] P + [k' '] ([p ^ {t}] P)} .
Let be {\ displaystyle Q '= Q- [k'] P} and {\ displaystyle P '= [p ^ {t}] P} then {\ displaystyle Q '= [k' '] P'}
Now {\ displaystyle P '} - element of order {\ displaystyle p ^ {et}} to get an order element {\ displaystyle p} and therefore reduce the problem to {\ displaystyle C_ {p}} you must multiply the previous expression by {\ displaystyle s = p ^ {et-1}} . T.O.
- {\ displaystyle Q '' = [s] Q '} and {\ displaystyle P '' = [s] P '}
Got ECDLP in the box {\ displaystyle C_ {p}} as {\ displaystyle Q '' = [k_ {t}] P ''} .
Assuming that this problem can be solved in {\ displaystyle C_ {p}} find a solution {\ displaystyle k} at {\ displaystyle C_ {p ^ {e}}} . Using the Chinese remainder theorem, we obtain an ECDLP solution in {\ displaystyle E (F_ {p})} .
As mentioned above, in practice, elliptic curves are taken such that {\ displaystyle N = hl} where {\ displaystyle l} - a very large prime number, which makes this method ineffective.
Example
{\ displaystyle Q = [k] P \ (mod \ 1009)}
{\ displaystyle E: y ^ {2} \ equiv x ^ {3} + 71x + 602 \ (mod \ 1009)}
{\ displaystyle P = (1,237), Q = (190,271)}
{\ displaystyle N = 1060 = 2 ^ {2} * 5 * 53}
{\ displaystyle | \ langle P \ rangle | = 530 = 2 * 5 * 53}
Step 1. Find {\ displaystyle k \ mod \ 2}
- Find the projections of points on {\ displaystyle C_ {2}} :
- {\ displaystyle P_ {2} = 265P = (50.0)}
- {\ displaystyle Q_ {2} = 265Q = (50.0)}
- Decide {\ displaystyle Q_ {2} = [k] P_ {2}}
- {\ displaystyle k \ equiv 1 \ (mod \ 2)}
Step 2. Find {\ displaystyle k \ mod \ 5}
- Find the projections of points on {\ displaystyle C_ {5}} :
- {\ displaystyle P_ {5} = 106P = (639,160)}
- {\ displaystyle Q_ {5} = 106Q = (639,849)}
- Decide {\ displaystyle Q_ {5} = [k] P_ {5}}
- notice, that {\ displaystyle Q_ {5} = - P_ {5}} then {\ displaystyle k \ equiv 4 \ (mod \ 5)}
Step 3. Find {\ displaystyle k \ mod \ 53}
- Find the projections of points on {\ displaystyle C_ {53}} :
- {\ displaystyle P_ {53} = 10P = (32,737)}
- {\ displaystyle Q_ {53} = 10Q = (592.97)}
- Decide {\ displaystyle Q_ {53} = [k] P_ {53}}
- {\ displaystyle k \ equiv 48 \ (mod \ 53)}
Step 4. Find {\ displaystyle k \ mod \ 530}
- From the Chinese remainder theorem for the values obtained in the previous steps 1-3, we have that
- {\ displaystyle k \ equiv 419 \ (mod \ 530)}
Shanks Algorithm (Baby-Step / Giant-Step method)
Description
Let be {\ displaystyle G = \ langle P \ rangle} - cyclic subgroup {\ displaystyle E (F_ {p}); | \ langle P \ rangle | = l; Q \ in G} .
Imagine {\ displaystyle k} as:
- {\ displaystyle k = k_ {0} + k_ {1} \ lceil {\ sqrt {l}} \ rceil}
Because {\ displaystyle k \ leq l} then {\ displaystyle 0 \ leq k_ {0}, k_ {1} <\ lceil {\ sqrt {l}} \ rceil} .
We calculate the list of "small steps" {\ displaystyle P_ {i} = [i] P} , {\ displaystyle 0 \ leq i <\ lceil {\ sqrt {l}} \ rceil} and save the pairs {\ displaystyle (P_ {i}, i)} .
Computational complexity: {\ displaystyle O (\ lceil {\ sqrt {l}} \ rceil)} .
Now we calculate the "big steps". Let be {\ displaystyle P '= [\ lceil {\ sqrt {l}} \ rceil] P} we find {\ displaystyle Q_ {j} = Q- [j] P '} , {\ displaystyle 0 \ leq j <\ lceil {\ sqrt {l}} \ rceil} .
During search {\ displaystyle Q_ {j}} try to find find among saved pairs {\ displaystyle (P_ {i}, i)} such that {\ displaystyle P_ {i} = Q_ {j}} . If you managed to find such a pair, then {\ displaystyle k_ {0} = i, k_ {1} = j} .
Or, the same thing:
- {\ displaystyle [i] P = Q- [j \ lceil {\ sqrt {l}} \ rceil] P,}
- {\ displaystyle [i + j \ lceil {\ sqrt {l}} \ rceil] P = Q} .
The complexity of computing "big steps": {\ displaystyle O (\ lceil {\ sqrt {l}} \ rceil)} .
In this case, the overall complexity of the method {\ displaystyle O ({\ sqrt {l}})} but also required {\ displaystyle S ({\ sqrt {l}})} memory for storage, which is a significant minus of the algorithm.
Algorithm
- {\ displaystyle m: = \ lceil {\ sqrt {l}} \ rceil}
- {\ displaystyle \ mathbf {for} \ i: = 1 \ \ mathbf {to} \ m \ \ mathbf {do}}
- {\ displaystyle R: = [i] P}
- save {\ displaystyle (R, i)}
- {\ displaystyle \ mathbf {for} \ j: = 1 \ \ mathbf {to} \ m \ \ mathbf {do}}
- {\ displaystyle T: = Q- [j \ lceil {\ sqrt {l}} \ rceil] P}
- check {\ displaystyle T} in the list [2]
- {\ displaystyle \ mathbf {if} \ T = R \ \ mathbf {then}}
- {\ displaystyle k: = i + j \ lceil {\ sqrt {l}} \ rceil \ (mod \ l)}
- {\ displaystyle \ mathbf {return} \ k}
Pollard ρ-method
Description
Let be {\ displaystyle G = \ langle P \ rangle} - cyclic subgroup {\ displaystyle E (F_ {p}); | G | = r; Q \ in G} .
The main idea of the method is to find different pairs {\ displaystyle (c ', d')} and {\ displaystyle (c``, d '')} modulo {\ displaystyle r} such that {\ displaystyle [c '] P + [d'] Q = [c ''] P + [d ''] Q} .
Then {\ displaystyle [c'-c ''] P = [d '' - d '] Q} or {\ displaystyle Q = {\ frac {c'-c ''} {d '' - d '}} P \ (mod \ r)} . Consequently, {\ displaystyle k \ equiv {\ frac {c'-c ''} {d '' - d '}} \ (mod \ r)} .
To implement this idea, we choose a random function for iterations {\ displaystyle f: G \ rightarrow G} , and a random point {\ displaystyle P_ {0}} to start the crawl. The next point is calculated as {\ displaystyle P_ {i + 1} = f (P_ {i})} .
Because {\ displaystyle G} - finite, then there are such indices {\ displaystyle i <j} , what {\ displaystyle P_ {i} = P_ {j}} .
Then {\ displaystyle P_ {i + 1} = f (P_ {i}) = f (P_ {j}) = P_ {j + 1}} .
In fact {\ displaystyle P_ {i + l} = P_ {j + l}} for {\ displaystyle \ forall l \ geq 0} .
Then the sequence {\ displaystyle \ {P_ {i} \}} - periodic with a period {\ displaystyle ji} (see pic).
Since f is a random function, according to the birthday paradox , coincidence will happen in about {\ displaystyle {\ sqrt {\ frac {\ pi r} {2}}}} iterations. To speed up the search for collisions, the method invented by Floyd to search for the cycle length is used: a pair of values is calculated immediately {\ displaystyle (P_ {i}, P_ {2i})} for {\ displaystyle i = 1,2, ...} until there is a match.
Algorithm
- Initialization.
- Choose the number of branches L (usually 16)
- Select function {\ displaystyle H: \ langle P \ rangle \ rightarrow {1,2, ..., L}}
- Calculation {\ displaystyle [a_ {i}] P + [b_ {i}] Q} .
- {\ displaystyle \ mathbf {for} \ i: = 1 \ \ mathbf {to} \ L \ \ mathbf {do}}
- Take random {\ displaystyle a_ {i}, b_ {i} \ in [0, r-1]}
- {\ displaystyle R_ {i}: = [a_ {i}] P + [b_ {i}] Q}
- Calculation {\ displaystyle [c '] P + [d'] Q} .
- Take random {\ displaystyle c ', d' \ in [0, r-1]}
- {\ displaystyle X ': = [c'] P + [d '] Q}
- Preparing for the cycle.
- {\ displaystyle X '': = X ', c' ': = c', d '': = d '}
- Cycle.
- {\ displaystyle \ mathbf {repeat}}
- {\ displaystyle j: = H (X ')}
- {\ displaystyle X ': = X' + R_ {j}}
- {\ displaystyle c ': = c' + a_ {j} \ (mod \ r)}
- {\ displaystyle d ': = d' + b_ {j} \ (mod \ r)}
- {\ displaystyle \ mathbf {for} \ i: = 1 \ \ mathbf {to} \ 2 \ \ mathbf {do}}
- {\ displaystyle j: = H (X '')}
- {\ displaystyle X '': = X '' + R_ {j}}
- {\ displaystyle c '': = c '' + a_ {j} \ (mod \ r)}
- {\ displaystyle d``: = d '' + b_ {j} \ (mod \ r)}
- {\ displaystyle \ mathbf {until} \ X '= X' '}
- Output.
- {\ displaystyle \ mathbf {if} d '\ neq d' '\ \ mathbf {then}}
- {\ displaystyle k \ equiv {\ frac {c'-c ''} {d '' - d '}} \ (mod \ r)}
- {\ displaystyle \ mathbf {else}} ERROR or run the algorithm again.
Algorithm Complexity: {\ displaystyle O ({\ sqrt {r}})} .
Example
{\ displaystyle Q = [k] P \ (mod \ 229)}
{\ displaystyle E: y ^ {2} \ equiv x ^ {3} + x + 44 \ (mod \ 229)}
{\ displaystyle P = (5,116), Q = (155,166)}
{\ displaystyle | \ langle P \ rangle | = 239}
Step 1. Define the function.
- {\ displaystyle H: \ langle P \ rangle \ rightarrow {1,2,3,4}}
- {\ displaystyle H (x, y) = (x \ mod \ 4) +1}
- {\ displaystyle (a_ {1}, b_ {1}, R_ {1}) = (79,163, (135,117))}
- {\ displaystyle (a_ {2}, b_ {2}, R_ {2}) = (206.19, (96.97))}
- {\ displaystyle (a_ {3}, b_ {3}, R_ {3}) = (87.109, (84.62))}
- {\ displaystyle (a_ {4}, b_ {4}, R_ {4}) = (219.68, (72,134))}
Step 2. Iterations.
{\ displaystyle {\ begin {array} {c | ccc | ccc} Iteration & c '& d' & [c '] P + [d'] Q & c '' & d '' & [c ''] P + [d ''] Q \ \\ hline 0 & 54 & 175 & (39,159) & 54 & 175 & (39,159) \\ 1 & 34 & 4 & (160,9) & 113 & 167 & (130,182) \\ 2 & 113 & 167 & (130,182) & 180 & 105 & (36,97) \\ 3 & 200 & 37 & (27,17) & 0 & 97 & (108,89) \ \ 4 & 180 & 105 & (36.97) & 46 & 40 & (223,153) \\ 5 & 20 & 29 & (119,180) & 232 & 127 & (167,57) \\ 6 & 0 & 97 & (108,89) & 192 & 24 & (57,105) \\ 7 & 79 & 21 & (81,168) & 139 & 111 & (185,227) \\ 8 ) & 193 & 0 & (197.92) \\ 9 & 26 & 108 & (9,18) & 140 & 87 & (194,145) \\ 10 & 232 & 127 & (167.57) & 67 & 120 & (223,153) \\ 11 & 212 & 195 & (75,136) & 14 & 207 & (167,57) \\ 12 & 192 & 24 & \ m 57,105)} & 213 & 104 & \ mathbf {(57,105)} \\\ end {array}}}
Step 3. Collision Detection.
- At {\ displaystyle i = 12} : {\ displaystyle [192] P + [24] Q = [213] P + [104] Q = (57,105)}
- We get that {\ displaystyle k \ equiv {\ frac {192-213} {104-24}} \ equiv 176 \ (mod \ 229)}