SlideShare a Scribd company logo
 Similar to Message Digest
 Shared Symmetric (Secret) key is used for
encryption
 Message authentication is concerned with:
◦ protecting the integrity of a message
◦ validating identity of originator
◦ non-repudiation of origin (dispute resolution)
 consider the security requirements
 MAC generation of message using shared
symmetric (secret) key.
 Sends original message and MAC(H1)
 At receiver end, it receives original message and
MAC
 Receiver calculate MAC(H2) using key and
original message.
 Compare H1 & H2
◦ If H1!=H2 then, Message altered
◦ If H1==H2 then, Message not changed
 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
 As shown the MAC provides confidentiality
 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
 why use a MAC?
◦ sometimes only authentication is needed
◦ sometimes need authentication to persist longer than
the encryption (eg. archival use)
 Note that a MAC is not a digital signature
 HMAC stands for -Hash Message
Authentication Code
 Mandatory for security implementation for
Internet Protocol security.
 Idea of HMAC is to reuse existing Message-
Digest algorithms(such as MD5,SHA-1..)
 Uses shared symmetric key to encrypt
message digest.
 Variables used in HMAC
◦ MD = the message digest/hash function used(e.g.
MD5,SHA-1,etc.)
◦ M = the input message whose MAC is to be
calculated.
◦ L = the number of blocks in the message M.
◦ b = the numbers of bits in each block.
◦ K = the shared symmetric key to be used in HMAC.
◦ ipad = A string 00110110 repeated b/8 times.
◦ opad = A string 01011010 repeated b/8 times.
 STEP-1 Make the length of K equal to b.
 STEP-2 XOR K with lpad to produce S1.
 STEP-3 Append M to S1.
 STEP-4 Message-digest algorithm.
 STEP-5 XOR K with opad to produce S2.
 STEP-6 Append H to S2.
 STEP-7 Message-digest algorithm.
 STEP-1 Make the length of K equal to b.
◦ If length of K<b : add 0 bit as required to the left of k
◦ If length of K=b : In this case, we do not take any action, and
proceed to step 2.
◦ If length of K>b : we need to trim k, for this, we pass K through
the message-digest algorithm(H) selected for this particular
instance of HMAC
 STEP-2 XOR K with lpad to produce S1
◦ XOR K (the output of step 1) and ipad to produce a variable
called S1.
 STEP-3 Append M to S1
◦ Take the original message (M) and simply append it to the end of
S1.
 STEP-4 Message-digest algorithm
◦ The selected message-digest algorithm (e.g. MD5,SHA-l, etc.) is
applied to the output of step 3.
 STEP-5 XOR K with opad to produce S2
◦ XOR K (the output of step 1) with opad to produce a variable
called as S2.
 STEP-6 Append H to S2
◦ Append the message digest calculated in step 4 to the end of S2.
 STEP-7 Message-digest algorithm
◦ the selected message-digest algorithm (e.g. MD5, SHA-I, etc.) is
applied to the output of step 6 (i.e. to the concatenation of S2 and
H). This is the Final MAC that we want
1. Key exchange is main issue
2. Somehow the key-exchange problem is resolved,
HMAC cannot be used if the number of receivers is
greater than one.
3. If multiple parties share the same symmetric key.
How does a receiver know that the message was
prepared and sent by the sender
4. Replay of Message
Message Authentication Code & HMAC

More Related Content

What's hot

Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
ArthyR3
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
chauhankapil
 
Pgp
PgpPgp
CMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureCMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signature
Adarsh Patel
 
Keymanagement of ipsec
Keymanagement of ipsecKeymanagement of ipsec
Keymanagement of ipsec
PACHIYAPPAN PACHIYAPPAS
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
Kathirvel Ayyaswamy
 
S/MIME
S/MIMES/MIME
S/MIME
maria azam
 
Network security cryptographic hash function
Network security  cryptographic hash functionNetwork security  cryptographic hash function
Network security cryptographic hash function
Mijanur Rahman Milon
 
Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)
DUET
 
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
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
BharathiKrishna6
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
Tirthika Bandi
 
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
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
Rashmi Burugupalli
 
block ciphers
block ciphersblock ciphers
block ciphers
Asad Ali
 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)
SAurabh PRajapati
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
zahid-mian
 
Cryptography
CryptographyCryptography
Cryptography
jayashri kolekar
 
Symmetric & Asymmetric Cryptography
Symmetric & Asymmetric CryptographySymmetric & Asymmetric Cryptography
Symmetric & Asymmetric Cryptography
chauhankapil
 

What's hot (20)

Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
 
Pgp
PgpPgp
Pgp
 
IP Security
IP SecurityIP Security
IP Security
 
CMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureCMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signature
 
Keymanagement of ipsec
Keymanagement of ipsecKeymanagement of ipsec
Keymanagement of ipsec
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
S/MIME
S/MIMES/MIME
S/MIME
 
Network security cryptographic hash function
Network security  cryptographic hash functionNetwork security  cryptographic hash function
Network security cryptographic hash function
 
Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)Secure Hash Algorithm (SHA-512)
Secure Hash Algorithm (SHA-512)
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
Network security - OSI Security Architecture
Network security - OSI Security ArchitectureNetwork security - OSI Security Architecture
Network security - OSI Security Architecture
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Symmetric & Asymmetric Cryptography
Symmetric & Asymmetric CryptographySymmetric & Asymmetric Cryptography
Symmetric & Asymmetric Cryptography
 

Similar to Message Authentication Code & HMAC

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
 
Moein
MoeinMoein
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MAC
Sou Jana
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
ArthyR3
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3koolkampus
 
Cryptography and network_security
Cryptography and network_securityCryptography and network_security
Cryptography and network_security
Janani Satheshkumar
 
Cns
CnsCns
Cns
ArthyR3
 
unit - III.pptx
unit - III.pptxunit - III.pptx
unit - III.pptx
sandyBS
 
Transport layer security
Transport layer securityTransport layer security
Transport layer security
Hrudya Balachandran
 
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
 
Unit 3
Unit 3Unit 3
Unit 3
tamil arasan
 
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
 
Message authentication and hash function
Message authentication and hash functionMessage authentication and hash function
Message authentication and hash function
omarShiekh1
 
MD5 ALGORITHM.pptx
MD5 ALGORITHM.pptxMD5 ALGORITHM.pptx
MD5 ALGORITHM.pptx
Rajapriya82
 
Hash Function & Analysis
Hash Function & AnalysisHash Function & Analysis
Hash Function & Analysis
Pawandeep Kaur
 
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
 
Applied cryptanalysis - everything else
Applied cryptanalysis - everything elseApplied cryptanalysis - everything else
Applied cryptanalysis - everything else
Vlad Garbuz
 
Computer network (3)
Computer network (3)Computer network (3)
Computer network (3)
NYversity
 
Message authentication with md5
Message authentication with md5Message authentication with md5
Message authentication with md5
志璿 楊
 

Similar to Message Authentication Code & HMAC (20)

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
 
Moein
MoeinMoein
Moein
 
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MAC
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3
 
Cryptography and network_security
Cryptography and network_securityCryptography and network_security
Cryptography and network_security
 
Cns
CnsCns
Cns
 
unit - III.pptx
unit - III.pptxunit - III.pptx
unit - III.pptx
 
Transport layer security
Transport layer securityTransport layer security
Transport layer security
 
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
 
Transport layer security
Transport layer securityTransport layer security
Transport layer security
 
Unit 3
Unit 3Unit 3
Unit 3
 
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
 
Message authentication and hash function
Message authentication and hash functionMessage authentication and hash function
Message authentication and hash function
 
MD5 ALGORITHM.pptx
MD5 ALGORITHM.pptxMD5 ALGORITHM.pptx
MD5 ALGORITHM.pptx
 
Hash Function & Analysis
Hash Function & AnalysisHash Function & Analysis
Hash Function & Analysis
 
Message Authentication and Hash Function.pdf
Message Authentication and Hash Function.pdfMessage Authentication and Hash Function.pdf
Message Authentication and Hash Function.pdf
 
Applied cryptanalysis - everything else
Applied cryptanalysis - everything elseApplied cryptanalysis - everything else
Applied cryptanalysis - everything else
 
Computer network (3)
Computer network (3)Computer network (3)
Computer network (3)
 
Message authentication with md5
Message authentication with md5Message authentication with md5
Message authentication with md5
 

Recently uploaded

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

Message Authentication Code & HMAC

  • 1.
  • 2.  Similar to Message Digest  Shared Symmetric (Secret) key is used for encryption  Message authentication is concerned with: ◦ protecting the integrity of a message ◦ validating identity of originator ◦ non-repudiation of origin (dispute resolution)  consider the security requirements
  • 3.
  • 4.  MAC generation of message using shared symmetric (secret) key.  Sends original message and MAC(H1)  At receiver end, it receives original message and MAC  Receiver calculate MAC(H2) using key and original message.  Compare H1 & H2 ◦ If H1!=H2 then, Message altered ◦ If H1==H2 then, Message not changed
  • 5.  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
  • 6.
  • 7.  As shown the MAC provides confidentiality  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  why use a MAC? ◦ sometimes only authentication is needed ◦ sometimes need authentication to persist longer than the encryption (eg. archival use)  Note that a MAC is not a digital signature
  • 8.  HMAC stands for -Hash Message Authentication Code  Mandatory for security implementation for Internet Protocol security.  Idea of HMAC is to reuse existing Message- Digest algorithms(such as MD5,SHA-1..)  Uses shared symmetric key to encrypt message digest.
  • 9.
  • 10.  Variables used in HMAC ◦ MD = the message digest/hash function used(e.g. MD5,SHA-1,etc.) ◦ M = the input message whose MAC is to be calculated. ◦ L = the number of blocks in the message M. ◦ b = the numbers of bits in each block. ◦ K = the shared symmetric key to be used in HMAC. ◦ ipad = A string 00110110 repeated b/8 times. ◦ opad = A string 01011010 repeated b/8 times.
  • 11.  STEP-1 Make the length of K equal to b.  STEP-2 XOR K with lpad to produce S1.  STEP-3 Append M to S1.  STEP-4 Message-digest algorithm.  STEP-5 XOR K with opad to produce S2.  STEP-6 Append H to S2.  STEP-7 Message-digest algorithm.
  • 12.  STEP-1 Make the length of K equal to b. ◦ If length of K<b : add 0 bit as required to the left of k ◦ If length of K=b : In this case, we do not take any action, and proceed to step 2. ◦ If length of K>b : we need to trim k, for this, we pass K through the message-digest algorithm(H) selected for this particular instance of HMAC
  • 13.  STEP-2 XOR K with lpad to produce S1 ◦ XOR K (the output of step 1) and ipad to produce a variable called S1.
  • 14.  STEP-3 Append M to S1 ◦ Take the original message (M) and simply append it to the end of S1.
  • 15.  STEP-4 Message-digest algorithm ◦ The selected message-digest algorithm (e.g. MD5,SHA-l, etc.) is applied to the output of step 3.
  • 16.  STEP-5 XOR K with opad to produce S2 ◦ XOR K (the output of step 1) with opad to produce a variable called as S2.
  • 17.  STEP-6 Append H to S2 ◦ Append the message digest calculated in step 4 to the end of S2.
  • 18.  STEP-7 Message-digest algorithm ◦ the selected message-digest algorithm (e.g. MD5, SHA-I, etc.) is applied to the output of step 6 (i.e. to the concatenation of S2 and H). This is the Final MAC that we want
  • 19. 1. Key exchange is main issue 2. Somehow the key-exchange problem is resolved, HMAC cannot be used if the number of receivers is greater than one. 3. If multiple parties share the same symmetric key. How does a receiver know that the message was prepared and sent by the sender 4. Replay of Message

Editor's Notes

  1. Can also use block cipher chaining modes to create a separate authenticator, by just sending the last block. However this suffers from being a bit too small for acceptable use today.
  2. These are the specifications for good hash functions. Essentially it must be extremely difficult to find 2 messages with the same hash, and the hash should not be related to the message in any obvious way (ie it should be a complex non-linear function of the message). There are quite a few similarities in the evolution of hash functions &amp; block ciphers, and in the evolution of the design requirements on both.