public key ecc, hash. elliptic curve cryptography majority of public-key crypto (rsa, d-h) use...

31
Public Key Public Key ECC , Hash ECC , Hash

Upload: randolph-golden

Post on 26-Dec-2015

255 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Public KeyPublic Key

ECC , HashECC , Hash

Page 2: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Elliptic Curve CryptographyElliptic Curve Cryptography

majority of public-key crypto (RSA, D-H) majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic use either integer or polynomial arithmetic with with very largevery large numbers/polynomials numbers/polynomials

imposes a significant load in storing and imposes a significant load in storing and processing keys and messagesprocessing keys and messages

an alternative is to use elliptic curvesan alternative is to use elliptic curves offers same security with smaller bit sizesoffers same security with smaller bit sizes newer, but not as well analyzednewer, but not as well analyzed

Page 3: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Real Elliptic CurvesReal Elliptic Curves an an elliptic curve is defined by an elliptic curve is defined by an

equation in two variables x & y, with equation in two variables x & y, with coefficientscoefficients

consider a cubic elliptic curve of formconsider a cubic elliptic curve of form yy22 = = xx33 + + ax ax + + bb where x,y,a,b are all real numberswhere x,y,a,b are all real numbers also define zero point Oalso define zero point O

have addition operation for elliptic curvehave addition operation for elliptic curve geometrically sum of Q+R is reflection of geometrically sum of Q+R is reflection of

intersection Rintersection R

Page 4: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Real Elliptic Curve ExampleReal Elliptic Curve Example

Page 5: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Finite Elliptic CurvesFinite Elliptic Curves

Elliptic curve cryptography uses curves Elliptic curve cryptography uses curves whose variables & coefficients are finitewhose variables & coefficients are finite

have two families commonly used:have two families commonly used: prime curves prime curves EEpp(a,b)(a,b) defined over Z defined over Zpp

• use integers modulo a primeuse integers modulo a prime• best in softwarebest in software

binary curves binary curves EE22mm(a,b)(a,b) defined over GF(2 defined over GF(2nn))• use polynomials with binary coefficientsuse polynomials with binary coefficients• best in hardwarebest in hardware

Page 6: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Elliptic Curve CryptographyElliptic Curve Cryptography

ECC addition is analog of modulo multiplyECC addition is analog of modulo multiply ECC repeated addition is analog of ECC repeated addition is analog of

modulo exponentiationmodulo exponentiation need “hard” problem equiv to discrete logneed “hard” problem equiv to discrete log

Q=kPQ=kP, where Q,P belong to a prime curve, where Q,P belong to a prime curve is “is “easy” to compute Q given k,Peasy” to compute Q given k,P but “hard” to find k given Q,Pbut “hard” to find k given Q,P known as the elliptic curve logarithm problemknown as the elliptic curve logarithm problem

Certicom example: Certicom example: EE2323(9,17)(9,17)

Page 7: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

ECC Diffie-HellmanECC Diffie-Hellman

can do key exchange analogous to D-Hcan do key exchange analogous to D-H users select a suitable curve users select a suitable curve EEpp(a,b)(a,b) select base point select base point G=(xG=(x11,y,y11))

with large order n s.t. with large order n s.t. nG=OnG=O A & B select private keys A & B select private keys nnAA<n, n<n, nBB<n<n compute public keys: compute public keys: PPAA=n=nAAG, G, PPBB=n=nBBGG compute shared key: compute shared key: KK=n=nAAPPBB,, KK=n=nBBPPAA

same since same since KK=n=nAAnnBBGG

Page 8: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

ECC Encryption/DecryptionECC Encryption/Decryption

several alternatives, will consider simplestseveral alternatives, will consider simplest must first encode any message M as a point on must first encode any message M as a point on

the elliptic curve Pthe elliptic curve Pmm

select suitable curve & select suitable curve & point Gpoint G as in D-H as in D-H each user chooses private key each user chooses private key nnAA<n<n

and computes public key and computes public key PPAA=n=nAAGG

to encrypt Pto encrypt Pmm : : CCmm={kG, P={kG, Pmm+kP+kPbb}}, k random, k random

decrypt Cdecrypt Cmm compute: compute:

PPmm++kkPPbb––nnBB((kGkG) = ) = PPmm++kk((nnBBGG)–)–nnBB((kGkG) = ) = PPmm

Page 9: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

ECC SecurityECC Security

relies on elliptic curve logarithm problemrelies on elliptic curve logarithm problem fastest method is “Pollard rho method”fastest method is “Pollard rho method” compared to factoring, can use much compared to factoring, can use much

smaller key sizes than with RSA etcsmaller key sizes than with RSA etc for equivalent key lengths computations for equivalent key lengths computations

are roughly equivalentare roughly equivalent hence for similar security ECC offers hence for similar security ECC offers

significant computational advantagessignificant computational advantages

Page 10: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Comparable Key Sizes for Comparable Key Sizes for Equivalent SecurityEquivalent Security

Symmetric scheme

(key size in bits)

ECC-based scheme

(size of n in bits)

RSA/DSARSA/DSA

(modulus size in bits)

5656 112 512

80 160 1024

112 224 2048

128 256 3072

192 384 7680

256 512 15360

Page 11: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message Authentication and Message Authentication and Hash FunctionsHash Functions

At cats' green on the Sunday he took the message from At cats' green on the Sunday he took the message from the inside of the pillar and added Peter Moran's name to the inside of the pillar and added Peter Moran's name to the two names already printed there in the "Brontosaur" the two names already printed there in the "Brontosaur" code. The message now read: “Leviathan to Dragon: code. The message now read: “Leviathan to Dragon: Martin Hillman, Trevor Allan, Peter Moran: observe and Martin Hillman, Trevor Allan, Peter Moran: observe and tail.” What was the good of it John hardly knew. He felt tail.” What was the good of it John hardly knew. He felt better, he felt that at last he had made an attack on Peter better, he felt that at last he had made an attack on Peter Moran instead of waiting passively and effecting no Moran instead of waiting passively and effecting no retaliation. Besides, what was the use of being in retaliation. Besides, what was the use of being in possession of the key to the codes if he never took possession of the key to the codes if he never took advantage of it?advantage of it?

——Talking to Strange Men, Talking to Strange Men, Ruth RendellRuth Rendell

Page 12: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message AuthenticationMessage Authentication

message authentication is concerned with: message authentication is concerned with: protecting the integrity of a message protecting the integrity of a message validating identity of originator validating identity of originator non-repudiation of origin (dispute resolution)non-repudiation of origin (dispute resolution)

will consider the security requirementswill consider the security requirements then three alternative functions used:then three alternative functions used:

message encryptionmessage encryption message authentication code (MAC)message authentication code (MAC) hash functionhash function

Page 13: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Security RequirementsSecurity Requirements

disclosuredisclosure traffic analysistraffic analysis masquerademasquerade content modificationcontent modification sequence modificationsequence modification timing modificationtiming modification source repudiationsource repudiation destination repudiationdestination repudiation

Page 14: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message EncryptionMessage Encryption

message encryption by itself also provides message encryption by itself also provides a measure of authenticationa measure of authentication

if symmetric encryption is used then:if symmetric encryption is used then: receiver know sender must have created itreceiver know sender must have created it since only sender and receiver now key usedsince only sender and receiver now key used know content cannot of been alteredknow content cannot of been altered if message has if message has suitable structure, redundancy suitable structure, redundancy

or a checksum to detect any changesor a checksum to detect any changes

Page 15: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message EncryptionMessage Encryption

if public-key encryption is used:if public-key encryption is used: encryption provides no confidence of senderencryption provides no confidence of sender since anyone potentially knows public-keysince anyone potentially knows public-key however if however if

• sender sender signssigns message using their private-key message using their private-key• then encrypts with recipients public keythen encrypts with recipients public key• have both secrecy and authenticationhave both secrecy and authentication

again need to recognize corrupted messagesagain need to recognize corrupted messages but at cost of two public-key uses on messagebut at cost of two public-key uses on message

Page 16: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message Authentication Code Message Authentication Code (MAC)(MAC)

generated by an algorithm that creates a generated by an algorithm that creates a small fixed-sized blocksmall fixed-sized block depending on both message and some keydepending on both message and some key like encryption though need not be reversiblelike encryption though need not be reversible

appended to message as a appended to message as a signaturesignature receiver performs same computation on receiver performs same computation on

message and checks it matches the MACmessage and checks it matches the MAC provides assurance that message is provides assurance that message is

unaltered and comes from senderunaltered and comes from sender

Page 17: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message Authentication CodeMessage Authentication Code

Page 18: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Message Authentication Message Authentication CodesCodes

as shown the MAC provides authenticationas shown the MAC provides authentication can also use encryption for secrecycan also use encryption for secrecy

generally use separate keys for eachgenerally use separate keys for each can compute MAC either before or after encryptioncan compute MAC either before or after encryption is generally regarded as better done beforeis generally regarded as better done before

why use a MAC?why use a MAC? sometimes only authentication is neededsometimes only authentication is needed sometimes need authentication to persist longer than sometimes need authentication to persist longer than

the encryption (eg. archival use)the encryption (eg. archival use) note that a MAC is not a digital signaturenote that a MAC is not a digital signature

Page 19: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

MAC PropertiesMAC Properties

a MAC is a cryptographic checksuma MAC is a cryptographic checksumMAC = CMAC = CKK(M)(M)

condenses a variable-length message Mcondenses a variable-length message M using a secret key Kusing a secret key K to a fixed-sized authenticatorto a fixed-sized authenticator

is a many-to-one functionis a many-to-one function potentially many messages have same MACpotentially many messages have same MAC but finding these needs to be very difficultbut finding these needs to be very difficult

Page 20: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Requirements for MACsRequirements for MACs

taking into account the types of attackstaking into account the types of attacks need the MAC to satisfy the following:need the MAC to satisfy the following:

1.1. knowing a message and MAC, is infeasible knowing a message and MAC, is infeasible to find another message with same MACto find another message with same MAC

2.2. MACs should be uniformly distributedMACs should be uniformly distributed

3.3. MAC should depend equally on all bits of the MAC should depend equally on all bits of the messagemessage

Page 21: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Using Symmetric Ciphers for Using Symmetric Ciphers for MACsMACs

can use any block cipher chaining mode can use any block cipher chaining mode and use final block as a MACand use final block as a MAC

Data Authentication Algorithm (DAA)Data Authentication Algorithm (DAA) is is a widely used MAC based on DES-CBCa widely used MAC based on DES-CBC using IV=0 and zero-pad of final blockusing IV=0 and zero-pad of final block encrypt message using DES in CBC modeencrypt message using DES in CBC mode and send just the final block as the MACand send just the final block as the MAC

• or the leftmost M bits (16or the leftmost M bits (16≤M≤64) of final block≤M≤64) of final block

but final MAC is now too small for securitybut final MAC is now too small for security

Page 22: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Data Authentication AlgorithmData Authentication Algorithm

Page 23: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Hash FunctionsHash Functions

condenses arbitrary message to fixed sizecondenses arbitrary message to fixed sizeh = H(M)h = H(M)

usually assume that the hash function is usually assume that the hash function is public and not keyedpublic and not keyed cf. MAC which is keyedcf. MAC which is keyed

hash used to detect changes to messagehash used to detect changes to message can use in various ways with messagecan use in various ways with message most often to create a digital signaturemost often to create a digital signature

Page 24: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Hash Functions & Digital Hash Functions & Digital SignaturesSignatures

Page 25: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Requirements for Hash Requirements for Hash FunctionsFunctions

1.1. can be applied to any sized message can be applied to any sized message MM2.2. produces fixed-length output produces fixed-length output hh3.3. is easy to compute is easy to compute h=H(M)h=H(M) for any message for any message MM4.4. given given hh is infeasible to find is infeasible to find xx s.t. s.t. H(x)=hH(x)=h

• one-way propertyone-way property

5.5. given given xx is infeasible to find is infeasible to find yy s.t s.t. H(y)=H(x). H(y)=H(x)• weak collision resistanceweak collision resistance

6.6. is infeasible to find any is infeasible to find any x,yx,y s.t s.t. H(y)=H(x). H(y)=H(x)• strong collision resistancestrong collision resistance

Page 26: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Simple Hash FunctionsSimple Hash Functions

are several proposals for simple functionsare several proposals for simple functions based on XOR of message blocksbased on XOR of message blocks not secure since can manipulate any not secure since can manipulate any

message and either not change hash or message and either not change hash or change hash alsochange hash also

need a stronger cryptographic function need a stronger cryptographic function (next chapter)(next chapter)

Page 27: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Birthday AttacksBirthday Attacks

might think a 64-bit hash is securemight think a 64-bit hash is secure but by but by Birthday ParadoxBirthday Paradox is not is not birthday attack birthday attack works thus:works thus:

opponent generates 2opponent generates 2mm//22 variations of a valid message variations of a valid message

all with essentially the same meaningall with essentially the same meaning opponent also generates 2opponent also generates 2

mm//22 variations of a desired variations of a desired fraudulent messagefraudulent message

two sets of messages are compared to find pair with two sets of messages are compared to find pair with same hash (probability > 0.5 by birthday paradox)same hash (probability > 0.5 by birthday paradox)

have user sign the valid message, then substitute the have user sign the valid message, then substitute the forgery which will have a valid signatureforgery which will have a valid signature

conclusion is that need to use larger MAC/hashconclusion is that need to use larger MAC/hash

Page 28: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Block Ciphers as Hash Block Ciphers as Hash FunctionsFunctions

can use block ciphers as hash functionscan use block ciphers as hash functions using Husing H00=0 and zero-pad of final block=0 and zero-pad of final block

compute: Hcompute: Hii = E = EMMii [H [Hi-1i-1]]

and use final block as the hash valueand use final block as the hash value similar to CBC but similar to CBC but without a keywithout a key

resulting hash is too small (64-bit)resulting hash is too small (64-bit) both due to direct birthday attackboth due to direct birthday attack and to “meet-in-the-middle” attackand to “meet-in-the-middle” attack

other variants also susceptible to attackother variants also susceptible to attack

Page 29: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Hash Functions & MAC Hash Functions & MAC SecuritySecurity

like block ciphers have:like block ciphers have: brute-forcebrute-force attacks exploiting attacks exploiting

strong collision resistance hash have cost 2strong collision resistance hash have cost 2mm//22

• have proposal for h/w MD5 crackerhave proposal for h/w MD5 cracker• 128-bit hash looks vulnerable, 160-bits better128-bit hash looks vulnerable, 160-bits better

MACs with known message-MAC pairsMACs with known message-MAC pairs• can either attack keyspace (cf key search) or MACcan either attack keyspace (cf key search) or MAC• at least 128-bit MAC is needed for securityat least 128-bit MAC is needed for security

Page 30: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

Hash Functions & MAC Hash Functions & MAC Security Security

cryptanalytic attackscryptanalytic attacks exploit structure exploit structure like block ciphers want brute-force attacks to be the like block ciphers want brute-force attacks to be the

best alternativebest alternative have a number of analytic attacks on iterated have a number of analytic attacks on iterated

hash functionshash functions CVCVii = f[CV = f[CVi-1i-1, M, Mii]; H(M)=CV]; H(M)=CVNN

typically focus on collisions in function ftypically focus on collisions in function f like block ciphers is often composed of roundslike block ciphers is often composed of rounds attacks exploit properties of round functionsattacks exploit properties of round functions

Page 31: Public Key ECC, Hash. Elliptic Curve Cryptography  majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large

SummarySummary

have considered:have considered: message authentication usingmessage authentication using message encryptionmessage encryption MACsMACs hash functionshash functions general approach & securitygeneral approach & security