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

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 

Último (20)

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.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