SlideShare uma empresa Scribd logo
1 de 9
The Keyed-Hash Message
Authentication Code

HMAC
FIPS-198-1

http://www.youtube.com/zarigatongy
Follow Me @
http://youtube.com/zarigatongy

http://www.youtube.com/zarigatongy
HMAC Illustration

http://www.youtube.com/zarigatongy
Introduction
Typically, message authentication codes are
used between two parties that share a secret
key in order to authenticate information
transmitted between these parties. This
Standard defines a MAC that uses a
cryptographic hash function in conjunction with
a secret key in order to authenticate information
transmitted between these parties

http://www.youtube.com/zarigatongy
HMAC Uses
• HMAC whenever you want integrity of the data
maintained (and authenticity)
• The key is part of the HMAC, since it is a shared
secret known between 2 parties only and only
they can create the HMAC and no one else.
(Ensures authenticity)
• Length extension attacks are not possible on
HMAC. MAC's on the other hand simply appends
key to the message, which is susceptible to it.
HMAC was introduced to overcome this attack on
MAC's.
http://www.youtube.com/zarigatongy
HMAC Specification
• To compute a MAC over the data ‘text’ using
the HMAC function, the following operation is
performed:
MAC(text)=HMAC(K, text) = H((K0⊕opad)|| H((K0⊕ipad) ||
text))
Terms
• K= Secret Key,
• K0=The key K after any necessary pre-processing to form a B
byte key.
• ⊕ = Exclusive OR
• ipad=Inner Pad, the byte x’36‘ repeated B times.
http://www.youtube.com/zarigatongy
• opad=Outer Pad, the byte x‘5c‘ repeated B times.
HMAC Construction

http://www.youtube.com/zarigatongy
Example : bash to calculate HMAC
#echo -n "value" | openssl dgst -sha1 -hmac
"key"
57443a4c052350a44638835d64fd66822f813319

#echo -n "value" | openssl sha1 -hmac "key"
57443a4c052350a44638835d64fd66822f813319

#echo '<?= hash_hmac("sha1", "value", "key")
?>' | php
57443a4c052350a44638835d64fd66822f813319

http://www.youtube.com/zarigatongy
More Protocol Tutorials
•
•
•
•
•
•
•
•
•
•

AES Tutorial Click Here
X.509 Certificate
SSL Protocol Click here
DHCPv6 Protocol Click Here
CHAP Protocol Click Here
ISCSI Protocol Tutorial Click Here
BGP Tutorial Click Here
RADIUS Protocol Click Here
PPP Protocol Click Here
PPPoE Protocol Click Here
http://youtube.com/zarigatongy

Mais conteúdo relacionado

Destaque (14)

Keisitimewaan ekonomi islam
Keisitimewaan ekonomi islamKeisitimewaan ekonomi islam
Keisitimewaan ekonomi islam
 
Lançamento concurso
Lançamento concursoLançamento concurso
Lançamento concurso
 
Aula 01
Aula 01Aula 01
Aula 01
 
Presentation1
Presentation1Presentation1
Presentation1
 
Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...
Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...
Arte em fuga: artistas, coleccionadores e merchands refugiados em Portugal du...
 
USPTO DESIGN PATENT
USPTO DESIGN PATENTUSPTO DESIGN PATENT
USPTO DESIGN PATENT
 
Marketing viral DA TEORIA A PRATICA
Marketing viral  DA TEORIA A PRATICAMarketing viral  DA TEORIA A PRATICA
Marketing viral DA TEORIA A PRATICA
 
uni
uniuni
uni
 
Plantillas hosteleria 2
Plantillas hosteleria 2Plantillas hosteleria 2
Plantillas hosteleria 2
 
DMG v4
DMG v4DMG v4
DMG v4
 
P Gafoor document0001
P Gafoor document0001P Gafoor document0001
P Gafoor document0001
 
БЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООД
БЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООДБЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООД
БЪЛГЕРИЪН ЛОДЖИСТИК КЪМПАНИ ЕООД
 
LINKED IN PRESENTATION
LINKED IN PRESENTATIONLINKED IN PRESENTATION
LINKED IN PRESENTATION
 
Revista Info Ceará
Revista Info Ceará Revista Info Ceará
Revista Info Ceará
 

Último

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Último (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

Hmac The Keyed-Hash Message Authentication Code (HMAC)

  • 1. The Keyed-Hash Message Authentication Code HMAC FIPS-198-1 http://www.youtube.com/zarigatongy
  • 4. Introduction Typically, message authentication codes are used between two parties that share a secret key in order to authenticate information transmitted between these parties. This Standard defines a MAC that uses a cryptographic hash function in conjunction with a secret key in order to authenticate information transmitted between these parties http://www.youtube.com/zarigatongy
  • 5. HMAC Uses • HMAC whenever you want integrity of the data maintained (and authenticity) • The key is part of the HMAC, since it is a shared secret known between 2 parties only and only they can create the HMAC and no one else. (Ensures authenticity) • Length extension attacks are not possible on HMAC. MAC's on the other hand simply appends key to the message, which is susceptible to it. HMAC was introduced to overcome this attack on MAC's. http://www.youtube.com/zarigatongy
  • 6. HMAC Specification • To compute a MAC over the data ‘text’ using the HMAC function, the following operation is performed: MAC(text)=HMAC(K, text) = H((K0⊕opad)|| H((K0⊕ipad) || text)) Terms • K= Secret Key, • K0=The key K after any necessary pre-processing to form a B byte key. • ⊕ = Exclusive OR • ipad=Inner Pad, the byte x’36‘ repeated B times. http://www.youtube.com/zarigatongy • opad=Outer Pad, the byte x‘5c‘ repeated B times.
  • 8. Example : bash to calculate HMAC #echo -n "value" | openssl dgst -sha1 -hmac "key" 57443a4c052350a44638835d64fd66822f813319 #echo -n "value" | openssl sha1 -hmac "key" 57443a4c052350a44638835d64fd66822f813319 #echo '<?= hash_hmac("sha1", "value", "key") ?>' | php 57443a4c052350a44638835d64fd66822f813319 http://www.youtube.com/zarigatongy
  • 9. More Protocol Tutorials • • • • • • • • • • AES Tutorial Click Here X.509 Certificate SSL Protocol Click here DHCPv6 Protocol Click Here CHAP Protocol Click Here ISCSI Protocol Tutorial Click Here BGP Tutorial Click Here RADIUS Protocol Click Here PPP Protocol Click Here PPPoE Protocol Click Here http://youtube.com/zarigatongy