+ All Categories
Home > Documents > Public Key

Public Key

Date post: 12-Jan-2016
Category:
Upload: varden
View: 23 times
Download: 0 times
Share this document with a friend
Description:
Public Key. Advanced Topics. Hash and MAC Algorithms. - PowerPoint PPT Presentation
43
Public Key Public Key Advanced Topics Advanced Topics
Transcript
Page 1: Public Key

Public KeyPublic Key

Advanced TopicsAdvanced Topics

Page 2: Public Key

Hash and MAC AlgorithmsHash and MAC Algorithms

Each of the messages, like each one he had ever Each of the messages, like each one he had ever read of Stern's commands, began with a number read of Stern's commands, began with a number and ended with a number or row of numbers. No and ended with a number or row of numbers. No efforts on the part of Mungo or any of his experts efforts on the part of Mungo or any of his experts had been able to break Stern's code, nor was had been able to break Stern's code, nor was there any clue as to what the preliminary number there any clue as to what the preliminary number and those ultimate numbers signified.and those ultimate numbers signified.——Talking to Strange Men, Talking to Strange Men, Ruth RendellRuth Rendell

Page 3: Public Key

Hash and MAC AlgorithmsHash and MAC Algorithms

Hash FunctionsHash Functions condense arbitrary size message to fixed sizecondense arbitrary size message to fixed size by processing message in blocksby processing message in blocks through some compression functionthrough some compression function either custom or block cipher basedeither custom or block cipher based

Message Authentication Code (MAC)Message Authentication Code (MAC) fixed sized authenticator for some messagefixed sized authenticator for some message to provide authentication for messageto provide authentication for message by using block cipher mode or hash functionby using block cipher mode or hash function

Page 4: Public Key

Hash Algorithm StructureHash Algorithm Structure

Page 5: Public Key

Secure Hash AlgorithmSecure Hash Algorithm

SHA originally designed by NIST & NSA in 1993SHA originally designed by NIST & NSA in 1993 was revised in 1995 as SHA-1was revised in 1995 as SHA-1 US standard for use with DSA signature scheme US standard for use with DSA signature scheme

standard is FIPS 180-1 1995, also Internet RFC3174standard is FIPS 180-1 1995, also Internet RFC3174 nb. the algorithm is SHA, the standard is SHS nb. the algorithm is SHA, the standard is SHS

based on design of MD4 with key differences based on design of MD4 with key differences produces 160-bit hash values produces 160-bit hash values recent 2005 results on security of SHA-1 have recent 2005 results on security of SHA-1 have

raised concerns on its use in future applicationsraised concerns on its use in future applications

Page 6: Public Key

Revised Secure Hash Revised Secure Hash StandardStandard

NIST issued revision FIPS 180-2 in 2002NIST issued revision FIPS 180-2 in 2002 adds 3 additional versions of SHA adds 3 additional versions of SHA

SHA-256, SHA-384, SHA-512SHA-256, SHA-384, SHA-512 designed for compatibility with increased designed for compatibility with increased

security provided by the AES ciphersecurity provided by the AES cipher structure & detail is similar to SHA-1structure & detail is similar to SHA-1 hence analysis should be similarhence analysis should be similar but security levels are rather higherbut security levels are rather higher

Page 7: Public Key

SHA-512 OverviewSHA-512 Overview

Page 8: Public Key

SHA-512 Compression SHA-512 Compression FunctionFunction

heart of the algorithmheart of the algorithm processing message in 1024-bit blocksprocessing message in 1024-bit blocks consists of 80 roundsconsists of 80 rounds

updating a 512-bit buffer updating a 512-bit buffer using a 64-bit value Wt derived from the using a 64-bit value Wt derived from the

current message blockcurrent message block and a round constant based on cube root of and a round constant based on cube root of

first 80 prime numbersfirst 80 prime numbers

Page 9: Public Key

SHA-512 Round FunctionSHA-512 Round Function

Page 10: Public Key

SHA-512 SHA-512 Round FunctionRound Function

Page 11: Public Key

WhirlpoolWhirlpool

now examine the now examine the Whirlpool hash functionWhirlpool hash function endorsed by European NESSIE projectendorsed by European NESSIE project uses modified AES internals as uses modified AES internals as

compression functioncompression function addressing concerns on use of block addressing concerns on use of block

ciphers seen previouslyciphers seen previously with performance comparable to dedicated with performance comparable to dedicated

algorithms like SHAalgorithms like SHA

Page 12: Public Key

Whirlpool OverviewWhirlpool Overview

Page 13: Public Key

Whirlpool Block Cipher WWhirlpool Block Cipher W

designed specifically for hash function usedesigned specifically for hash function use with security and efficiency of AESwith security and efficiency of AES but with 512-bit block size and hence hashbut with 512-bit block size and hence hash similar structure & functions as AES butsimilar structure & functions as AES but

input is mapped row wiseinput is mapped row wise has 10 roundshas 10 rounds a different primitive polynomial for GF(2^8)a different primitive polynomial for GF(2^8) uses different S-box design & valuesuses different S-box design & values

Page 14: Public Key

Whirlpool Block Cipher WWhirlpool Block Cipher W

Page 15: Public Key

Whirlpool Performance & Whirlpool Performance & SecuritySecurity

Whirlpool is a very new proposalWhirlpool is a very new proposal hence little experience with usehence little experience with use but many AES findings should applybut many AES findings should apply does seem to need more h/w than SHA, does seem to need more h/w than SHA,

but with better resulting performancebut with better resulting performance

Page 16: Public Key

Keyed Hash Functions as MACsKeyed Hash Functions as MACs

want a MAC based on a hash function want a MAC based on a hash function because hash functions are generally fasterbecause hash functions are generally faster code for crypto hash functions widely code for crypto hash functions widely

availableavailable hash includes a hash includes a keykey along with message along with message original proposal:original proposal:

KeyedHash = Hash(Key|Message) KeyedHash = Hash(Key|Message) some weaknesses were found with this some weaknesses were found with this

eventually led to development of HMAC eventually led to development of HMAC

Page 17: Public Key

HMACHMAC

specified as specified as Internet standardInternet standard RFC2104 RFC2104 uses hash function on the message:uses hash function on the message:

HMACHMACKK = Hash[(K = Hash[(K++ XOR opad) || XOR opad) || Hash[(KHash[(K++ XOR ipad)||M)]] XOR ipad)||M)]]

where Kwhere K++ is the key padded out to size is the key padded out to size and opad, ipad are specified padding constants and opad, ipad are specified padding constants overhead is just 3 more hash calculations than overhead is just 3 more hash calculations than

the message needs alonethe message needs alone any hash function can be usedany hash function can be used

eg. MD5, SHA-1, RIPEMD-160, Whirlpooleg. MD5, SHA-1, RIPEMD-160, Whirlpool

Page 18: Public Key

HMAC OverviewHMAC Overview

Page 19: Public Key

HMAC SecurityHMAC Security

proved proved security of HMAC relates to that of security of HMAC relates to that of the underlying hash algorithmthe underlying hash algorithm

attacking HMAC requires either:attacking HMAC requires either: brute force attack on key usedbrute force attack on key used birthday attack (but since keyed would need birthday attack (but since keyed would need

to observe a very large number of messages)to observe a very large number of messages) choose hash function used based on choose hash function used based on

speed verses security constraintsspeed verses security constraints

Page 20: Public Key

CMACCMAC

previously saw the DAA (CBC-MAC)previously saw the DAA (CBC-MAC) widely used in govt & industrywidely used in govt & industry but has message size limitationbut has message size limitation can overcome using 2 keys & paddingcan overcome using 2 keys & padding thus forming the thus forming the Cipher-based Message Cipher-based Message

Authentication Code (CMACAuthentication Code (CMAC)) adopted by NIST SP800-38Badopted by NIST SP800-38B

Page 21: Public Key

CMAC OverviewCMAC Overview

Page 22: Public Key

Digital Signatures & Digital Signatures & Authentication ProtocolsAuthentication Protocols

To guard against the baneful influence exerted by strangers To guard against the baneful influence exerted by strangers is therefore an elementary dictate of savage prudence. is therefore an elementary dictate of savage prudence. Hence before strangers are allowed to enter a district, or Hence before strangers are allowed to enter a district, or at least before they are permitted to mingle freely with at least before they are permitted to mingle freely with the inhabitants, certain ceremonies are often performed the inhabitants, certain ceremonies are often performed by the natives of the country for the purpose of disarming by the natives of the country for the purpose of disarming the strangers of their magical powers, or of disinfecting, the strangers of their magical powers, or of disinfecting, so to speak, the tainted atmosphere by which they are so to speak, the tainted atmosphere by which they are supposed to be surrounded.supposed to be surrounded.——The Golden BoughThe Golden Bough, Sir James George Frazer, Sir James George Frazer

Page 23: Public Key

Digital SignaturesDigital Signatures

have looked at have looked at message authentication message authentication but does not address issues of lack of trustbut does not address issues of lack of trust

digital signatures provide the ability to: digital signatures provide the ability to: verify author, date & time of signatureverify author, date & time of signature authenticate message contents authenticate message contents be verified by third parties to resolve disputesbe verified by third parties to resolve disputes

hence include authentication function with hence include authentication function with additional capabilitiesadditional capabilities

Page 24: Public Key

Digital Signature PropertiesDigital Signature Properties

must depend on the message signedmust depend on the message signed must use information unique to sendermust use information unique to sender

to prevent both forgery and denialto prevent both forgery and denial

must be relatively easy to producemust be relatively easy to produce must be relatively easy to recognize & verifymust be relatively easy to recognize & verify be computationally infeasible to forge be computationally infeasible to forge

with new message for existing digital signaturewith new message for existing digital signature with fraudulent digital signature for given messagewith fraudulent digital signature for given message

be practical save digital signature in storagebe practical save digital signature in storage

Page 25: Public Key

Direct Digital SignaturesDirect Digital Signatures

involve only sender & receiverinvolve only sender & receiver assumed receiver has sender’s public-keyassumed receiver has sender’s public-key digital signature made by sender signing digital signature made by sender signing

entire message or hash with private-keyentire message or hash with private-key can encrypt using receivers public-keycan encrypt using receivers public-key important that sign first then encrypt important that sign first then encrypt

message & signaturemessage & signature security depends on sender’s private-keysecurity depends on sender’s private-key

Page 26: Public Key

Arbitrated Digital SignaturesArbitrated Digital Signatures

involves use of arbiter Ainvolves use of arbiter A validates any signed messagevalidates any signed message then dated and sent to recipientthen dated and sent to recipient

requires suitable level of trust in arbiterrequires suitable level of trust in arbiter can be implemented with either private or can be implemented with either private or

public-key algorithmspublic-key algorithms arbiter may or may not see messagearbiter may or may not see message

Page 27: Public Key

Authentication ProtocolsAuthentication Protocols

used to convince parties of each others used to convince parties of each others identity and to exchange session keysidentity and to exchange session keys

may be one-way or mutualmay be one-way or mutual key issues arekey issues are

confidentiality – to protect session keysconfidentiality – to protect session keys timeliness – to prevent replay attackstimeliness – to prevent replay attacks

published protocols are often found to published protocols are often found to have flaws and need to be modifiedhave flaws and need to be modified

Page 28: Public Key

Replay AttacksReplay Attacks

where a valid signed message is copied and where a valid signed message is copied and later resentlater resent simple replaysimple replay repetition that can be loggedrepetition that can be logged repetition that cannot be detectedrepetition that cannot be detected backward replay without modificationbackward replay without modification

countermeasures includecountermeasures include use of sequence numbers (generally impractical)use of sequence numbers (generally impractical) timestamps (needs synchronized clocks)timestamps (needs synchronized clocks) challenge/response (using unique nonce)challenge/response (using unique nonce)

Page 29: Public Key

Using Symmetric EncryptionUsing Symmetric Encryption

as discussed previously can use a two-as discussed previously can use a two-level hierarchy of keyslevel hierarchy of keys

usually with a trusted Key Distribution usually with a trusted Key Distribution Center (KDC)Center (KDC) each party shares own master key with KDCeach party shares own master key with KDC KDC generates session keys used for KDC generates session keys used for

connections between partiesconnections between parties master keys used to distribute these to themmaster keys used to distribute these to them

Page 30: Public Key

Needham-Schroeder ProtocolNeedham-Schroeder Protocol

original third-party key distribution protocoloriginal third-party key distribution protocol for session between A B mediated by KDCfor session between A B mediated by KDC protocol overview is:protocol overview is:

1. 1. A->KDC: A->KDC: IDIDAA || || IDIDBB || || NN11

22. KDC ->. KDC -> A: EA: EKaKa[Ks[Ks || || IDIDBB || || NN11 || E || EKbKb[[KsKs||||IDIDAA] ]] ]

3. 3. A ->A -> B: B: EEKbKb[[KsKs||||IDIDAA]]

4. 4. B ->B -> A: A: EEKsKs[[NN22]]

5. 5. A ->A -> B: B: EEKsKs[f([f(NN22)])]

Page 31: Public Key

Needham-Schroeder ProtocolNeedham-Schroeder Protocol

used to securely distribute a new session used to securely distribute a new session key for communications between A & Bkey for communications between A & B

but is vulnerable to a replay attack if an old but is vulnerable to a replay attack if an old session key has been compromisedsession key has been compromised then message 3 can be resent convincing B then message 3 can be resent convincing B

that is communicating with Athat is communicating with A modifications to address this require:modifications to address this require:

timestamps (Denning 81)timestamps (Denning 81) using an extra nonce (Neuman 93)using an extra nonce (Neuman 93)

Page 32: Public Key

Using Public-Key EncryptionUsing Public-Key Encryption

have a range of approaches based on the have a range of approaches based on the use of public-key encryptionuse of public-key encryption

need to ensure have correct public keys need to ensure have correct public keys for other partiesfor other parties

using a central Authentication Server (AS)using a central Authentication Server (AS) various protocols exist using timestamps various protocols exist using timestamps

or noncesor nonces

Page 33: Public Key

Denning AS ProtocolDenning AS Protocol

Denning 81 presented the following:Denning 81 presented the following:1. 1. A ->A -> AS: AS: IDIDAA || || IDIDBB

2. 2. AS ->AS -> A: EA: EPRasPRas[[IDIDAA||PU||PUaa||T] || E||T] || EPRasPRas[[IDIDBB||PU||PUbb||T] ||T]

3. 3. A ->A -> B: EB: EPRasPRas[[IDIDAA||PU||PUaa||T] || E||T] || EPRasPRas[[IDIDBB||PU||PUbb||T] || ||T] ||

EEPUbPUb[E[EPRasPRas[K[Kss||T]] ||T]]

note session key is chosen by A, hence AS need note session key is chosen by A, hence AS need not be trusted to protect itnot be trusted to protect it

timestamps prevent replay but require timestamps prevent replay but require synchronized clockssynchronized clocks

Page 34: Public Key

One-Way AuthenticationOne-Way Authentication

required when sender & receiver are not in required when sender & receiver are not in communications at same time (eg. email)communications at same time (eg. email)

have header in clear so can be delivered have header in clear so can be delivered by email systemby email system

may want contents of body protected & may want contents of body protected & sender authenticatedsender authenticated

Page 35: Public Key

Using Symmetric EncryptionUsing Symmetric Encryption

can refine use of KDC but can’t have final can refine use of KDC but can’t have final exchange of nonces, vis:exchange of nonces, vis:1. 1. AA->->KDC: KDC: IDIDAA || || IDIDBB || || NN11

22. KDC . KDC -> -> A: EA: EKaKa[Ks[Ks || || IDIDBB || || NN11 || E || EKbKb[[KsKs||||IDIDAA] ]] ]

3. 3. A A -> -> B: B: EEKbKb[[KsKs||||IDIDAA] || E] || EKsKs[M][M]

does not protect against replaysdoes not protect against replays could rely on timestamp in message, though could rely on timestamp in message, though

email delays make this problematicemail delays make this problematic

Page 36: Public Key

Public-Key ApproachesPublic-Key Approaches

have seen some public-key approacheshave seen some public-key approaches if confidentiality is major concern, can use:if confidentiality is major concern, can use:

AA->->B: EB: EPUbPUb[Ks] || E[Ks] || EKsKs[M][M] has encrypted session key, encrypted messagehas encrypted session key, encrypted message

if authentication needed use a digital if authentication needed use a digital signature with a digital certificate:signature with a digital certificate:AA->->B: M || EB: M || EPRaPRa[H(M)] || E[H(M)] || EPRasPRas[T||ID[T||IDAA||PU||PUaa] ] with message, signature, certificatewith message, signature, certificate

Page 37: Public Key

Digital Signature Digital Signature Standard Standard (DSS)(DSS)

US Govt approved signature schemeUS Govt approved signature scheme designed by NIST & NSA in early 90's designed by NIST & NSA in early 90's published as FIPS-186 in 1991published as FIPS-186 in 1991 revised in 1993, 1996 & then 2000revised in 1993, 1996 & then 2000 uses the SHA hash algorithm uses the SHA hash algorithm DSS is the standard, DSA is the algorithmDSS is the standard, DSA is the algorithm FIPS 186-2 (2000) includes alternative RSA & FIPS 186-2 (2000) includes alternative RSA &

elliptic curve signature variantselliptic curve signature variants

Page 38: Public Key

Digital Signature Digital Signature Algorithm Algorithm (DSA)(DSA)

creates a 320 bit signaturecreates a 320 bit signature with 512-1024 bit securitywith 512-1024 bit security smaller and faster than RSAsmaller and faster than RSA a digital signature scheme onlya digital signature scheme only security depends on difficulty of computing security depends on difficulty of computing

discrete logarithmsdiscrete logarithms variant of ElGamal & Schnorr schemesvariant of ElGamal & Schnorr schemes

Page 39: Public Key

Digital Signature Digital Signature Algorithm Algorithm (DSA)(DSA)

Page 40: Public Key

DSA Key GenerationDSA Key Generation

have shared global public key values (p,q,g): have shared global public key values (p,q,g): choose q, a 160 bit choose q, a 160 bit choose a large prime choose a large prime p = 2p = 2LL

• where L= 512 to 1024 bits and is a multiple of 64where L= 512 to 1024 bits and is a multiple of 64• and q is a prime factor of and q is a prime factor of (p-1)(p-1)

choose choose g = hg = h(p-1)/q(p-1)/q • where where h<p-1, hh<p-1, h(p-1)/q (p-1)/q (mod p) > 1(mod p) > 1

users choose private & compute public key: users choose private & compute public key: choose choose x<qx<q compute compute y = gy = gx x (mod p)(mod p)

Page 41: Public Key

DSA Signature CreationDSA Signature Creation

to to signsign a message a message MM the sender: the sender: generates a random signature key generates a random signature key k, k<qk, k<q nb. nb. kk must be random, be destroyed after must be random, be destroyed after

use, and never be reuseduse, and never be reused then computes signature pair: then computes signature pair:

r = (gr = (gkk(mod p))(mod q) (mod p))(mod q)

s = (ks = (k-1-1.H(M)+ x.r)(mod q).H(M)+ x.r)(mod q) sends signature sends signature (r,s)(r,s) with message with message MM

Page 42: Public Key

DSA Signature Verification DSA Signature Verification

having received M & having received M & signature signature (r,s)(r,s) to to verifyverify a signature, recipient computes: a signature, recipient computes:

w = sw = s-1-1(mod q) (mod q)

u1= (H(M).w)(mod q) u1= (H(M).w)(mod q)

u2= (r.w)(mod q) u2= (r.w)(mod q)

v = (gv = (gu1u1.y.yu2u2(mod p)) (mod q) (mod p)) (mod q) if if v=rv=r then signature is verified then signature is verified see book web site for details of proof whysee book web site for details of proof why

Page 43: Public Key

SummarySummary

have discussed:have discussed: digital signaturesdigital signatures authentication protocols (mutual & one-way)authentication protocols (mutual & one-way) digital signature algorithm and standarddigital signature algorithm and standard


Recommended