Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 MAC and HASH Functions Unit 5

2 AUTHENTICATION REQUIREMENTS In the context of communications across a network, the following attacks can be identified: o Disclosure o Traffic analysis o Masquerade o Modification o Fabrication o Replay etc. In the context of communications across a network, the following attacks can be identified: o Disclosure o Traffic analysis o Masquerade o Modification o Fabrication o Replay etc.

3 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. 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.

4 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. 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.

5 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 a message of any length into a fixed length hash value, which serves as the authenticator. 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 a message of any length into a fixed length hash value, which serves as the authenticator.

6 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. 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.

7 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. 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.

8 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.

9 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. 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.

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

11 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. 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.

12 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 ) 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 )

13 Other Hash Function Uses to create a one-way password file o store hash of password not actual password for intrusion detection and virus detection o keep & check hash of files on system pseudorandom function (PRF) or pseudorandom number generator (PRNG) to create a one-way password file o store hash of password not actual password for intrusion detection and virus detection o keep & check hash of files on system pseudorandom function (PRF) or pseudorandom number generator (PRNG)

14 Cryptographic Hash Function

15 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) 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)

16 Two Simple Insecure Hash Functions consider two simple insecure hash functions bit-by-bit exclusive-OR (XOR) of every block o C i = b i1 xor b i2 xor... xor b im o a longitudinal redundancy check o reasonably effective as data integrity check one-bit circular shift on hash value o for each successive n-bit block rotate current hash value to left by1bit and XOR block o good for data integrity but useless for security consider two simple insecure hash functions bit-by-bit exclusive-OR (XOR) of every block o C i = b i1 xor b i2 xor... xor b im o a longitudinal redundancy check o reasonably effective as data integrity check one-bit circular shift on hash value o for each successive n-bit block rotate current hash value to left by1bit and XOR block o good for data integrity but useless for security

17 Simple Hash Function Using Bitwise XOR

18

19 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 resistance o find two messages x & y with same hash so H(x) = H(y) hence value 2 m/2 determines strength of hash code against brute-force attacks o 128-bits inadequate, 160-bits suspect 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 resistance o find two messages x & y with same hash so H(x) = H(y) hence value 2 m/2 determines strength of hash code against brute-force attacks o 128-bits inadequate, 160-bits suspect

20 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 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

21 birthday attack works thus: o Given user prepared to sign a valid message x o Opponent generate s2 m/2 variations x’ of x, all with essentially the same meaning, and saves them o Opponent generates 2 m/2 variations y’ of a desired fraudulent message y o 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 birthday attack works thus: o Given user prepared to sign a valid message x o Opponent generate s2 m/2 variations x’ of x, all with essentially the same meaning, and saves them o Opponent generates 2 m/2 variations y’ of a desired fraudulent message y o 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

22 Adversary selects the target message to be signed and an innocuous message that Alice is likely to want to sign. The adversary generates 2 n/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. Adversary selects the target message to be signed and an innocuous message that Alice is likely to want to sign. The adversary generates 2 n/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.

23 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. 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.

24 Requirements for MAC A MAC function should satisfy the following requirements.

25 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. 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.

26 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 signature o authenticate message contents o be verified by third parties to resolve disputes hence include authentication function with additional capabilities 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 signature o authenticate message contents o be verified by third parties to resolve disputes hence include authentication function with additional capabilities

27 Digital Signature Model

28 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 signature o with fraudulent digital signature for given message be practical save digital signature in storage 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 signature o with fraudulent digital signature for given message be practical save digital signature in storage

29 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 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

30 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 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

31 DSS vs RSA Signatures

32 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 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

33 DSA Key Generation have shared global public key values (p,q,g): o choose 160-bit prime number q o choose a large prime p with 2 L-1 < p < 2 L 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 1 users choose private & compute public key: o choose random private key: x<q o compute public key: y = g x mod p have shared global public key values (p,q,g): o choose 160-bit prime number q o choose a large prime p with 2 L-1 < p < 2 L 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 1 users choose private & compute public key: o choose random private key: x<q o compute public key: y = g x mod p

34 DSA Signature Creation to sign a message M the sender: o generates a random signature key k, k<q ok must be random, be destroyed after use, and never be reused then computes signature pair: r = (g k mod p)mod q s = [k -1 (H(M)+ xr)] mod q sends signature (r,s) with message M to sign a message M the sender: o generates a random signature key k, k<q ok must be random, be destroyed after use, and never be reused then computes signature pair: r = (g k mod p)mod q s = [k -1 (H(M)+ xr)] mod q sends signature (r,s) with message M

35 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 q v = [(g u1 y u2 )mod p ]mod q if v=r then signature is verified 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 q v = [(g u1 y u2 )mod p ]mod q if v=r then signature is verified

36 DSS Overview


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

Similar presentations


Ads by Google