Crypto 599 Class 8
Crypto 599 Class 8
John Manferdelli
[email protected]
[email protected]
JLM 20081102 2
Reduced Basis
v2 v2
v1| v1|
Reduced Not
JLM 20081102 3
Gauss again
Let <v1 , v2> be a basis for a two dimensional lattice L in R2. The
following algorithm produces a reduced basis.
for(;;) {
if(||v1||||v2||)
swap v1 and v2;
t= [(v1, v2)/(v1, v1)]; // [] is the closest integer function
if(t==0)
return;
v2 = v2-tv1;
}
<v1 , v2> is now a reduced basis and v1 is a shortest vector in the lattice.
JLM 20081102 4
LLL
Note b1*=b1.
JLM 20081102 5
LLL algorithm
b1*= b1; k= 2;
for(i=2; in; i++) {
bi*= bi;
for(j=1; j<i; j++) RED(k, k-1)
{ i,j= (bi , bj*)/Bj;
bi*= bi- i,jbj*;Bi= (bi*, bi*);} if(| k,l|)> 1/2) {
} r= 1/2+ k,l;
for(;;) { bk= bk -r bl;
RED(k, k-1);
for(j=1; j<l;j++) {
if(Bk<(3/4 k,k-12)Bk-1) {
k,j= k,j-r l,j;
= k,k-1; B= Bk+ Bk-1; k,k-1 = Bk-1/B;
k,l = k,l-r;
Bk= Bk-1Bk/B; Bk-1= B; swap(bk, bk-1);
if(k>2) swap(bk, bk-1); }
for(i=k+1; in;i++) }
{ t= i,k;; i,k;= i,k-1-t;
i,k-1=t+ k,k-1 i,k; }
k= max(2, k-1);
if(k>n) return(b1, , bn);
}
JLM 20081102 6
LLL Theorem
JLM 20081102 7
Attack on RSA using LLL
JLM 20081102 8
Attack on RSA using LLL
JLM 20081102 9
Attack on RSA using LLL
p= 757285757575769, q= 2545724696579693.
n= 1927841055428697487157594258917.
B= 200805000114192305180009190000.
c= (B+m)3, 0m<100.
f(x)= (B+x)3-c= x3 + a2x2 + a1x + a0 (mod n).
a2= 602415000342576915540027570000
a1= 1123549124004247469362171467964
a0= 587324114445679876954457927616
v1= (n,0,0,0)
v2= (0,100n,0,0)
v3= (0,0,104n,0)
v4= (a0, a1100, a2104,106)
JLM 20081102 11
Example attack on RSA using LLL
JLM 20081102 12
Elliptic Curves
Motivation:
Full employment act for mathematicians
Elliptic curves over finite fields have an arithmetic operation
Index calculus doesnt work on elliptic curves.
Even for large elliptic curves, field size is relatively modest so
arithmetic is faster
.
Use this operation to define a discrete log problem.
To do this we need to:
Define point addition and multiplication on an elliptic curve
Find an elliptic curve whose arithmetic gives rise to large finite
groups with elements of high order
Figure out how to embed a message in a point multiplication.
Figure out how to pick good curves.
JLM 20081102 13
Rational Points
Bezout
Linear equations
x2+5y2=1
y2=x3-ax-b
Disconnected: y2= 4x3-4x +1
Connected: a= 7, b=-10
Troublesome: a=3, b=-2
Arithmetic
D= 4a3-27b2
Genus, rational point for g>1
Mordell
Zn1 x Zn2, n2|n1, n2|(p-1)
JLM 20081102 14
Equation solving in the rational numbers
Linear case: solve ax+by=c or, find the rational points on the curve C:
f(x,y)= ax+by-c=0.
Clearing the fractions in x and y, this is equivalent to solving the equation in
the integers. Suppose (a,b)=d, there are x, yZ: ax+by=d. If d|c, say
c=dd, a(dx)+b(dy)=dd=c and we have a solution. If d does not divide c,
there isnt any. We can homogenize the equation to get ax+by=cz and
extend this procedure, here, because of z, there is always a solution.
Quadratic (conic) case: solve x2+5y2=1 or find the rational points on the
curve C: g(x,y)= x2+5y2-1=0.
(-1,0)C. Let (x,y) be another rational point and join the two by a line: y=
m(x+1). Note m is rational. Then x2+5(m(x+1))2=1 and (5m2+1) x2 + 2
(5m2)x + (5m2-1)= 0 x2 + 2 [(5m2)/(5m2+1)] x + [(5m2-1)/ (5m2+1) ]= 0.
Completing the square and simplifying we get (x+(5m2)/(5m2+1)) 2= [25m4
(25m4 -1)]/(5m2+1)2= 1/(5m2+1)2. So x= (1-5m2)/(5m2+1) and substituting
in the linear equation, y= (2m)/(5m2+1). These are all the solutions.
Cubic case is more interesting!
JLM 20081102 15
Bezouts Theorem
Let deg(f(x,y,z))=m and deg(g(x,y,z))=n be homogeneous
polynomials over C, the complex numbers and C1 and C2
be the curves in CP2, the projective plane, defined by:
C1 = {(x,y,z): f(x,y,z)=0}; and,
C2 = {(x,y,z): g(x,y,z)=0}.
If f and g have no common components and D=C 1C2, then
xD I(C1C2,x)=mn.
JLM 20081102 16
Elliptic Curve Preliminaries -1
JLM 20050710 17
Elliptic Curve Preliminaries - 2
JLM 20050710 18
Elliptic Curves
A non-singular Elliptic Curve is a curve, having no multiple roots,
satisfying the equation: y2=x3+ax+b.
JLM 20050710 19
Multiple roots
JLM 20081102 20
Elliptic curve addition
The addition operator on a non-singular elliptic curve maps two
points, P and Q, into a third P+Q. Heres how we construct
P+Q when PQ .
Construct straight line through P and Q which hits E at R.
Q
P
P+Q
Graphic by Richard Spillman
JLM 20050710 21
Addition for points P, Q in ER(a, b) - 1
Suppose we want to add two distinct points P and Q lying on the
curve ER(a, b): y2=x3+ax+b, where P=(x1, y1) and Q=(x2, y2) with PQ,
then P+Q=R=(x3, y3).
JLM 20050710 22
Multiples in Elliptic Curves 1
JLM 20081104 23
Addition for points P, Q in ER(a, b) - 2
Case 1, y1y2: In this case, y1=-y2 and the line between P and Q
meet at infinity, this is the point we called O and we get P+Q=O.
Note Q=-P so (x,y)=(x,-y).
JLM 20050710 24
Addition in ER(a, b) - summary
Given two points P and Q lying on the curve ER(a, b): y2=x3+ax+b,
where P=(x1, y1) and Q=(x2, y2) with PQ, then P+Q=R=(x3, y3)
where:
JLM 20050710 25
Point multiplication in ER(a, b)
Example:
The order of P=(2,3) on ER(0,1) is 6.
2P=(0,1), 4P= (0,-1), 6P=O.
JLM 20050710 26
Example of Addition and Element Order
JLM 20050710 27
Proof of group laws
JLM 20081102 28
Associativity
If P and Q are points on an elliptic curve, E, let P*Q denote the third point of
intersection of the line PQ and E.
This proof will seem more natural if youve taken projective geometry. You could
just slog out the algebra though.
JLM 20081102 29
Mordell and Mazur
JLM 20081102 30
Fermats Last Theorem
JLM 20081102 31
Why elliptic curves might be valuable in
crypto
Consider E: y2= x3+17. Let Pn=(An/Bn, Cn/Dn) be a rational point
on E. Define ht(Pn)= max(|An|, |Bn|).
n ht(Pn) n ht(Pn)
1 2 8 76271
2 1 9 9776276
3 4 10 3497742218
4 2 20 8309471981636130322638066614339972215969861310
5 4
6 106 In fact, ht(Pn)1.574ns, ns=n2.
7 2228
Example from Silverman, A Friendly Introduction to Number Theo
JLM 20081102 32
Points on elliptic curves over Fq
The number of points N on Eq(a,b) is the number of solutions of
y2=x3+ax+b.
For each of q xs there are up to 2 square roots plus O, giving a
maximum of 2q+1. However, not every number in Fq has a square
root. In fact, N= q+1+ x(x3+ax+b), where is the quadratic
character of Fq.
Hasses Theorem: |N(q+1)|2q where N is the number of points
Eq(a,b) is supersingular if N= (q+1)-t, t= 0,q, 2q, 3q or 4q.
The abelian group formed by addition in Eq(a,b) does not need to be
cyclic, although it often is; it can always be decomposed into cyclic
groups. In fact, if G is the Elliptic group for Eq(a,b). Theorem: G=p
Z/Zp x Z/Zp.
Example: E71(-1,0). N= 72, G is of type (2,4,9).
JLM 20050710 33
E71(-1, 0) Spot the Group
There are 72 points on the curve. Can you spot (2, 4, 9). Points:
JLM 20081102 34
Addition for points P, Q in Ep(a, b)
1. P+O=P
2. If P=(x, y), then P+(x, -y)=O. The point (x, -y) is the
negative of P, denoted as P.
3. If P=(x1, y1) and Q=(x2, y2) with PQ, then P+Q=(x3,
y3) is determined by the following rules:
x3 =2 x1 x2 (mod p)
y3 =( x1 x3) y1 (mod p)
=(y2-y1)/(x2-x1) (mod p) if PQ
=(3(x1)2+a)/(2y1) (mod p) if P=Q
4. The order of P is the smallest positive number n:
nP=O
JLM 20050710 35
Point multiplication in Ep(a, b)
JLM 20050710 37
Structure of the Elliptic Curve Group
on Ep(a,b) - 1
E11(1, 6)[ y2= x3 + 1 x + 6 (mod 11)]. D: -7, 2 is primitive (mod 11). D=4a3+27b2
(mod p). 13 points on curve; G, cyclic.
Powers
Order Point ( 1) ( 5, 2)
[ 1] O ( 2) (10, -9)
[13] ( 2, 4) ( 3) ( 7, 9)
[13] ( 2, 7) ( 4) ( 3, 5)
[13] ( 3, 5) ( 5) ( 8, 8)
[13] ( 3, 6) ( 6) ( 2, 4)
[13] ( 5, 2) ( 7) ( 2, 7)
[13] ( 5, 9) ( 8) ( 8, 3)
[13] ( 7, 2) ( 9) ( 3, 6)
[13] ( 7, 9) (10) ( 7, 2)
[13] ( 8, 8) (11) (10, 9)
[13] ( 8, 3) (12) ( 5, 9)
[13] (10, 2) (13) O
[13] (10, 9)
JLM 20081102 38
Structure of the Elliptic Curve Group on
Ep(a,b) - 2
E31(1, 6). D: -23, 3 is primitive (31). 32 points on curve. Not cyclic!
Order Point Order Point
[ 1] O [16] (19, 8)
[16] ( 1, 16) [16] (19, 23)
[16] ( 1, 15)
[ 4] (20, 20)
[ 8] ( 2, 27)
[ 4] (20, 11)
[ 8] ( 2, 4)
[16] (21, 9)
[ 4] ( 3, 25)
[16] (21, 22)
[ 4] ( 3, 6)
[16] (24, 20)
[ 2] ( 9, 0)
[16] (24, 11)
[16] (12, 17)
[16] (25, 30)
[16] (12, 14)
[16] (25, 1)
[ 8] (14, 25)
[ 8] (14, 6) [ 2] (26, 0)
[16] (17, 10) [ 2] (27, 0)
[16] (17, 21) [ 8] (28, 10)
[16] (18, 20) [ 8] (28, 21)
[16] (18, 11) [ 8] (30, 29)
[ 8] (30, 2)
JLM 20081102 39
Structure of the Elliptic Curve Group
on Ep(a,b) - 3
Cyclic
E29(0, 17). D: -3, <2> (29). 30 points. G: ( 2,24).
E31(0, 17). D: -11. <3> (31). 43 points. G: ( 1, 24).
E101(0, 17). D: -12. <2> (101). 102, points. G: ( 4, 9).
E311(0, 17). D: -137. <17> (311). 312 points. G: (14, 133).
E29(1, 6). D: -14. <2> (29). 38 points. G: ( 2, 4).
E47(1, 6). D: -12. <5> (47). 52 points. G: ( 0, 10).
E101(1, 6). D: -62. <2> (101). 112 points. G: ( 0, 39).
E1217(0, 17). D: -714. <3> (1217). 1218 points. G: ( 2, 5).
Not cyclic
E31(1, 6). D: -23. <3>(31). 32 points. (1, 6) has order 16.
JLM 20081102 40
Endomorphisms
JLM 20081102 41
Endomorphisms continued
Endomorphism are maps that preserve the addition
operation between an elliptic curve group and itself.
That is (P+Q)= (P) + (Q). We care about
endomorphisms that preserve O: (O)= O. These are
called isogonies.
Let K be a field and K* its algebraic closure. EK(a,b) and EK(a,b) are
isomorphic if r,s,tK, uK*: the transformations (x,y) (x,y) given
by x=u2x+r, y= u3y+su2x+t, take EK(a,b) to EK(a,b).
JLM 20081102 43
The Division Polynomials
#Eq(a,b)= q+1-t
2-[t]+q=0
|t| 2q
JLM 20081102 45
Point counting
JLM 20081102 46
Shanks and Menstre
JLM 20081110 47
Elliptic Curve Discrete Log Problem
JLM 20081120 48
Baby step, giant step
The attack:
1. M=ceiling(n). m=a M+b is the order of P.
2. To find a, b note (Q-[b]P)=[a][M]P.
3. Baby step: Rb= Q-[b]P
4. Giant step: Sa= [a][M]P.
JLM 20081110 49
Special Attacks on discrete log in Eq(a,b)
MOV Attack (Menezes, Okamoto, Vanstone).
Anomolous Attack.
Both work by mapping the ECDLP to the DLP.
Alice and Bob choose a point B that does not need to be secret
B must have a very large order
JLM 20081110 51
Elliptic curve El Gamal
JLM 20081110 52
Embedding m in Eq(a,b)
JLM 20050710 53
Putting it all together: EC El Gamal
Curve: E8831(3,45)
G=(4,11),a=3, A=aG=(413,1808)
b=8, B=bG= (5415, 6321)
P= (5, 1743)
Bob sends Alice:
[B, P+ 8A]= [ (5415,6321), (6626,3576)]
Alice decrypts as:
3 (5415, 6321)= (673, 146)
P= (6626,3576)-(673,146)= (6626,3576)+(673,-146)= (5, 1743)
JLM 20050710 54
Putting it all together: ECDH
Curve: E7311(1,7206)
G=(3,5)
Alice picks a=12 sends aG= (1794,6375)
Bob picks b= 23, sends bG= (3861,1242)
Bob computes 23(1794, 6375)= (1472, 2098)
Alice computes 12 (3861,1242)= (1472, 2098)
JLM 20050710 55
Picking Curves
JLM 20081110 56
Curve selection
JLM 20081110 57
ECC Point Operation Costs and
modular operations
Parameters
I= inverse cost in GF(p).
S= square cost GF(p).
M= multiply cost GF(p)
JLM 20081110 58
ECC vs RSA performance analysis
The number of key bits (for equivalent security) in the DLP case
grows as the cube of the number of bits for the ECDLP case.
This has a key size and performance implication.
JLM 20081110 59
Pollard Rho Method for ECC vs.
Factoring by Number Field Sieve
JLM 20081110 61
NIST Curves
JLM 20091110 62
El Gamal Signature
JLM 20081110 63
Preliminary DSA
JLM 20081110 64
EC El Gamal Signature
JLM 20081110 65
ECDSA
D=(q, a,b,P,n,h). nh= #E q(a,b). Private key d, message m. Signature (r,s)
1. Select k [1,n-1]
2. Compute kP=(x1, y1). Convert x1 to integer 1.
3. Compute r= 1 (mod n). If r=0 goto 1.
4. Compute e=H(m).
5. s= k-1(e+dr) (mod n). If s=0, goto 1.
Verify
1. Check r,s [1,n-1]. Compute e=H(m).
2. Compute w= s-1 (mod n). u1= ew (mod n). u2= rw (mod n).
3. Compute X= u1 P+ u2 Q. If X= O, reject.
4. Convert x1 of X to integer 1. Compute v= 1 (mod n).
5. If (v=r) accept signature.
JLM 20081110 66
ECIES
JLM 20081110 67
Factoring using Elliptic Curves
Let En(a,b) be an elliptic curve with (4a 3+27b2, n)=1 and let P1, P2 be two
rational points whose denominators are prime to n. Then O P1+P2E
has denominators prime to n iff there is no prime p|n such that P 1+P2 =
O (mod p).
JLM 20081009 68
Factoring using elliptic curves - example
Factor n=4453.
Use E: y2 = x3+10x-2 (mod m).
Initial point: P1= (1,3).
2P=(4332, 3230).
To calculate 3P:
m=(3230-3)/(4332-1)=3227/4331.
(4331, 4453)=61.
4453= 61x73.
JLM 20081009 69
Factoring using elliptic curves - example
Factor m=1938796243.
Use E: y2 = x3Ax+A (mod p). A= 1,2,
Initial point: P1= (1,1), Pn+1= (n+1)Pn.
For A=7, (w16,m)= 37409. m= 37409 x 51827.
ai= a(r1 r2 ri), gi=(an-1,m).
JLM 20081009 70
Topics
JLM 20081111 71
End
JLM 20081102 72