APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of...

23
APPLICATION OF ELLIPTIC APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology Kharagpur INDIA -721302 23-27 May 2011 1 Anurag Labs, DRDO

Transcript of APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of...

Page 1: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

APPLICATION OF ELLIPTIC APPLICATION OF ELLIPTIC

CURVES TO CURVES TO

CRYPTOGRAPHYCRYPTOGRAPHYDebdeep Mukhopadhyay

Chester Rebeiro

Department of Computer Science and Engineering

Indian Institute of Technology Kharagpur

INDIA -721302

23-27 May 2011 1Anurag Labs, DRDO

Page 2: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

ObjectivesObjectives

Elliptic Curves and Cryptography

ECC Procedures – ElGamal type

Encoding of a message onto the EC

ECC D-H key exchange

Why use ECC?

Hard Problem underlying ECC.

23-27 May 2011 2Anurag Labs, DRDO

Page 3: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Public-Key CryptosystemsPublic-Key Cryptosystems

Secrecy: Only B can Decrypt the message

Authentication: Only A can generate the encrypted message 23-27 May 2011 3Anurag Labs, DRDO

Page 4: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Public-Key Cryptography RingPublic-Key Cryptography Ring

23-27 May 2011 4Anurag Labs, DRDO

Page 5: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Public-Key Cryptography RingPublic-Key Cryptography Ring

23-27 May 2011 5Anurag Labs, DRDO

Page 6: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

What Is Elliptic Curve What Is Elliptic Curve Cryptography (ECC)?Cryptography (ECC)?

Elliptic curve cryptography [ECC] is a public-key cryptosystem just like RSA and El Gamal.

Every user has a public and a private key.◦ Public key is used for encryption/signature

verification.◦ Private key is used for decryption/signature

generation.Elliptic curves are used as an extension to

other current cryptosystems.◦ Elliptic Curve Diffie-Hellman Key Exchange◦ Elliptic Curve Digital Signature Algorithm

23-27 May 2011 6Anurag Labs, DRDO

Page 7: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Using Elliptic Curves In Using Elliptic Curves In CryptographyCryptography

The central part of any cryptosystem involving elliptic curves is the elliptic group.

All public-key cryptosystems have some underlying mathematical operation.◦ RSA has exponentiation (raising the message or

ciphertext to the public or private values)◦ ECC has point multiplication (repeated addition

of two points).

23-27 May 2011 7Anurag Labs, DRDO

Page 8: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Generic Procedures of Generic Procedures of ECCECC

Both parties agree to some publicly-known data items◦ The elliptic curve equation

values of a and b prime, p

◦ The elliptic group computed from the elliptic curve equation

◦ A base point, B, taken from the elliptic group Similar to the generator used in current

cryptosystems Each user generates their public/private key pair

◦ Private Key = an integer, x, selected from the interval [1, p-1]

◦ Public Key = product, Q, of private key and base point (Q = x*B)

23-27 May 2011 8Anurag Labs, DRDO

Page 9: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Example – Elliptic Curve Example – Elliptic Curve Cryptosystem Analog to El Cryptosystem Analog to El GamalGamal

Suppose Alice wants to send to Bob an encrypted message.◦ Both agree on a base point, B.◦ Alice and Bob create public/private keys.

Alice Private Key = a Public Key = PA = a * B

Bob Private Key = b Public Key = PB = b * B

◦ Alice takes plaintext message, M, and encodes it onto a point, PM, from the elliptic group

23-27 May 2011 9Anurag Labs, DRDO

Page 10: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Encoding of a message onto Encoding of a message onto the Elliptic Curvethe Elliptic Curve

Consider a curve: y2=x3+ax+bThe plaintexts are say numbers and

English Characters (0-9 and 10-35).◦ ‘B’ is encoded as m=11.

Choose a public variable, k=20.◦ compute, x=mk+i. Vary i from 1 to k-1 and

try to get an integral value of y.Thus, m is encoded as (x,y).The decoding is simple: m=floor((x-

1)/k).

23-27 May 2011 10Anurag Labs, DRDO

Page 11: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

ExampleExample

p=751, a=-1, b=188 and k=20.Let m=11 Choose, x=mk+1. Thus, x=222. But

correspondingly, there is no solution for y.

So, we continue until x=mk+4. x=224. Thus, y=248 and hence m=11 is encoded as (224,248).

Decoding: m=floor((224-1)/20)=11

23-27 May 2011 11Anurag Labs, DRDO

Page 12: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Example – Elliptic Curve Example – Elliptic Curve Cryptosystem Analog to El Cryptosystem Analog to El GamalGamal

◦ Alice chooses another random integer, k from the interval [1, p-1]

◦ The ciphertext is a pair of points PC = [ (kB), (PM

+ kPB) ]

◦ To decrypt, Bob computes the product of the first point from PC and his private key, b b * (kB)

◦ Bob then takes this product and subtracts it from the second point from PC

(PM + kPB) – [b(kB)] = PM + k(bB) – b(kB) = PM

◦ Bob then decodes PM to get the message, M.

23-27 May 2011 12Anurag Labs, DRDO

Page 13: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Diffie-Hellman (DH) Key Diffie-Hellman (DH) Key ExchangeExchange

23-27 May 2011 13Anurag Labs, DRDO

Page 14: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

ECC Diffie-HellmanECC Diffie-Hellman

Public: Elliptic curve and point B=(x,y) on curveSecret: Alice’s a and Bob’s b

Alice, A Bob, B

a(x,y)

b(x,y)

• Alice computes a(b(x,y)) • Bob computes b(a(x,y))• These are the same since ab = ba

23-27 May 2011 14Anurag Labs, DRDO

Page 15: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Example – Elliptic Curve Example – Elliptic Curve Diffie-Hellman ExchangeDiffie-Hellman Exchange

Alice and Bob want to agree on a shared key.◦ Alice and Bob compute their public and private keys.

Alice Private Key = a Public Key = PA = a * B

Bob Private Key = b Public Key = PB = b * B

◦ Alice and Bob send each other their public keys.◦ Both take the product of their private key and the other

user’s public key. Alice KAB = a(bB)

Bob KAB = b(aB)

Shared Secret Key = KAB = abB

23-27 May 2011 15Anurag Labs, DRDO

Page 16: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Why use ECC?Why use ECC?

How do we analyze Cryptosystems?◦How difficult is the underlying problem

that it is based upon RSA – Integer Factorization DH – Discrete Logarithms ECC - Elliptic Curve Discrete Logarithm

problem

◦How do we measure difficulty? We examine the algorithms used to solve

these problems

23-27 May 2011 16Anurag Labs, DRDO

Page 17: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Security of ECCSecurity of ECC

ECC results in shorter key sizes. ◦ this leads to efficient

applications, at the same level of security.

◦ e.g 163 bits of ECC key is equivalent to 1024 bits of a RSA key.

23-27 May 2011 17Anurag Labs, DRDO

Page 18: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Applications of ECCApplications of ECC

Many devices are small and have limited storage and computational power.

Where can we apply ECC?◦ Wireless communication devices◦ Smart cards◦ Online Transactions◦ Web servers ◦ Any application where security is needed but

lacks the power, storage and computational power that is necessary for our present day applications.

23-27 May 2011 18Anurag Labs, DRDO

Page 19: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Hard Problem of ECCHard Problem of ECC

“Hard problem” analogous to discrete log◦ Q=kP, where Q,P belong to a prime curve

given k,P “easy” to compute Q given Q,P “hard” to find k

◦ known as the elliptic curve logarithm problem k must be large enough

ECC security relies on elliptic curve logarithm problem◦ compared to factoring, can use much smaller key sizes than

with RSA etc

23-27 May 2011 19Anurag Labs, DRDO

Page 20: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Elliptic Curve Discrete Log Elliptic Curve Discrete Log Problem (ECDLP)Problem (ECDLP)

Let be an elliptic curve over the finite field F

and let and be points in ( ). The Elliptic

Curve Discrete Logarithm Problem (ECDLP) is

the problem of finding an integer such that .

We d

p

p

E

P Q E F

n Q nP

enote the integer as: log (Q), the elliptic

curve discrete logarithm of with respect to . Pn n

Q P

23-27 May 2011 20Anurag Labs, DRDO

Page 21: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

Points about ECDLPPoints about ECDLP

logP(Q) may not be defined: there may be points P and Q, such that Q is not a scalar multiple of P.

There is not one value, n st. Q=nP.◦ there exists s such that sP=O.◦ Since there are finite points on the EC, from the

points in list P, 2P, 3P, 4P, … there must be i and j st. iP=jP, i>j. Let s=(i-j) and the smallest such s is called order of P.

◦ Thus, if n0 is an integer such that Q=n0P, then for any integer i, n=n0+is, satisfies the equation Q=nP.

◦ We choose, the value of logP(Q) to be in Z/sZ.

23-27 May 2011 21Anurag Labs, DRDO

Page 22: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

How hard is ECDLP?How hard is ECDLP?

Consider 2 lists, generated by choosing random integers j1,…,jr and k1,…,kr between 1 and p.◦ List L1: j1P, j2P, …, jrP◦ List L2: k1P+Q, k2P+Q, …, krP+Q◦ Any collision between the 2 lists imply, juP=kvP+Q,

thus Q=(ju-kv)P. ◦ From B. Paradox, with r=O(p1/2) there is a good

chance of a collision. ◦ The fastest algorithm to solve ECDLP is O(p1/2).◦ The ECDLP is harder than the DLP in Fp

*

The DLP problem has faster algorithms.

23-27 May 2011 22Anurag Labs, DRDO

Page 23: APPLICATION OF ELLIPTIC CURVES TO CRYPTOGRAPHY Debdeep Mukhopadhyay Chester Rebeiro Department of Computer Science and Engineering Indian Institute of.

ReferencesReferences

Books: ◦ Elliptic Curves: Number Theory and

Cryptography, by Lawrence C. Washington ◦ Guide to Elliptic Curve Cryptography, Alfred

J. Menezes ◦ Guide to Elliptic Curve Cryptography, Darrel

R. Hankerson, A. Menezes and A. Vanstone◦ http://cr.yp.to/ecdh.html ( Daniel Bernstein)

23-27 May 2011 23Anurag Labs, DRDO