Module 3
Module 3
• Confidentiality
• Integrity
• Authentication
• Non repudiation
• No replay
Message Integrity and Message
Authentication
Message Integrity
• Techniques we have discussed so far
provides security or confidentiality but not
integrity.
• E.g death will
• One way of document integrity is
-signature or fingerprint .
• Electronics equivalent of the document
and fingerprint pair is the message and
digest pair.
Msg Hash Message
--- function digest
---
------
--------
------------
-
Checking Integrity
N
Msg
----= Y
------ Hash Current Same
?
--------- function digest
----------
Previous
digest
Message Authentication
• message authentication is concerned with:
– protecting the integrity of a message
– validating identity of originator
– non-repudiation of origin (dispute resolution)
• will consider the security requirements
• then three alternative functions used:
– message encryption
– message authentication code (MAC)
– hash function
Message Encryption
• message encryption by itself also provides a measure of
authentication
• if symmetric encryption is used then:
– receiver know sender must have created it
– since only sender and receiver know key used
– know content cannot of been altered
– if message has suitable structure, redundancy or a checksum to
detect any changes
Message Encryption
• if public-key encryption is used:
– encryption provides no confidence of sender
– since anyone potentially knows public-key
– however if
• sender signs message using their private-key
• then encrypts with recipients public key
• have both secrecy and authentication
– again need to recognize corrupted messages
– but at cost of two public-key uses on message
MDC
MAC
• Security of MAC is dependent on underlying
hash algorithm
Nested MAC
HMAC
Hash n bit
• H ((k+ xor opad) || H((k+ xor ipad) || M))
• Ipad 36
• Opad 5c
CMAC
CBC MAC
Using Symmetric Ciphers for MACs
input Message
Initial
128-bit vector
128-bit result
MD5 algorithm
• Padding –
length is 64 bit less than an integer multiple of 512 bits.
If 448(64 bit less than 512) then padding is ? N
1000 ? Y (1472 64 less 1536 = 3*512)
512 ? Y
• Append length –
64 bit length of msg , len mod 264 , data to hash = [Msg + padding +len]
• Initialize MD buffer – chaining variable A,B,C,D – 32 bit no
• Process message in 512 bit blocks –
Four rounds of processing on
1. i/p 512 bit data divided into 16 blocks of 32 bit each X[i]
2. chaining variable
3. uses one fourth of element table T[1---64] constructed
from sin function 2^32 * abs(sin(i))\
4. process g (different for each round) F,G,H,I
MD5: Padding
1 2 3 4
input Message
Initial Value
MD5 Transformation block by block
512: B1
512: B2
MD5
512: B3
MD5
512: B4
MD5
MD5
Result
Step 4.
Continued
(4 Rounds)
40
Step 4. Continued
41
Functions and Random
Numbers
• One of the primitive function on (b,c,d)
• Add a to above result
• Add X[k]
• Add T[i]
• Circular left shift of 32 bit by s bits
• Add b to the result (Add is modulo 2^32)
A=b+((a+P(b,c,d)+X[k]+T[i])<<<s)
• 1- F (b and c) or (not b and d)
• 2- G (b and d) or (c and d)
• 3- H b xor c xor d
• 4- I c xor (b or not d)
The MD5 Boolean Functions
The functions G, H, and I are similar to the function F, in that they
act in "bitwise parallel" to produce their output from the bits of X,
Y, and Z, in such a manner that if the corresponding bits of X, Y,
and Z are independent and unbiased, then each bit of G(X,Y,Z),
H(X,Y,Z), and I(X,Y,Z) will be independent and unbiased. Note that
the function H is the bit-wise "xor" or "parity" function of its
inputs.
44
Strength of MD5
• Every bit of hash code is function of every
bit in the input.
• To find message of given digest is order of
2^128 operations
• Difficult to come up with the 2 messages
having same hash
+
ft
CL +
S5
Wt
+
CLS3
Kt
0 +
A B C D E
Basic Logic Functions
• Only 3 different functions
4480afca4407400b035d9debeb88bfc402db514f
SHA Versus MD5
• SHA is a stronger algorithm:
– Brute-force birthday attacks requires on the
order of 280 operations vs. 264 for MD5
• SHA’s 80 steps and 160 bits hash (vs.
128) requires a little more computation
Tiger hash
• 192-bit hash values