SlideShare a Scribd company logo
COMPUTER SECURITY
MESSAGE AUTHENTICATION
Mr. RAJASEKAR RAMALINGAM
Faculty - Department of IT
College of Applied Sciences – Sur,
Sultanate of Oman.
vrrsekar@yahoo.com
CONTENT
1. MESSAGE SECURITY REQUIREMENTS
2. MESSAGE AUTHENTICATION
3. MESSAGE ENCRYPTION
4. HASH FUNCTIONS
5. MESSAGE AUTHENTICATION CODE (MAC)
6. HMAC
2MESSAGE AUTHENTICATION
1. MESSAGE SECURITY REQUIREMENTS
• In communications from a computer to computer, the following
attacks could be identified:
• Disclosure: Release of message contents
• Traffic analysis: Discovery of the pattern of traffic between parties
• Masquerade: Insertion of messages into the network from a
fraudulent source
• Content modification: Modification of the contents of a message
• Sequence modification: Modification to a sequence of messages
between parties
• Timing modification: Delay or replay of messages
• Source repudiation: Denial of transmission of message by source
• Destination repudiation: Denial of receipt of message by destination
3MESSAGE AUTHENTICATION
2. 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
• Three alternative functions used:
• Message encryption
• Hash functions
• Message Authentication Code (MAC)
4MESSAGE AUTHENTICATION
3. MESSAGE ENCRYPTION
3.1 SYMMETRIC MESSAGE ENCRYPTION
• Encryption can also provides authentication
• If symmetric encryption is used then:
• Receiver know sender must have created it
• Since only sender and receiver now key used
• Know content cannot of been altered
• If message has suitable structure, redundancy or a checksum to
detect any changes
5MESSAGE AUTHENTICATION
3.2 PUBLIC-KEY 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
6MESSAGE AUTHENTICATION
4. 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
Computationally infeasible to find data mapping to specific
hash (one-way property)
Computationally infeasible to find two data to same hash
(collision-free property)
7MESSAGE AUTHENTICATION
4.1 CRYPTOGRAPHIC HASH FUNCTION
• Figure depicts the general operation
of a cryptographic hash function.
• The input is padded out to an integer
multiple of some fixed length (e.g.,
1024 bits) and the padding includes
the value of the length of the original
message in bits.
• The length field is a security
measure to increase the difficulty for
an attacker to produce an alternative
message with the same hash value.
8MESSAGE AUTHENTICATION
4.2 HASH FUNCTIONS & MESSAGE AUTHENTICATION
• Message authentication is a mechanism or service used to verify
the integrity of a message, by assuring that the data received are
exactly as sent.
• Figure A, B, C and D illustrates a variety of ways in which a
hash code can be used to provide message authentication, as
follows:
9MESSAGE AUTHENTICATION
• The message plus concatenated hash code is encrypted using
symmetric encryption. Since 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.
A
10MESSAGE AUTHENTICATION
• Only the hash code is encrypted, using symmetric encryption. This
reduces the processing burden for those applications not requiring
confidentiality.
B
11MESSAGE AUTHENTICATION
C
• Shows the use of 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.
12MESSAGE AUTHENTICATION
• Confidentiality can be added to the approach of (c) by encrypting
the entire message plus the hash code.
D
13MESSAGE AUTHENTICATION
5. MESSAGE AUTHENTICATION CODE (MAC)
• Generated by an algorithm that creates a small fixed-sized block
• Depending on both message and some key
• Like encryption though need not be reversible
• Appended to message as a signature
• Receiver performs same computation on message and checks it
matches the MAC
• Provides assurance that message is unaltered and comes from
sender
14MESSAGE AUTHENTICATION
Message Authentication Code…
• A small fixed-sized block of data
• Generated from message + secret key
• MAC = C(K,M)
• Appended to message when sent
15MESSAGE AUTHENTICATION
5.1 MESSAGE AUTHENTICATION CODES
• As shown the MAC provides authentication
• Why use a MAC?
• sometimes only authentication is needed
• sometimes need authentication to persist longer than the
encryption (eg. archival use)
• Can also use encryption for secrecy
• generally use separate keys for each
• can compute MAC either before or after encryption
• is generally regarded as better done before
16MESSAGE AUTHENTICATION
5.2 MAC PROPERTIES
• A MAC is a cryptographic checksum
MAC = CK(M)
• condenses a variable-length message M
• using a secret key K
• to a fixed-sized authenticator
• Is a many-to-one function
• potentially many messages have same MAC
• but finding these needs to be very difficult
17MESSAGE AUTHENTICATION
6. HMAC
6.1 HMAC DESIGN OBJECTIVES
Use, without modifications, hash functions
Allow for easy re-placeability of embedded hash function
Preserve original performance of hash function without significant
degradation
Use and handle keys in a simple way.
Have well understood cryptographic analysis of authentication
mechanism strength
18MESSAGE AUTHENTICATION
HMAC…
• Uses hash function on the message:
HMACK(M)= Hash[(K+
XOR opad) ||
Hash[(K+
XOR ipad) || M)] ]
• where K+
is the key padded out to
size
• opad, ipad are specified padding
constants
• Overhead is just 3 more hash
calculations than the message needs
alone
• Any hash function can be used
• eg. MD5, SHA-1, RIPEMD-160,
Whirlpool
19MESSAGE AUTHENTICATION
HMAC Overview
Figure Illustrates the overall operation of HMAC:
HMACK = Hash[(K+
XOR opad) || Hash[(K+
XOR ipad) || M)]
where:
K+
is K padded with zeros on the left so that the result is b bits in length
ipad is a pad value of 36 hex repeated to fill block
opad is a pad value of 5C hex repeated to fill block
M is the message input to HMAC (including the padding specified in the embedded
hash function)
Note that the XOR with ipad results in flipping one-half of the bits of K. Similarly,
the XOR with opad results in flipping one-half of the bits of K, but a different set of
bits.
In effect, pseudo randomly generated two keys from K.MESSAGE AUTHENTICATION 20
• HMAC should execute in approximately the same time as the embedded
hash function for long messages.
• HMAC adds three executions of the hash compression function (for Si, So,
and the block produced from the inner hash).
• A more efficient implementation is possible by precomputing the internal
hash function on (K+
XOR opad) and (K+
XOR ipad) and inserting the
results into the hash processing at start & end.
• With this implementation, only one additional instance of the compression
function is added to the processing normally produced by the hash
function.
• This is especially worthwhile if most of the messages for which a MAC is
computed are short.
21MESSAGE AUTHENTICATION
6.2 HMAC SECURITY
• Proved security of HMAC relates to that of the underlying hash
algorithm
• Attacking HMAC requires either:
• Brute force attack on key used
• Birthday attack (but since keyed would need to observe a very large
number of messages)
• Choose hash function used based on speed verses security
constraints
MESSAGE AUTHENTICATION 22

More Related Content

What's hot

Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
Dr.Florence Dayana
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithmSHA- Secure hashing algorithm
SHA- Secure hashing algorithm
Ruchi Maurya
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
BharathiKrishna6
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
Rajapriya82
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
babak danyal
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
Devakumar Kp
 
block ciphers
block ciphersblock ciphers
block ciphers
Asad Ali
 
Pgp pretty good privacy
Pgp pretty good privacyPgp pretty good privacy
Pgp pretty good privacy
Pawan Arya
 
Email security
Email securityEmail security
Email security
Indrajit Sreemany
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
Chirag Patel
 
x.509-Directory Authentication Service
x.509-Directory Authentication Servicex.509-Directory Authentication Service
x.509-Directory Authentication Service
Swathy T
 
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail SecurityCRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
Jyothishmathi Institute of Technology and Science Karimnagar
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
Gopal Sakarkar
 
Kerberos : An Authentication Application
Kerberos : An Authentication ApplicationKerberos : An Authentication Application
Kerberos : An Authentication Application
Vidulatiwari
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Authentication techniques
Authentication techniquesAuthentication techniques
Authentication techniques
IGZ Software house
 
Operating system security
Operating system securityOperating system security
Operating system security
Ramesh Ogania
 

What's hot (20)

Symmetric and asymmetric key
Symmetric and asymmetric keySymmetric and asymmetric key
Symmetric and asymmetric key
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithmSHA- Secure hashing algorithm
SHA- Secure hashing algorithm
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
 
Security services and mechanisms
Security services and mechanismsSecurity services and mechanisms
Security services and mechanisms
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Pgp pretty good privacy
Pgp pretty good privacyPgp pretty good privacy
Pgp pretty good privacy
 
Email security
Email securityEmail security
Email security
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
x.509-Directory Authentication Service
x.509-Directory Authentication Servicex.509-Directory Authentication Service
x.509-Directory Authentication Service
 
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail SecurityCRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
CRYPTOGRAPHY AND NETWORK SECURITY- E-Mail Security
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
IP Security
IP SecurityIP Security
IP Security
 
Kerberos : An Authentication Application
Kerberos : An Authentication ApplicationKerberos : An Authentication Application
Kerberos : An Authentication Application
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Authentication techniques
Authentication techniquesAuthentication techniques
Authentication techniques
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Operating system security
Operating system securityOperating system security
Operating system security
 

Similar to Message authentication

Message authentication and hash function
Message authentication and hash functionMessage authentication and hash function
Message authentication and hash function
omarShiekh1
 
Information and data security cryptography and network security
Information and data security cryptography and network securityInformation and data security cryptography and network security
Information and data security cryptography and network security
Mazin Alwaaly
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
ArthyR3
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
ArthyR3
 
Cns
CnsCns
Cns
ArthyR3
 
Message auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptxMessage auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptx
aribariaz507
 
MACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block Ciphers
Maitree Patel
 
Information and network security 42 security of message authentication code
Information and network security 42 security of message authentication codeInformation and network security 42 security of message authentication code
Information and network security 42 security of message authentication code
Vaibhav Khanna
 
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MAC
Sou Jana
 
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKUNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
jeevasreemurali
 
unit - III.pptx
unit - III.pptxunit - III.pptx
unit - III.pptx
sandyBS
 
CNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed HashingCNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed Hashing
Sam Bowne
 
Meessage authentication and hash functions.pptx
Meessage authentication and hash functions.pptxMeessage authentication and hash functions.pptx
Meessage authentication and hash functions.pptx
JohnLagman3
 
Information and network security 41 message authentication code
Information and network security 41 message authentication codeInformation and network security 41 message authentication code
Information and network security 41 message authentication code
Vaibhav Khanna
 
BAIT1103 Chapter 2
BAIT1103 Chapter 2BAIT1103 Chapter 2
BAIT1103 Chapter 2limsh
 
Message Authentication: MAC, Hashes
Message Authentication: MAC, HashesMessage Authentication: MAC, Hashes
Message Authentication: MAC, Hashes
Shafaan Khaliq Bhatti
 
CNIT 1417. Keyed Hashing
CNIT 1417. Keyed HashingCNIT 1417. Keyed Hashing
CNIT 1417. Keyed Hashing
Sam Bowne
 
Message Authentication and Hash Function.pdf
Message Authentication and Hash Function.pdfMessage Authentication and Hash Function.pdf
Message Authentication and Hash Function.pdf
sunil sharma
 
Unit 3
Unit 3Unit 3
Unit 3
tamil arasan
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed Hashing
Sam Bowne
 

Similar to Message authentication (20)

Message authentication and hash function
Message authentication and hash functionMessage authentication and hash function
Message authentication and hash function
 
Information and data security cryptography and network security
Information and data security cryptography and network securityInformation and data security cryptography and network security
Information and data security cryptography and network security
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Cns
CnsCns
Cns
 
Message auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptxMessage auth. code Based on Hash Functions.pptx
Message auth. code Based on Hash Functions.pptx
 
MACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block Ciphers
 
Information and network security 42 security of message authentication code
Information and network security 42 security of message authentication codeInformation and network security 42 security of message authentication code
Information and network security 42 security of message authentication code
 
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MAC
 
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKUNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
 
unit - III.pptx
unit - III.pptxunit - III.pptx
unit - III.pptx
 
CNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed HashingCNIT 141: 7. Keyed Hashing
CNIT 141: 7. Keyed Hashing
 
Meessage authentication and hash functions.pptx
Meessage authentication and hash functions.pptxMeessage authentication and hash functions.pptx
Meessage authentication and hash functions.pptx
 
Information and network security 41 message authentication code
Information and network security 41 message authentication codeInformation and network security 41 message authentication code
Information and network security 41 message authentication code
 
BAIT1103 Chapter 2
BAIT1103 Chapter 2BAIT1103 Chapter 2
BAIT1103 Chapter 2
 
Message Authentication: MAC, Hashes
Message Authentication: MAC, HashesMessage Authentication: MAC, Hashes
Message Authentication: MAC, Hashes
 
CNIT 1417. Keyed Hashing
CNIT 1417. Keyed HashingCNIT 1417. Keyed Hashing
CNIT 1417. Keyed Hashing
 
Message Authentication and Hash Function.pdf
Message Authentication and Hash Function.pdfMessage Authentication and Hash Function.pdf
Message Authentication and Hash Function.pdf
 
Unit 3
Unit 3Unit 3
Unit 3
 
CNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed HashingCNIT 141 7. Keyed Hashing
CNIT 141 7. Keyed Hashing
 

More from CAS

CCNA 200-301 IPv6 addressing and subnetting MCQs Collection
CCNA 200-301 IPv6 addressing and subnetting MCQs CollectionCCNA 200-301 IPv6 addressing and subnetting MCQs Collection
CCNA 200-301 IPv6 addressing and subnetting MCQs Collection
CAS
 
RRB JE Stage 2 Computer and Applications Questions Part 5
RRB JE Stage 2 Computer and Applications Questions Part 5RRB JE Stage 2 Computer and Applications Questions Part 5
RRB JE Stage 2 Computer and Applications Questions Part 5
CAS
 
RRB JE Stage 2 Computer and Applications Questions Part 4
RRB JE Stage 2 Computer and Applications Questions Part 4RRB JE Stage 2 Computer and Applications Questions Part 4
RRB JE Stage 2 Computer and Applications Questions Part 4
CAS
 
RRB JE Stage 2 Computer and Applications Questions part 3
RRB JE Stage 2 Computer and Applications Questions part 3RRB JE Stage 2 Computer and Applications Questions part 3
RRB JE Stage 2 Computer and Applications Questions part 3
CAS
 
RRB JE Stage 2 Computer and Applications Questions Part 2
RRB JE Stage 2 Computer and Applications Questions Part 2RRB JE Stage 2 Computer and Applications Questions Part 2
RRB JE Stage 2 Computer and Applications Questions Part 2
CAS
 
RRB JE Stage 2 Computer and Applications Questions Part 1
RRB JE Stage 2 Computer and Applications  Questions Part 1RRB JE Stage 2 Computer and Applications  Questions Part 1
RRB JE Stage 2 Computer and Applications Questions Part 1
CAS
 
Introduction to IoT Security
Introduction to IoT SecurityIntroduction to IoT Security
Introduction to IoT Security
CAS
 
Introduction to research methodology
Introduction to research methodologyIntroduction to research methodology
Introduction to research methodology
CAS
 
Can you solve this
Can you solve thisCan you solve this
Can you solve this
CAS
 
Symmetric encryption and message confidentiality
Symmetric encryption and message confidentialitySymmetric encryption and message confidentiality
Symmetric encryption and message confidentiality
CAS
 
Public key cryptography and message authentication
Public key cryptography and message authenticationPublic key cryptography and message authentication
Public key cryptography and message authentication
CAS
 
Malicious software
Malicious softwareMalicious software
Malicious software
CAS
 
Legal and ethical aspects
Legal and ethical aspectsLegal and ethical aspects
Legal and ethical aspects
CAS
 
IT Security management and risk assessment
IT Security management and risk assessmentIT Security management and risk assessment
IT Security management and risk assessment
CAS
 
It security controls, plans, and procedures
It security controls, plans, and proceduresIt security controls, plans, and procedures
It security controls, plans, and procedures
CAS
 
Intrusion detection
Intrusion detectionIntrusion detection
Intrusion detection
CAS
 
Human resources security
Human resources securityHuman resources security
Human resources security
CAS
 
Database security
Database securityDatabase security
Database security
CAS
 
Cryptographic tools
Cryptographic toolsCryptographic tools
Cryptographic tools
CAS
 
Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)
CAS
 

More from CAS (20)

CCNA 200-301 IPv6 addressing and subnetting MCQs Collection
CCNA 200-301 IPv6 addressing and subnetting MCQs CollectionCCNA 200-301 IPv6 addressing and subnetting MCQs Collection
CCNA 200-301 IPv6 addressing and subnetting MCQs Collection
 
RRB JE Stage 2 Computer and Applications Questions Part 5
RRB JE Stage 2 Computer and Applications Questions Part 5RRB JE Stage 2 Computer and Applications Questions Part 5
RRB JE Stage 2 Computer and Applications Questions Part 5
 
RRB JE Stage 2 Computer and Applications Questions Part 4
RRB JE Stage 2 Computer and Applications Questions Part 4RRB JE Stage 2 Computer and Applications Questions Part 4
RRB JE Stage 2 Computer and Applications Questions Part 4
 
RRB JE Stage 2 Computer and Applications Questions part 3
RRB JE Stage 2 Computer and Applications Questions part 3RRB JE Stage 2 Computer and Applications Questions part 3
RRB JE Stage 2 Computer and Applications Questions part 3
 
RRB JE Stage 2 Computer and Applications Questions Part 2
RRB JE Stage 2 Computer and Applications Questions Part 2RRB JE Stage 2 Computer and Applications Questions Part 2
RRB JE Stage 2 Computer and Applications Questions Part 2
 
RRB JE Stage 2 Computer and Applications Questions Part 1
RRB JE Stage 2 Computer and Applications  Questions Part 1RRB JE Stage 2 Computer and Applications  Questions Part 1
RRB JE Stage 2 Computer and Applications Questions Part 1
 
Introduction to IoT Security
Introduction to IoT SecurityIntroduction to IoT Security
Introduction to IoT Security
 
Introduction to research methodology
Introduction to research methodologyIntroduction to research methodology
Introduction to research methodology
 
Can you solve this
Can you solve thisCan you solve this
Can you solve this
 
Symmetric encryption and message confidentiality
Symmetric encryption and message confidentialitySymmetric encryption and message confidentiality
Symmetric encryption and message confidentiality
 
Public key cryptography and message authentication
Public key cryptography and message authenticationPublic key cryptography and message authentication
Public key cryptography and message authentication
 
Malicious software
Malicious softwareMalicious software
Malicious software
 
Legal and ethical aspects
Legal and ethical aspectsLegal and ethical aspects
Legal and ethical aspects
 
IT Security management and risk assessment
IT Security management and risk assessmentIT Security management and risk assessment
IT Security management and risk assessment
 
It security controls, plans, and procedures
It security controls, plans, and proceduresIt security controls, plans, and procedures
It security controls, plans, and procedures
 
Intrusion detection
Intrusion detectionIntrusion detection
Intrusion detection
 
Human resources security
Human resources securityHuman resources security
Human resources security
 
Database security
Database securityDatabase security
Database security
 
Cryptographic tools
Cryptographic toolsCryptographic tools
Cryptographic tools
 
Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)Internet security association and key management protocol (isakmp)
Internet security association and key management protocol (isakmp)
 

Recently uploaded

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Message authentication

  • 1. COMPUTER SECURITY MESSAGE AUTHENTICATION Mr. RAJASEKAR RAMALINGAM Faculty - Department of IT College of Applied Sciences – Sur, Sultanate of Oman. vrrsekar@yahoo.com
  • 2. CONTENT 1. MESSAGE SECURITY REQUIREMENTS 2. MESSAGE AUTHENTICATION 3. MESSAGE ENCRYPTION 4. HASH FUNCTIONS 5. MESSAGE AUTHENTICATION CODE (MAC) 6. HMAC 2MESSAGE AUTHENTICATION
  • 3. 1. MESSAGE SECURITY REQUIREMENTS • In communications from a computer to computer, the following attacks could be identified: • Disclosure: Release of message contents • Traffic analysis: Discovery of the pattern of traffic between parties • Masquerade: Insertion of messages into the network from a fraudulent source • Content modification: Modification of the contents of a message • Sequence modification: Modification to a sequence of messages between parties • Timing modification: Delay or replay of messages • Source repudiation: Denial of transmission of message by source • Destination repudiation: Denial of receipt of message by destination 3MESSAGE AUTHENTICATION
  • 4. 2. 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 • Three alternative functions used: • Message encryption • Hash functions • Message Authentication Code (MAC) 4MESSAGE AUTHENTICATION
  • 5. 3. MESSAGE ENCRYPTION 3.1 SYMMETRIC MESSAGE ENCRYPTION • Encryption can also provides authentication • If symmetric encryption is used then: • Receiver know sender must have created it • Since only sender and receiver now key used • Know content cannot of been altered • If message has suitable structure, redundancy or a checksum to detect any changes 5MESSAGE AUTHENTICATION
  • 6. 3.2 PUBLIC-KEY 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 6MESSAGE AUTHENTICATION
  • 7. 4. 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 Computationally infeasible to find data mapping to specific hash (one-way property) Computationally infeasible to find two data to same hash (collision-free property) 7MESSAGE AUTHENTICATION
  • 8. 4.1 CRYPTOGRAPHIC HASH FUNCTION • Figure depicts the general operation of a cryptographic hash function. • The input is padded out to an integer multiple of some fixed length (e.g., 1024 bits) and the padding includes the value of the length of the original message in bits. • The length field is a security measure to increase the difficulty for an attacker to produce an alternative message with the same hash value. 8MESSAGE AUTHENTICATION
  • 9. 4.2 HASH FUNCTIONS & MESSAGE AUTHENTICATION • Message authentication is a mechanism or service used to verify the integrity of a message, by assuring that the data received are exactly as sent. • Figure A, B, C and D illustrates a variety of ways in which a hash code can be used to provide message authentication, as follows: 9MESSAGE AUTHENTICATION
  • 10. • The message plus concatenated hash code is encrypted using symmetric encryption. Since 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. A 10MESSAGE AUTHENTICATION
  • 11. • Only the hash code is encrypted, using symmetric encryption. This reduces the processing burden for those applications not requiring confidentiality. B 11MESSAGE AUTHENTICATION
  • 12. C • Shows the use of 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. 12MESSAGE AUTHENTICATION
  • 13. • Confidentiality can be added to the approach of (c) by encrypting the entire message plus the hash code. D 13MESSAGE AUTHENTICATION
  • 14. 5. MESSAGE AUTHENTICATION CODE (MAC) • Generated by an algorithm that creates a small fixed-sized block • Depending on both message and some key • Like encryption though need not be reversible • Appended to message as a signature • Receiver performs same computation on message and checks it matches the MAC • Provides assurance that message is unaltered and comes from sender 14MESSAGE AUTHENTICATION
  • 15. Message Authentication Code… • A small fixed-sized block of data • Generated from message + secret key • MAC = C(K,M) • Appended to message when sent 15MESSAGE AUTHENTICATION
  • 16. 5.1 MESSAGE AUTHENTICATION CODES • As shown the MAC provides authentication • Why use a MAC? • sometimes only authentication is needed • sometimes need authentication to persist longer than the encryption (eg. archival use) • Can also use encryption for secrecy • generally use separate keys for each • can compute MAC either before or after encryption • is generally regarded as better done before 16MESSAGE AUTHENTICATION
  • 17. 5.2 MAC PROPERTIES • A MAC is a cryptographic checksum MAC = CK(M) • condenses a variable-length message M • using a secret key K • to a fixed-sized authenticator • Is a many-to-one function • potentially many messages have same MAC • but finding these needs to be very difficult 17MESSAGE AUTHENTICATION
  • 18. 6. HMAC 6.1 HMAC DESIGN OBJECTIVES Use, without modifications, hash functions Allow for easy re-placeability of embedded hash function Preserve original performance of hash function without significant degradation Use and handle keys in a simple way. Have well understood cryptographic analysis of authentication mechanism strength 18MESSAGE AUTHENTICATION
  • 19. HMAC… • Uses hash function on the message: HMACK(M)= Hash[(K+ XOR opad) || Hash[(K+ XOR ipad) || M)] ] • where K+ is the key padded out to size • opad, ipad are specified padding constants • Overhead is just 3 more hash calculations than the message needs alone • Any hash function can be used • eg. MD5, SHA-1, RIPEMD-160, Whirlpool 19MESSAGE AUTHENTICATION
  • 20. HMAC Overview Figure Illustrates the overall operation of HMAC: HMACK = Hash[(K+ XOR opad) || Hash[(K+ XOR ipad) || M)] where: K+ is K padded with zeros on the left so that the result is b bits in length ipad is a pad value of 36 hex repeated to fill block opad is a pad value of 5C hex repeated to fill block M is the message input to HMAC (including the padding specified in the embedded hash function) Note that the XOR with ipad results in flipping one-half of the bits of K. Similarly, the XOR with opad results in flipping one-half of the bits of K, but a different set of bits. In effect, pseudo randomly generated two keys from K.MESSAGE AUTHENTICATION 20
  • 21. • HMAC should execute in approximately the same time as the embedded hash function for long messages. • HMAC adds three executions of the hash compression function (for Si, So, and the block produced from the inner hash). • A more efficient implementation is possible by precomputing the internal hash function on (K+ XOR opad) and (K+ XOR ipad) and inserting the results into the hash processing at start & end. • With this implementation, only one additional instance of the compression function is added to the processing normally produced by the hash function. • This is especially worthwhile if most of the messages for which a MAC is computed are short. 21MESSAGE AUTHENTICATION
  • 22. 6.2 HMAC SECURITY • Proved security of HMAC relates to that of the underlying hash algorithm • Attacking HMAC requires either: • Brute force attack on key used • Birthday attack (but since keyed would need to observe a very large number of messages) • Choose hash function used based on speed verses security constraints MESSAGE AUTHENTICATION 22

Editor's Notes

  1. One of the most fascinating and complex areas of cryptography is that of message authentication and the related area of digital signatures. We now consider how to protect message integrity (ie protection from modification), as well as confirming the identity of the sender. Generically this is the problem of message authentication, and in eCommerce applications is arguably more important than secrecy. Message Authentication is concerned with: protecting the integrity of a message, validating identity of originator, & non-repudiation of origin (dispute resolution). There are three types of functions that may be used to produce an authenticator: a hash function, message encryption, message authentication code (MAC). Hash functions, and how they may serve for message authentication, are discussed in Chapter 11. The remainder of this section briefly examines the remaining two topics. The remainder of the chapter elaborates on the topic of MACs.
  2. Message encryption by itself can provide a measure of authentication. The analysis differs for symmetric and public-key encryption schemes. If use symmetric encryption, If no other party knows the key, then confidentiality is provided. As well, symmetric encryption provides authentication as well as confidentiality, since only the other party can have encrypted a properly constructed message (Stallings Figure 12.1a). Here, the ciphertext of the entire message serves as its authenticator, on the basis that only those who know the appropriate keys could have validly encrypted the message. This is provided you can recognize a valid message (ie if the message has suitable structure such as redundancy or a checksum to detect any changes).
  3. With public-key techniques, can use a digital signature which can only have been created by key owner to validate the integrity of the message contents. To provide both confidentiality and authentication, A can encrypt M first using its private key, which provides the digital signature, and then using B's public key, which provides confidentiality (Stallings Figure 12.1d). The disadvantage of this approach is that the public-key algorithm, which is complex, must be exercised four times rather than two in each communication.
  4. An alternative authentication technique involves the use of a secret key to generate a small fixed-size block of data, known as a cryptographic checksum or MAC that is appended to the message. This technique assumes that two communicating parties, say A and B, share a common secret key K. A MAC function is similar to encryption, except that the MAC algorithm need not be reversible, as it must for decryption.
  5. An alternative authentication technique involves the use of a secret key to generate a small fixed- size block of data, known as a cryptographic checksum or MAC that is appended to the message. This technique assumes that two communicating parties, say A and B, share a common secret key K. When A has a message to send to B, it calculates the MAC as a function of the message and the key: MAC = C(K, M). The message plus MAC are transmitted to the intended recipient. The recipient performs the same calculation on the received message, using the same secret key, to generate a new MAC. The received MAC is compared to the calculated MAC (Stallings Figure 12.4a). If we assume that only the receiver and the sender know the identity of the secret key, and if the received MAC matches the calculated MAC, then the receiver is assured that the message has not been altered, is from the alleged sender, and if the message includes a sequence number then the receiver can be assured of the proper sequence because an attacker cannot successfully alter the sequence number. A MAC function is similar to encryption. One difference is that the MAC algorithm need not be reversible, as it must for decryption. In general, the MAC function is a many-to-one function.
  6. The process depicted on the previous slide provides authentication but not confidentiality, because the message as a whole is transmitted in the clear. Confidentiality can be provided by performing message encryption either after (see Stallings Figure 12.4b) or before (see Stallings Figure 12.4c) the MAC algorithm. In both these cases, two separate keys are needed, each of which is shared by the sender and the receiver. Typically, it is preferable to tie the authentication directly to the plaintext, so the method of Figure 12.4b is used. Can use MAC in circumstances where just authentication is needed (or needs to be kept), see text for examples (e.g. such as when the same message is broadcast to a number of destinations; when one side has a heavy load and cannot afford the time to decrypt all incoming messages; or do not need to keep messages secret, but must authenticate messages). Finally, note that the MAC does not provide a digital signature because both sender and receiver share the same key.
  7. A MAC (also known as a cryptographic checksum, fixed-length authenticator, or tag) is generated by a function C. The MAC 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 MAC. The MAC function is a many-to-one function, since potentially many arbitrarily long messages can be condensed to the same summary value, but don’t want finding them to be easy (see text for discussion)!
  8. RFC 2104 lists the following design objectives for HMAC: • To use, without modifications, available hash functions. In particular, hash functions that perform well in software, and for which code is freely and widely available. • To allow for easy replaceability of the embedded hash function in case faster or more secure hash functions are found or required. • To preserve the original performance of the hash function without incurring a significant degradation. • To use and handle keys in a simple way. • To have a well understood cryptographic analysis of the strength of the authentication mechanism based on reasonable assumptions about the embedded hash function.
  9. The idea of a keyed hash evolved into HMAC, designed to overcome some problems with the original proposals. It involves hashing padded versions of the key concatenated with the message, and then with another outer hash of the result prepended by another padded variant of the key. The hash function need only be used on 3 more blocks than when hashing just the original message (for the two keys + inner hash). HMAC can use any desired hash function, and has been shown to have the same security as the underlying hash function. Can choose the hash function to use based on speed/security concerns.
  10. The appeal of HMAC is that its designers have been able to prove an exact relationship between the strength of the embedded hash function and the strength of HMAC. The security of a MAC function is generally expressed in terms of the probability of successful forgery with a given amount of time spent by the forger and a given number of message-MAC pairs created with the same key. Have two classes of attacks: brute force attack on key used which has work of order 2^n; or a birthday attack which requires work of order 2^(n/2) - but which requires the attacker to observe 2^n blocks of messages using the same key - very unlikely. For a hash code length of 128 bits, this requires 264 observed blocks (272 bits) generated using the same key. On a 1-Gbps link, one would need to observe a continuous stream of messages with no change in key for about 150,000 years in order to succeed. So even MD5 is still secure for use in HMAC given these constraints.