Top Banner
MAC and HASH Functions Unit 5
36

MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Dec 25, 2015

Download

Documents

Antony Garrett
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

MAC and HASH

FunctionsUnit 5

Page 2: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

AUTHENTICATION REQUIREMENTS

• In the context of communications across a network, the following attacks can be identified:o Disclosureo Traffic analysiso Masqueradeo Modificationo Fabricationo Replay etc.

Page 3: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• Message authentication is a procedure to verify that received messages come from the alleged source and have not been altered.

• Message authentication may also verify sequencing and timeliness.

• A digital signature is an authentication technique that also includes measures to counter repudiation by either source or destination.

• Any message authentication or digital signature mechanism can be viewed as having fundamentally two levels.

Page 4: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• At the lower level, there must be some sort of function that produces an authenticator: a value to be used to authenticate a message.

• This lower-level function is then used as primitive in a higher-level authentication protocol that enables a receiver to verify the authenticity of a message.

Page 5: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• These functions may be grouped into three classes, as follows:

1. Message Encryption: The cipher text of the entire message serves as its authenticator.

2. Message Authentication Code (MAC): A public function of the message and a secret key that produces a fixed length value that serves as the authenticator.

3. Hash Functions: A public function that maps amessage of any length into a fixed length hash value, which serves as the authenticator.

Page 6: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Hash Functions• A public function that maps a message of any

length into a fixed length hash value, which serves as the authenticator.

• A hash value is generated by a function H of the form: h = H(M)

• Where M is a variable-length message, and H(M) is the fixed length hash value (also referred to as a message digest or hash code).

• The below figure shows the basic use of Hash Functions.

Page 7: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• The message plus concatenated hash code is encrypted using symmetric encryption. Because only A and B share the secret key, the message must have come from A and has not been altered.

• The hash code provides the structure or redundancy required to achieve authentication. Because encryption is applied to the entire message plus hash code, confidentiality is also provided.

Page 8: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Basic use of Hash Function

• Only the hash code is encrypted, using symmetric encryption. This reduces the processing burden for those applications that do not require confidentiality.

Page 9: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• It is possible to use a hash function but no encryption for message authentication. The technique assumes that the two communicating parties share a common secret value S.

• A computes the hash value over the concatenation of M and S and appends the resulting hash value to M.

• Because B possesses S, it can re-compute the hash value to verify.

• Because the secret value itself is not sent, an opponent cannot modify an intercepted message and cannot generate a false message.

Page 10: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• Confidentiality can be added to the approach by encrypting the entire message plus the hash code.

Page 11: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• Several reasons for no interest in encryption are pointed out as: o Encryption software is relatively slow. Even though the

amount of data to be encrypted per message is small, there may be a steady stream of messages into and out of a system.

o Encryption hardware costs are not negligible. Low-cost chip implementations of DES are available, but the cost adds up if all nodes in a network must have this capability.

o Encryption hardware is optimized toward large data sizes. For small blocks of data, a high proportion of the time is spent in initialization/invocation overhead.

o Encryption algorithms may be covered by patents, and there is a cost associated with licensing their use.

Page 12: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Hash Functions :• Condenses arbitrary message to fixed size

h = H(M) • usually assume hash function is public• hash used to detect changes to message• want a cryptographic hash function

o computationally infeasible to find data mapping to specific hash (one-way property)

o computationally infeasible to find two data to same hash (collision-free property)

Page 13: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Other Hash Function Uses

• to create a one-way password fileo store hash of password not actual password

• for intrusion detection and virus detectiono keep & check hash of files on system

• pseudorandom function (PRF) or pseudorandom number generator (PRNG)

Page 14: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Cryptographic Hash Function

Page 15: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Requirements for a Hash Function.

1. H can be applied to a block of any size.2. H produces a fixed length output.3. H is relatively easy to compute for any given X.4. H should be a one way function.5. For any given block is computationally infeasible

to find y ≠ x such that H(y)= H(x). ( Weak collision resistance)

6. It is computationally infeasible to find any pair (x,y) such that H(y)= H(x). (Strong collision resistance)

Page 16: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Two Simple Insecure Hash Functions

• consider two simple insecure hash functions• bit-by-bit exclusive-OR (XOR) of every block

o Ci = bi1 xor bi2 xor . . . xor bim

o a longitudinal redundancy checko reasonably effective as data integrity check

• one-bit circular shift on hash valueo for each successive n-bit block

• rotate current hash value to left by1bit and XOR blocko good for data integrity but useless for security

Page 17: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Simple Hash Function Using

Bitwise XOR

Page 18: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:
Page 19: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Attacks on Hash Functions

• have brute-force attacks and cryptanalysis• a pre image or second pre image attack

o find y s.t. H(y) equals a given hash value

• collision resistanceo find two messages x & y with same hash so H(x) = H(y)

• hence value 2m/2 determines strength of hash code against brute-force attackso 128-bits inadequate, 160-bits suspect

Page 20: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Birthday Attacks

• Might think a 64 bit hash is secure but by Birthday Paradox is not!

• A birthday attack is a name used to refer to a class of brute-force attacks.

• It gets its name from the surprising result that the probability that two or more people in a group of 23 share the same birthday is greater than 1/2; such a result is called a birthday paradox.

• Birthday attacks are often used to find collisions of hash functions

Page 21: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• birthday attack works thus: o Given user prepared to sign a valid message x o Opponent generate s2m/2 variations x’ of x , all with essentially

the same meaning, and saves themo Opponent generates 2m/2 variations y’ of a desired fraudulent

message yo two sets of messages are compared to find pair with same

hash (probability > 0.5 by birthday paradox) o have user sign the valid message, then substitute the forgery

which will have a valid signature

Page 22: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

• Adversary selects the target message to be signed and an innocuous message that Alice is likely to want to sign.

• The adversary generates 2n/2 variations of the innocuous message (by making, for instance, minor editorial changes), all of which convey the same meaning, and their corresponding message digests.

• He then generates an equal number of variations of the target message to be substituted.

• The probability that one of the variations of the innocuous message will match one of the variations of the target message is greater than 1/2 according to the birthday paradox.

• The adversary then obtains Alice's signature on the variation of the innocuous message.

• The signature from the innocuous message is removed and attached to the variation of the target message that generates the same message digest. The adversary has successfully forged the message without discovering the enciphering keys.

• To avoid an attack that depends on brute-force methods, the output from the hash function must be sufficiently long.

Page 23: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

MAC• Message authentication is a mechanism or service

used to verify the integrity of a message.• Message authentication assures that data

received are exactly as sent by (i.e., contain no modification, insertion, deletion, or replay) and that the purported identity of the sender is valid.

• More commonly, message authentication is achieved using a Message Authentication Code (MAC), also known as a keyed hash function.

• Typically, MACs are used between two parties that share a secret key to authenticate information exchanged between those parties.

Page 24: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Requirements for MAC• A MAC function should satisfy the following

requirements.

Page 25: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

MAC• A MAC, also known as a cryptographic

checksum, is generated by a function C of the form

T = MAC(K, M) • where M is a variable-length message, K is a

secret key shared only by sender and receiver, and MAC(K, M) is the fixed-length authenticator, sometimes called a tag.

• The tag is appended to the message at the source at a time when the message is assumed or known to be correct.

• The receiver authenticates that message by re-computing the tag.

Page 26: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Digital Signatures

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

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

• hence include authentication function with additional capabilities

Page 27: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Digital Signature Model

Page 28: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Digital Signature Requirements

• must depend on the message signed• must use information unique to sender

o to prevent both forgery and denial

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

o with new message for existing digital signatureo with fraudulent digital signature for given message

• be practical save digital signature in storage

Page 29: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Direct Digital Signatures• involve only sender & receiver• assumed receiver has sender’s public-key• digital signature made by sender signing entire message

or hash with private-key• can encrypt using receivers public-key• important that sign first then encrypt message &

signature• security depends on sender’s private-key

Page 30: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Digital Signature Standard (DSS)• US Govt approved signature scheme• designed by NIST & NSA in early 90's • published as FIPS-186 in 1991• revised in 1993, 1996 & then 2000• uses the SHA hash algorithm • DSS is the standard, DSA is the algorithm• DSA is digital signature only unlike RSA is a

public-key technique

Page 31: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

DSS vs RSA Signatures

Page 32: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

Digital Signature Algorithm (DSA)• creates a 320 bit signature• with 512-1024 bit security• smaller and faster than RSA• a digital signature scheme only• security depends on difficulty of computing discrete

logarithms

Page 33: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

DSA Key Generation• have shared global public key values (p,q,g):

o choose 160-bit prime number qo choose a large prime p with 2L-1 < p < 2L

• where L= 512 to 1024 bits and is a multiple of 64• such that q is a 160 bit prime divisor of (p-1)

o choose g = h(p-1)/q • where 1<h<p-1 and h(p-1)/q mod p > 1

• users choose private & compute public key: o choose random private key: x<q o compute public key: y = gx mod p

Page 34: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

DSA Signature Creation• to sign a message M the sender:

o generates a random signature key k, k<q o k must be random, be destroyed after use, and never be reused

• then computes signature pair: r = (gk mod p)mod q s = [k-1(H(M)+ xr)] mod q

• sends signature (r,s) with message M

Page 35: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

DSA Signature Verification • having received M & signature (r,s) • to verify a signature, recipient computes:

w = s-1 mod q u1= [H(M)w ]mod q

u2= (rw)mod qv = [(gu1 yu2)mod p ]mod q

• if v=r then signature is verified

Page 36: MAC and HASH Functions Unit 5. AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified:

DSS Overview