Computer Security Elliptic Curve Cryptosystems Reference http users

  • Slides: 47
Download presentation
Computer Security Elliptic Curve Cryptosystems Reference : http: //users. monash. edu. au/~pdle/ Howon Kim

Computer Security Elliptic Curve Cryptosystems Reference : http: //users. monash. edu. au/~pdle/ Howon Kim 2019. 5

Agenda n Background q q n Group Field Principle of public key systems q

Agenda n Background q q n Group Field Principle of public key systems q Discrete Logarithm Problem (DLP) n Elliptic Curve Cryptography n ECC in practice 2

Group n Definition: a set S together with a binary operation defined on S

Group n Definition: a set S together with a binary operation defined on S is a group if following properties: satisfies the - Closure: - Identity: - Associativity: - Inverses: For each If a group S satisfies the commutative law the group is said to be Abelian. 3

Field n Definition: a set F with two operations (+, *) defined on it

Field n Definition: a set F with two operations (+, *) defined on it is a field if it satisfies the following criteria: - (F; +) is an Abelian group; - (F ₩ {0}, *) is an Abelian group, where {0} is the identity of addition and zero of multiplication; - distributive: x; y; z F x * (y + z) = x * y + x* z (x + y) * z = x * z + y * z 4

Elliptic Curve Cryptography (ECC) n n n Security of popular RSA is provided by

Elliptic Curve Cryptography (ECC) n n n Security of popular RSA is provided by the intractability of the discrete logarithm problem (DLP) or integer factoring problem (IFP) To ensure security of RSA-based systems, current key sizes must be a minimum of 1024 bits. As computing power increases, larger key sizes will be needed to guarantee security of such systems. This will result in q q q higher computational costs more space requirement for keys reduction in scalability 5

Elliptic curve cryptosystem (ECC) n Why ECC? q There are other public key cryptographic

Elliptic curve cryptosystem (ECC) n Why ECC? q There are other public key cryptographic systems. However, we choose to study ECC because n n The sub-exponential algorithm of breaking ECC has not been found, that is : ECC is not less secure than RSA or some other public key crypto algorithms. ECC with smaller key size can achieve the same security as RSA or some other crypto algorithms. Hence ECC is more efficient for secure wireless applications. High scalability. More potential due to EC theory (rich theory with many alternatives). 6

Elliptic curve cryptosystem (ECC) Example algorithm DLP key size for equivalent security (p in

Elliptic curve cryptosystem (ECC) Example algorithm DLP key size for equivalent security (p in bits) RSA key size for equivalent security (n in bits) ECC key size for equivalent security (n in bits) Key size ratio of RSA to ECC (approx) 56 - 512 112 5: 1 80 SKIPJACK 22 1024 160 6: 1 112 Triple DES 2048 224 9: 1 128 AES-128 3072 256 12: 1 192 AES-192 7680 384 20: 1 256 AES-256 15360 512 30: 1 Symmetric key size (in bits) 7

RSA and ECC challenges Year Number of decimal digits Numb er of bits MIPS

RSA and ECC challenges Year Number of decimal digits Numb er of bits MIPS Years 1994 129 429 5000 1995 119 395 250 1996 130 432 750 1999 140 466 2000 1999 155 512 8000 Calendar Time to Solution 8 months, using 1600 computers Method (year method developed) Quadratic Sieve (1984) General Number Field Sieve (1989) 3. 7 months General Number Field Sieve (1989) Progress in Integer Factorisation (Certicom 1997) 8

RSA and ECC challenges n RSA Security organisation sponsors a challenge for solving the

RSA and ECC challenges n RSA Security organisation sponsors a challenge for solving the integer factorisation problem IFP or DLP (to break RSA), while Certicom corporation sponsors a challenge for solving the EC DLP (to break ECC) Date Solved Bits Details MIPS Years September, 1999 97 740 computers, 130 billion EC operations. 16, 000 April, 2000 108 9, 500 computers. ≈ 400, 000 November, 2002 109 10, 000 computers for 549 days. - Progress in solving ECDLP Certicom (2002) 9

Discrete Logarithm Problem (DLP) n For a group G, Given group elements, find an

Discrete Logarithm Problem (DLP) n For a group G, Given group elements, find an integer x such that x is called the discrete log of to the base . - It is easy to compute - It is hard to find x, knowing and 10

DLP - Example n n n If ab = c, then logac = b

DLP - Example n n n If ab = c, then logac = b Example: 3 q 2 = 8 log 8 = 3 2 3 q 10 = 1000 log 1000 = 3 10 Computing ab and logac are both easy for real numbers. However, when working with field such as (Zp, mod), it is easy to calculate c = ab mod p, but given c, a and p it is very difficult to find b. Given an integer n it is hard to find two integers p, q such that n = p • q (factorisation problem as in RSA) 11

Real Elliptic Curves n An elliptic curve is defined by an equation in two

Real Elliptic Curves n An elliptic curve is defined by an equation in two variables x & y, with coefficients: q n y 2 + axy + by = x 3 + cx 2 + dx + e (general form) Consider a cubic elliptic curve of form q y 2 = x 3 + ax + b; where x, y, a, b are all real numbers. Eg. n n y 2 = x 3 + x + 1. y 2 = x 3 + 2 x + 6. 12

General form of Elliptic Curves n An elliptic curve is a plane curve defined

General form of Elliptic Curves n An elliptic curve is a plane curve defined by an equation of the form Examples 13

Weierstrass Equation n n A two variable equation F(x, y)=0, forms a curve in

Weierstrass Equation n n A two variable equation F(x, y)=0, forms a curve in the plane. We are seeking geometric arithmetic methods to find solutions Generalized Weierstrass Equation of elliptic curves: Here, A, B, x and y all belong to a field of say rational numbers, complex numbers, finite fields (Fp) or Galois Fields (GF(2 n)). 14

Example of EC 15

Example of EC 15

Elliptic curve over real number n Let’s consider the equation: y 2 = x

Elliptic curve over real number n Let’s consider the equation: y 2 = x 3 + ax + b, where x, y, a and b are real numbers, where 4 a 3 + 27 b 2 0 – condition for distinct single roots 판별식 (smooth curve). (Discriminant) n All (x, y) points satisfying above equation along with a infinite point O and addition operation (+), form a group. O and (+) are defined in the next slide. O is the identity of the group. 16

Elliptic curve over real number n If 4 a 3 + 27 b 2

Elliptic curve over real number n If 4 a 3 + 27 b 2 = 0, then it has single root ! (plot of the y 2 = x 3 ) 17

EC over a group (G, +) – E(G, +) An EC over a group

EC over a group (G, +) – E(G, +) An EC over a group (G, +) is defined with the following: 1. Addition: If P and Q are distinct, and P -Q, define P+Q as follows: q Draw a line through P and Q, then the line will intersect with the curve, the intersected point is denoted as –R, and define P+Q=R. 2. For every P, define P + (-P) = O 3. If P=(x, 0), then P+P = O , (a vertical line) Otherwise, draw a tangent line through P, the intersected point is defined as –R, then P+P =2 P =R. 18

Definition of P+Q = R 19

Definition of P+Q = R 19

Definition of P+(-P) 20

Definition of P+(-P) 20

Definition of P+P (where y!=0) 21

Definition of P+P (where y!=0) 21

Definition of P+P (where y=0) 22

Definition of P+P (where y=0) 22

Elliptic Curve : An Algebraic Approach 1. Adding distinct points P and Q (1)

Elliptic Curve : An Algebraic Approach 1. Adding distinct points P and Q (1) When P = (x. P, y. P) and Q = (x. Q, y. Q) and P Q, P -Q, P + Q = R(x. R, y. R) with x. R = s 2 - x. P - x. Q and y. R = s(x. P - x. R) - y. P where s = (y. P - y. Q) / (x. P - x. Q) 2. Doubling the point P (2) When y. P is not O, 2 P = R(x. R, y. R) with x. R = s 2 - 2 x. P and y. R = s(x. P - x. R) -y. P where s = (3 x. P 2 + a) / (2 y. P ) 3. P + (-P) =O (3) 4. If P = (x. P, y. P) and y. P =0, then P + P = 2 P = O (4) 23

Elliptic Curve : An Algebraic Approach n n n Let P(x 1, y 1),

Elliptic Curve : An Algebraic Approach n n n Let P(x 1, y 1), Q(x 2, y 2), R(x 3, y 3)=P+Q are on the EC We can represent the R(=P+Q) using the P, Q. Also, the following holds. In the case of q q q The gradient of line (k) PQ is So the equation of the line PQ is We apply this equation to the EC equation: Then we get Also we get 24

Elliptic Curve : An Algebraic Approach n n n In the equation, we know

Elliptic Curve : An Algebraic Approach n n n In the equation, we know the P are the roots of the equation. , Q So we can think three roots ( following conditions: ) satisfy the Now we the q The case of P!=Q can be expressed as follows: 25

Elliptic Curve : An Algebraic Approach n There another equations for the case of

Elliptic Curve : An Algebraic Approach n There another equations for the case of P = Q. etc. 26

Finite Elliptic Curves on discrete Fields n n Cryptography works with finite field and

Finite Elliptic Curves on discrete Fields n n Cryptography works with finite field and Elliptic curve cryptography uses curves whose variables and coefficients are finite There are two commonly used ECC families: q prime curves Ep(a, b) defined over Zp n n q use modulo with a prime number p efficient in software binary curves E 2 m(a, b) defined over GF(2 n) n n use polynomials with binary coefficients efficient in hardware 27

Elliptic Curve Groups over Zp n (Zp, mod) = {0, 1, …, p-1} is

Elliptic Curve Groups over Zp n (Zp, mod) = {0, 1, …, p-1} is a group q n Where p is a prime number Define the elliptic curve y 2 = x 3 + ax + b mod p q Where a and b are in Zp, and x, y are also in Zp. 3 2 q (4 a + 27 b (mod p)) 0. q 28

EC over (Zp, mod)- examples n p=11, Zp=Z 11. y 2 = x 3

EC over (Zp, mod)- examples n p=11, Zp=Z 11. y 2 = x 3 + x + 6 (mod 11) q n p=23, Zp=Z 23. y 2 = x 3 + x (mod 23) q n E(Z 11, mod) = {(2, 4), (2, 7), (3, 5), (3, 6), (5, 2), (5, 9), (7, 2), (7, 9), (8, 3), (8, 8), (10, 2), (10, 9)} E(Z 23, mod) = {(0, 0), (1, 5), (1, 18), (9, 5), (9, 18), (11, 10), (11, 13), (13, 5), (13, 18), (15, 3), (15, 20), (16, 8), (16, 15), (17, 10), (17, 13), (18, 10), (18, 13) (19, 1), (19, 22), (20, 4), (20, 19), (21, 6), (21, 17)} p=23, Zp=Z 23. y 2 = x 3 + x + 1 (mod 23) q E(Z 23, mod) = { (0, 1), (0, 22), (1, 7), (1, 16), (3, 10), (3, 13), (4, 0), (5, 4), (5, 19), (6, 4), (6, 19), (7, 11), (7, 12), (9, 7), (9, 16), (11, 3), (11, 20), (12, 4), (12, 19), (13, 7), (13, 16), (17, 3), (17, 20), (18, 3), (18, 20), (19, 5), (19, 18)} 29

y 2 = x 3 + x mod 23 30

y 2 = x 3 + x mod 23 30

Operations on E(Z 11, mod) n Consider the E(Z 11, mod): Let P and

Operations on E(Z 11, mod) n Consider the E(Z 11, mod): Let P and Q on E(Z 11, mod) 1. P = (10, 2) and Q= (5, 2) then P + Q = (10, 2) + (5, 2) = (7, 9). 2. 3. P = (2, 7); P + P = (5, 2). P = (2, 7); -P = (2, -7); P + -P =? 31

ECC system (general approach) General steps to construct an EC cryptosystem n 1. 2.

ECC system (general approach) General steps to construct an EC cryptosystem n 1. 2. 3. 4. 5. 6. 7. Selects an underlying field F Selects a representation for the elements of F Implementing arithmetic operations in F Selecting an appropriate EC over F to form E(F) Implementing EC operations in group E(F) Choose a protocol Implement ECC based on the chosen protocol. In real applications, we have to use ony “the recommended curves for higher security”. For example, the NIST recommended curves such as ECC P 256 R 1 are secure. http: //nvlpubs. nist. gov/nistpubs/FIPS/NIST. FIPS. 186 -4. pdf 32

Diffie-Hellman Key Exchange Protocol Both know G

Diffie-Hellman Key Exchange Protocol Both know G

Diffie Hellman over ECC n Alice chooses a random a and compute a. P

Diffie Hellman over ECC n Alice chooses a random a and compute a. P E n Bob chooses a random b and compute b. P E n Alice and Bob exchange the computed values n Alice, from b. P and a can compute S = ab. P n Bob, from a. P and b can compute S = ab. P 34

Simplementation of ECC Simple steps to construct an EC cryptosystem n Select an underlying

Simplementation of ECC Simple steps to construct an EC cryptosystem n Select an underlying field F and generate a random curve (e. g: y 2 = x 3 + ax + b ) – store values of a and b (should declare data structures to store curve and point parameters prior this) Find the base point g (generator) as public point (Every one knows this point) Compute shared secret key using Diffie Hellman over ECC Compute public keys: u u u Alice chooses a random as her secret key As and computes her public key Ap = Asg § Bob chooses a random Bs and computes his public key Bp = Bsg (Both Alice and Bob can now compute shared key Bs. Asg) § Embed message m onto a point, M(x, y), of the curve using Koblitz’s method Encrypt and decrypt u u § § Alice encrypts the message M(x, y): (Ap, As. Bp + M) and sends it to Bob decrypts the message by computing Ap. Bs and then M + As. Bp - Ap. Bs = M + As. Bsg - Asg. Bs = M 35

Basic operations of ECC Basic operations in Galois Field GF(2 m) or Zp •

Basic operations of ECC Basic operations in Galois Field GF(2 m) or Zp • addition and subtraction (xor): x+y, x-y (XOR) • multiplication, squaring: x y, x 2 • inversion: x-1 Basic operations on points of an Elliptic Curve • addition of points: • doubling a point: • projective to affine coordinate: P+Q 2 P P 2 A Complex operations on points of an Elliptic Curve • scalar multiplication: k P = P + …+P k times 36

ECC operations: Hierarchy ECC Level 0 Point multiplication: k. P Level 1 Group operation:

ECC operations: Hierarchy ECC Level 0 Point multiplication: k. P Level 1 Group operation: point add/double Parallelize the architectures Finite field arithmetic: multiplication, addition, subtraction, inversion, … Level 2 Level 3 37

Scalar multiplication n Basic crypto operation of an ECC. n Series of point addition

Scalar multiplication n Basic crypto operation of an ECC. n Series of point addition and doubling. n n Binary method due to no precomputation phase. Faster processing when using signed representation of the scalar value. 38

Scalar Multiplication: MSB first n Require k=(km-1, km-2, …, k 0)2, km=1 n Compute

Scalar Multiplication: MSB first n Require k=(km-1, km-2, …, k 0)2, km=1 n Compute Q=k. P Q=P q For i=m-2 to 0 q n n Q=2 Q If ki=1 then n n Q=Q+P End if End for q Return Q Sequential Algorithm Requires m point doublings and (m-1)/2 point additions on the average q 39

Example n Compute 7 P: 7=(111)2 q 7 P=2(2(P)+P)+P=> 2 iterations are required q

Example n Compute 7 P: 7=(111)2 q 7 P=2(2(P)+P)+P=> 2 iterations are required q Principle: First double and then add (accumulate) q n Compute 6 P: 6=(110)2 q 6 P=2(2(P)+P) q 40

Embedding plaintext messages as points on an Elliptic Curve n In order to build

Embedding plaintext messages as points on an Elliptic Curve n In order to build an ECC, there must be an accurate and efficient way for embedding a ciphertext message on an EC. q q q There is no known deterministic algorithm for embedding message units as points on an elliptic curve. However, there is a probabilistic method that can be used for embedding message units as points on an elliptic curve. See Koblitz’s proposal of representing a message unit as a point on an EC. 41

Embed a message m n Suppose p is prime with p mod 4 =

Embed a message m n Suppose p is prime with p mod 4 = 3 n Pick k so that 1/2 k is small n Let m be the message and allows m < (p-k)/k n For j=0, …, k-1 n Set xj = m*k + j ; wj = x 3 + a xj + b; zj = wj((p+1)/4) n If (zj 2 = wj) then (xj , zj) is the point to encode m n If no j works then FAIL with Prob. <= 1/2 k n If m is embedded as M(x, y) then m = [x/k] 42

Embed a message m n n n Koblitz message embedding example y^2 = x^3

Embed a message m n n n Koblitz message embedding example y^2 = x^3 + x + 6 mod 11 (we use E(Z 11)) p= 11 mod 4 = 3 k=3; n // if j=2, let m=2 n x 2 =2*3 + 2 = 8 n w 2 = 8^3 + 8 + 6 = 9 n z 2 = w 2^(12/4)=w 2^3 = 9^3 mod 11 = 3 n if(z^2 == w 2) 3^2 == 9 yes. n (x 2, z 2)=(8, 3) 는 m을 인코딩하는 point. . n // if j=1, let m = 2 n x 1 = 2 * 3 + 1 = 7 n w 1 = 7^3 + 7 + 6 mod 11 = 4 n z 1 = 4^3 mod 11 = 9 n If (z 1^2 == w 1? ) 9^2 mod 11 4. . yes. n (x 1, z 1)=(7, 9)은 m을 인코딩하는 point n n // if j=0, let m=2 n X 0 = 2*3=6 n w 0 = 6^2 + 6 = 48 mod 11 = 4 n z 0 = 4^3 = 64 mod 11 = 9 n If (9^2 == 4)? 4 yes n (x 0, z 0)=(6, 8)은 m을 인코딩하는 point 43

Point Compression n n An elliptic curve point P=(x, y) can be represented by

Point Compression n n An elliptic curve point P=(x, y) can be represented by its x-coordinate and an additional bit. This is because, given x, the elliptic curve equation becomes quadratic in y. The quadratic equation has at most two solutions, so one bit is sufficient to specify y (the additional bit is not required when Char(F)=2 and P has odd order [7]). For example, for the case of Fp, we have Y^2 = x^3 + a*x + b = x(x^2 + a) + b n n Therefore, given x and an additional bit, y can be obtained at the cost of 1 M + 1 SR, where M, S, and SR denote the cost of a field multiplication, a field squaring, and a square root operation, respectively. When the square root operation is computationally expensive, this point compression is not practical. In this case, the elliptic curve points are typically represented by both their x-coordinate and y-coordinate , : IEEE Trans. On Computers, Vol. 56, No. 3, March 2007, Reference “Double Point Compression with Applications to Speeding up Random Point Multiplication” [7] G. Seroussi, “Compact Representation of Elliptic Curve Points over IF 2 n , ” Technical Report No. HPL-98 -94 R 1, Hewlett-Packard Laboratories, 1998. 44

Some references n n n http: //beast. csse. monash. edu. acu/cpe 5021 http: //www.

Some references n n n http: //beast. csse. monash. edu. acu/cpe 5021 http: //www. certicom. com/index. php? action=res, ecc_faq (good introduction papers) http: //cnscenter. future. co. kr/crypto/algorithm/ecc. html (more materials) http: //www. cs. mdx. ac. uk/staffpages/m_cheng/link/ecc_simple. p df (good introduction for students) http: //www. secg. org/collateral/sec 1_final. pdf SEC 1: Elliptic Curve Cryptography http: //www. secg. org/collateral/sec 2_final. pdf SEC 2: Recommended Elliptic Curve Domain Parameters 45

Next… n We will study on Message Authentication and Hash Functions… 46

Next… n We will study on Message Authentication and Hash Functions… 46

Q&A 47

Q&A 47